Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import XCTest
- class UIBottleFeedsTestCase: UITestCase {
- var loginTestScreen: UITestLoginScreen!
- var mainMenuTestScreen: UIMainMenuTestScreen!
- var dailyMenuTestScreen: UIDailyMenuTestScreen!
- var bottleFeedsTestScreen: UIBottleFeedsTestScreen!
- var calendarTestScreen: UICalendarTestScreen!
- var bottlesTestScreen: UIBottlesTestScreen!
- var pinScreen: UIPinLoginTestScreen!
- var parentMainMenu: UIMainParentMenuTestScreen!
- var parentSideChildrenMenu: UIParentSideChildrenMenuTestScreen!
- var bottleFeedsParentTestScreen: UIBottleFeedsParentTestScreen!
- var calendarParentTestScreen: UICalendarParentTestScreen!
- var bottlesParentTestScreen: UIBottlesParentTestScreen!
- override func initTestScreens() {
- loginTestScreen = UITestLoginScreen(testCase: self)
- mainMenuTestScreen = UIMainMenuTestScreen(testCase: self)
- dailyMenuTestScreen = UIDailyMenuTestScreen(testCase: self)
- bottleFeedsTestScreen = UIBottleFeedsTestScreen(testCase: self)
- calendarTestScreen = UICalendarTestScreen(testCase: self)
- bottlesTestScreen = UIBottlesTestScreen(testCase: self)
- pinScreen = UIPinLoginTestScreen(testCase: self)
- parentMainMenu = UIMainParentMenuTestScreen(testCase: self)
- parentSideChildrenMenu = UIParentSideChildrenMenuTestScreen(testCase: self)
- bottleFeedsParentTestScreen = UIBottleFeedsParentTestScreen(testCase: self)
- calendarParentTestScreen = UICalendarParentTestScreen(testCase: self)
- bottlesParentTestScreen = UIBottlesParentTestScreen(testCase: self)
- }
- func test_J3_04_Daily_BottleFeeds_iOS_TC1() {
- loginTestScreen.loginWithDevelopCredentials(reLogin: false)
- mainMenuTestScreen.waitForBecomeVisible()
- mainMenuTestScreen.selectDailyMenuItem()
- dailyMenuTestScreen.waitForBecomeVisible()
- dailyMenuTestScreen.selectMenuItem(identifier: bottleFeedsIdentifier)
- bottleFeedsTestScreen.waitForBecomeVisible()
- bottleFeedsTestScreen.findChild()
- bottleFeedsTestScreen.addBottleFeed()
- bottleFeedsTestScreen.checkChanges()
- sleep(5)
- }
- func test_J3_04_Daily_BottleFeeds_iOS_TC2() {
- loginTestScreen.loginWithDevelopCredentials(reLogin: false)
- mainMenuTestScreen.waitForBecomeVisible()
- mainMenuTestScreen.selectDailyMenuItem()
- dailyMenuTestScreen.waitForBecomeVisible()
- dailyMenuTestScreen.selectMenuItem(identifier: bottleFeedsIdentifier)
- bottleFeedsTestScreen.waitForBecomeVisible()
- bottleFeedsTestScreen.findChild()
- bottleFeedsTestScreen.openCalendar()
- calendarTestScreen.selectDate()
- bottlesTestScreen.addBottleFeed()
- bottlesTestScreen.goBack()
- calendarTestScreen.goBack()
- bottleFeedsTestScreen.waitForBecomeVisible()
- bottleFeedsTestScreen.checkChanges()
- sleep(5)
- }
- func test_J3_04_Daily_BottleFeeds_iOS_TC3() {
- loginTestScreen.loginWithDevelopCredentials(reLogin: false)
- mainMenuTestScreen.waitForBecomeVisible()
- mainMenuTestScreen.selectDailyMenuItem()
- dailyMenuTestScreen.waitForBecomeVisible()
- dailyMenuTestScreen.selectMenuItem(identifier: bottleFeedsIdentifier)
- bottleFeedsTestScreen.waitForBecomeVisible()
- bottleFeedsTestScreen.findChild()
- bottleFeedsTestScreen.openCalendar()
- calendarTestScreen.selectDate()
- bottlesTestScreen.addBottleFeed()
- bottlesTestScreen.deleteBottle()
- sleep(2)
- XCTAssertFalse(bottlesTestScreen.bottleExists())
- bottlesTestScreen.goBack()
- calendarTestScreen.goBack()
- bottleFeedsTestScreen.waitForBecomeVisible()
- bottleFeedsTestScreen.checkChangesAfterDeleting()
- sleep(5)
- }
- func test_J3_04_Daily_BottleFeeds_iOS_TC4() {
- loginTestScreen.loginWithCredentials(username: Credentials.parent2UserName, password: Credentials.password)
- parentMainMenu.waitForBecomeVisible()
- parentMainMenu.selectMenuItem(name: childrenIdentifier)
- parentSideChildrenMenu.selectMenuItem(name: bottleFeedsIdentifier)
- bottleFeedsParentTestScreen.waitForBecomeVisible()
- let initialBottlesCount = bottleFeedsParentTestScreen.childHasBottles()
- bottleFeedsParentTestScreen.addBottleFeed()
- XCTAssertTrue(bottleFeedsParentTestScreen.checkBottlesAdded(amount: initialBottlesCount + 1))
- sleep(3)
- }
- func test_J3_04_Daily_BottleFeeds_iOS_TC5() {
- loginTestScreen.loginWithCredentials(username: Credentials.parent2UserName, password: Credentials.password)
- parentMainMenu.waitForBecomeVisible()
- parentMainMenu.selectMenuItem(name: childrenIdentifier)
- parentSideChildrenMenu.selectMenuItem(name: bottleFeedsIdentifier)
- bottleFeedsParentTestScreen.waitForBecomeVisible()
- let initialBottlesCount = bottleFeedsParentTestScreen.childHasBottles()
- bottleFeedsParentTestScreen.openCalendar()
- calendarParentTestScreen.selectDate()
- bottlesParentTestScreen.addBottleFeed()
- sleep(2)
- bottlesParentTestScreen.goBack()
- calendarParentTestScreen.waitForBecomeVisible()
- calendarParentTestScreen.goBack()
- bottleFeedsParentTestScreen.waitForBecomeVisible()
- XCTAssertTrue(bottleFeedsParentTestScreen.checkBottlesAdded(amount: initialBottlesCount + 1))
- sleep(3)
- }
- func test_J3_04_Daily_BottleFeeds_iOS_TC6() {
- loginTestScreen.loginWithCredentials(username: Credentials.parent2UserName, password: Credentials.password)
- parentMainMenu.waitForBecomeVisible()
- parentMainMenu.selectMenuItem(name: childrenIdentifier)
- parentSideChildrenMenu.selectMenuItem(name: bottleFeedsIdentifier)
- bottleFeedsParentTestScreen.waitForBecomeVisible()
- bottleFeedsParentTestScreen.addBottleFeed()
- let initialBottlesCount = bottleFeedsParentTestScreen.childHasBottles()
- sleep(2)
- bottleFeedsParentTestScreen.goToMainMenu()
- parentMainMenu.waitForBecomeVisible()
- parentMainMenu.logout()
- reloginAsAdmin()
- mainMenuTestScreen.waitForBecomeVisible()
- mainMenuTestScreen.selectDailyMenuItem()
- dailyMenuTestScreen.waitForBecomeVisible()
- dailyMenuTestScreen.selectMenuItem(identifier: bottleFeedsIdentifier)
- bottleFeedsTestScreen.waitForBecomeVisible()
- bottleFeedsTestScreen.findChild()
- bottleFeedsTestScreen.openCalendar()
- calendarTestScreen.selectDate()
- bottlesTestScreen.deleteBottle()
- bottlesTestScreen.goToMainMenu()
- mainMenuTestScreen.waitForBecomeVisible()
- mainMenuTestScreen.logout()
- reloginAsParent()
- parentMainMenu.waitForBecomeVisible()
- parentMainMenu.selectMenuItem(name: childrenIdentifier)
- parentSideChildrenMenu.selectMenuItem(name: bottleFeedsIdentifier)
- bottleFeedsParentTestScreen.waitForBecomeVisible()
- XCTAssertTrue(bottleFeedsParentTestScreen.checkBottlesAdded(amount: initialBottlesCount))
- sleep(3)
- }
- func test_J3_04_Daily_BottleFeeds_iOS_TC7() {
- loginTestScreen.loginWithDevelopCredentials(reLogin: false)
- mainMenuTestScreen.waitForBecomeVisible()
- mainMenuTestScreen.selectDailyMenuItem()
- dailyMenuTestScreen.waitForBecomeVisible()
- dailyMenuTestScreen.selectMenuItem(identifier: bottleFeedsIdentifier)
- bottleFeedsTestScreen.waitForBecomeVisible()
- bottleFeedsTestScreen.findChild()
- bottleFeedsTestScreen.addBottleFeed()
- sleep(1)
- bottleFeedsTestScreen.addBottleFeed()
- bottleFeedsTestScreen.addBottleFeed()
- bottleFeedsTestScreen.goToMainMenu()
- mainMenuTestScreen.logout()
- pinScreen.waitForBecomeVisible()
- pinScreen.goToLoginScreen(title: "Admin Dev-14")
- sleep(3)
- loginTestScreen.loginWithCredentials(username: Credentials.parent2UserName, password: Credentials.password)
- parentMainMenu.waitForBecomeVisible()
- parentMainMenu.selectMenuItem(name: childrenIdentifier)
- parentSideChildrenMenu.selectMenuItem(name: bottleFeedsIdentifier)
- bottleFeedsParentTestScreen.waitForBecomeVisible()
- XCTAssertTrue(bottleFeedsParentTestScreen.checkBottlesAdded(amount: 3))
- sleep(5)
- }
- private func reloginAsParent() {
- sleep(3)
- pinScreen.waitForBecomeVisible()
- pinScreen.goToLoginScreen(title: "Admin Dev-14")
- sleep(3)
- loginTestScreen.loginWithCredentials(username: Credentials.parent2UserName, password: Credentials.password)
- sleep(3)
- }
- private func reloginAsAdmin() {
- sleep(3)
- pinScreen.waitForBecomeVisible()
- pinScreen.goToLoginScreen(title: Credentials.parent2FullName)
- sleep(3)
- loginTestScreen.loginWithCredentials(username: "admin", password: "admin")
- sleep(3)
- }
- }
Add Comment
Please, Sign In to add comment