Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.37 KB | None | 0 0
  1. func testExcessFailedPasscode() {
  2. let passcodeScreen = PasscodeScreen(app: app)
  3. let startScreen = StartScreen(app: app)
  4.  
  5. // Перезапуск приложения
  6. app.terminate()
  7. app.launchArguments = [""]
  8. sleep(5)
  9. app.launch()
  10.  
  11. // Проверка основных элементов экрана
  12. wait(passcodeScreen.enterCodeLabel)
  13. XCTAssert(passcodeScreen.exitButton.exists)
  14. XCTAssert(passcodeScreen.deleteButton.exists)
  15. XCTAssert(passcodeScreen.logo.exists)
  16. XCTAssert(passcodeScreen.pin0Button.exists)
  17. XCTAssert(passcodeScreen.pin1Button.exists)
  18. XCTAssert(passcodeScreen.pin2Button.exists)
  19. XCTAssert(passcodeScreen.pin3Button.exists)
  20. XCTAssert(passcodeScreen.pin4Button.exists)
  21. XCTAssert(passcodeScreen.pin5Button.exists)
  22. XCTAssert(passcodeScreen.pin6Button.exists)
  23. XCTAssert(passcodeScreen.pin7Button.exists)
  24. XCTAssert(passcodeScreen.pin8Button.exists)
  25. XCTAssert(passcodeScreen.pin9Button.exists)
  26.  
  27. // Ввод кода доступа #1
  28. passcodeScreen.pin1Button.tap()
  29. passcodeScreen.pin2Button.tap()
  30. passcodeScreen.pin3Button.tap()
  31. passcodeScreen.pin4Button.tap()
  32.  
  33. // Ввод кода доступа #2
  34. passcodeScreen.pin5Button.tap()
  35. passcodeScreen.pin6Button.tap()
  36. passcodeScreen.pin7Button.tap()
  37. passcodeScreen.pin8Button.tap()
  38.  
  39. // Ввод кода доступа #3
  40. passcodeScreen.pin9Button.tap()
  41. passcodeScreen.pin0Button.tap()
  42. passcodeScreen.pin1Button.tap()
  43. passcodeScreen.pin2Button.tap()
  44.  
  45. // Ввод кода доступа #4
  46. passcodeScreen.pin1Button.tap()
  47. passcodeScreen.pin1Button.tap()
  48. passcodeScreen.pin1Button.tap()
  49. passcodeScreen.pin1Button.tap()
  50.  
  51. // Ввод кода доступа #5
  52. passcodeScreen.pin0Button.tap()
  53. passcodeScreen.pin0Button.tap()
  54. passcodeScreen.pin0Button.tap()
  55. passcodeScreen.pin0Button.tap()
  56.  
  57. // Проверка текста ошибки
  58. wait(app.staticTexts["Ошибка"])
  59. XCTAssert(app.staticTexts["Превышено число попыток неверного ввода короткого пароля. Просьба авторизоваться с логином и паролем"].exists)
  60. app.buttons["Ok"].tap()
  61.  
  62. // Проверка основных элементов на стартовом экране
  63. wait(startScreen.loginButton)
  64. XCTAssert(startScreen.registrationButton.exists)
  65. XCTAssert(startScreen.guestLoginButton.exists)
  66. XCTAssert(startScreen.loginButton.exists)
  67. XCTAssert(startScreen.logo.exists)
  68. }
  69.  
  70. func testTimur() {
  71.  
  72. // Проверка логаута
  73. let app = XCUIApplication()
  74. app/*@START_MENU_TOKEN@*/.navigationBars["Котировки"]/*[[".otherElements[\"TabBarViewController\"]",".otherElements[\"UINavigationController\"].navigationBars[\"Котировки\"]",".navigationBars[\"Котировки\"]",".otherElements.matching(identifier: \"UINavigationController\").navigationBars[\"Котировки\"]"],[[[-1,2],[-1,3],[-1,0,1]],[[-1,2],[-1,1]]],[0]]@END_MENU_TOKEN@*/.buttons["navbarHamburger"].tap()
  75. app/*@START_MENU_TOKEN@*/.buttons["SideMenuViewController._headerView.signInOutButton"]/*[[".otherElements[\"UISideMenuNavigationController\"]",".otherElements[\"SideMenuViewController\"]",".otherElements[\"SideMenuViewController._headerView\"]",".buttons[\"sidemenuSignOut\"]",".buttons[\"SideMenuViewController._headerView.signInOutButton\"]"],[[[-1,4],[-1,3],[-1,2,3],[-1,1,2],[-1,0,1]],[[-1,4],[-1,3],[-1,2,3],[-1,1,2]],[[-1,4],[-1,3],[-1,2,3]],[[-1,4],[-1,3]]],[0]]@END_MENU_TOKEN@*/.tap()
  76. app/*@START_MENU_TOKEN@*/.alerts["HoverAlertController"]/*[[".windows[\"HoverAlertController._alertWindow\"].alerts[\"HoverAlertController\"]",".alerts[\"HoverAlertController\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.buttons["Да"].tap()
  77.  
  78. // Перезапуск приложения
  79. app.terminate()
  80. app.launchArguments = [""]
  81. sleep(5)
  82. app.launch()
  83.  
  84. }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement