@@ -22,10 +22,10 @@ class WordPressScreenshotGeneration: XCTestCase {
2222 // Put teardown code here. This method is called after the invocation of each test method in the class.
2323 super. tearDown ( )
2424 }
25-
25+
2626 func testGenerateScreenshots( ) {
2727 let app = XCUIApplication ( )
28-
28+
2929 let username1Exist = app. textFields [ " Email or username " ] . exists
3030 let username2Exist = app. textFields [ " Username / Email " ] . exists
3131
@@ -36,10 +36,10 @@ class WordPressScreenshotGeneration: XCTestCase {
3636 app. tables. cells. elementBoundByIndex ( 5 ) . tap ( )
3737 app. alerts. elementBoundByIndex ( 0 ) . collectionViews. buttons. elementBoundByIndex ( 1 ) . tap ( )
3838 }
39-
39+
4040 // Login
4141 let username = " ENTER-USERNAME-HERE "
42-
42+
4343 if username1Exist {
4444 let usernameEmailTextField = app. textFields [ " Email or username " ]
4545 usernameEmailTextField. tap ( )
@@ -50,17 +50,17 @@ class WordPressScreenshotGeneration: XCTestCase {
5050 usernameEmailTextField. tap ( )
5151 usernameEmailTextField. typeText ( username)
5252 }
53-
53+
5454
5555 let passwordSecureTextField = app. secureTextFields [ " Password " ]
5656 passwordSecureTextField. tap ( )
5757 passwordSecureTextField. typeText ( " ENTER-PASSWORD-HERE " )
58-
58+
5959 app. buttons [ " Sign In " ] . tap ( )
6060
6161 // Get Reader Screenshot
6262 app. tabBars [ " Main Navigation " ] . buttons [ " Reader " ] . tap ( )
63-
63+
6464 app. tables. staticTexts [ " Discover " ] . tap ( )
6565 sleep ( 5 )
6666 snapshot ( " 1-Reader " )
@@ -78,15 +78,15 @@ class WordPressScreenshotGeneration: XCTestCase {
7878 // Get "Post" screenshot
7979 let otherElements = app. otherElements
8080 otherElements. elementBoundByIndex ( 9 ) . tap ( )
81-
81+
8282 // Dismiss Unsaved Changes Alert if it shows up
8383 if XCUIApplication ( ) . alerts [ " Unsaved changes. " ] . exists {
8484 app. alerts [ " Unsaved changes. " ] . collectionViews. buttons [ " OK " ] . tap ( )
8585 app. navigationBars [ " WPPostView " ] . buttons [ " Cancel " ] . tap ( )
8686 app. sheets [ " You have unsaved changes. " ] . collectionViews. buttons [ " Discard " ] . tap ( )
8787 otherElements. elementBoundByIndex ( 9 ) . tap ( )
8888 }
89-
89+
9090 // Pull up keyboard
9191 app. navigationBars [ " WPPostView " ] . buttons [ " Edit " ] . tap ( )
9292 app. staticTexts [ " We hiked along the Pacific, in the town of " ] . tap ( )
0 commit comments