-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17536 from wordpress-mobile/reader-ui-tests-clean
Add UI tests to check the ability to scroll reader content and interact with the items
- Loading branch information
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import UITestsFoundation | ||
import XCTest | ||
|
||
class ReaderTests: XCTestCase { | ||
private var readerScreen: ReaderScreen! | ||
|
||
override func setUpWithError() throws { | ||
setUpTestSuite() | ||
|
||
_ = try LoginFlow.loginIfNeeded(siteUrl: WPUITestCredentials.testWPcomSiteAddress, email: WPUITestCredentials.testWPcomUserEmail, password: WPUITestCredentials.testWPcomPassword) | ||
readerScreen = try EditorFlow | ||
.goToMySiteScreen() | ||
.tabBar.goToReaderScreen() | ||
} | ||
|
||
override func tearDownWithError() throws { | ||
takeScreenshotOfFailedTest() | ||
if readerScreen != nil && !TabNavComponent.isVisible() { | ||
readerScreen.dismissPost() | ||
} | ||
try LoginFlow.logoutIfNeeded() | ||
try super.tearDownWithError() | ||
} | ||
|
||
let expectedPostContent = "Aenean vehicula nunc in sapien rutrum, nec vehicula enim iaculis. Aenean vehicula nunc in sapien rutrum, nec vehicula enim iaculis. Proin dictum non ligula aliquam varius. Nam ornare accumsan ante, sollicitudin bibendum erat bibendum nec. Aenean vehicula nunc in sapien rutrum, nec vehicula enim iaculis." | ||
|
||
func testViewPost() { | ||
readerScreen.openLastPost() | ||
XCTAssert(readerScreen.postContentEquals(expectedPostContent)) | ||
} | ||
|
||
func testViewPostInSafari() { | ||
readerScreen.openLastPostInSafari() | ||
XCTAssert(readerScreen.postContentEquals(expectedPostContent)) | ||
} | ||
} |