[UI Tests] - Part 1 - Update structure of Login and Editor related screens#21122
Merged
[UI Tests] - Part 1 - Update structure of Login and Editor related screens#21122
Conversation
Contributor
|
| App Name | Jetpack Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr21122-f7dec26 | |
| Version | 22.8 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | f7dec26 | |
| App Center Build | jetpack-installable-builds #5434 |
Contributor
|
| App Name | WordPress Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr21122-f7dec26 | |
| Version | 22.8 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | f7dec26 | |
| App Center Build | WPiOS - One-Offs #6407 |
Generated by 🚫 dangerJS |
pachlava
approved these changes
Jul 20, 2023
Comment on lines
-35
to
+49
| let actualPostTitle = app.staticTexts["postTitle"].label | ||
| let actualSiteAddress = app.staticTexts["siteUrl"].label | ||
| let actualPostTitle = postTitle.label | ||
| let actualSiteUrl = siteUrl.label | ||
|
|
||
| XCTAssertEqual(expectedPostTitle, actualPostTitle, "Post title doesn't match expected title") | ||
| XCTAssertEqual(expectedSiteAddress, actualSiteAddress, "Site address doesn't match expected address") | ||
| XCTAssertEqual(expectedSiteAddress, actualSiteUrl, "Site address doesn't match expected address") |
Contributor
There was a problem hiding this comment.
Not saying this is something critical, but with newer styling, this would look even shorter / arguably easier to read:
XCTAssertEqual(expectedPostTitle, postTitle.label, "Post title doesn't match expected title")
XCTAssertEqual(expectedSiteAddress, siteUrl.label, "Site address doesn't match expected address")
Contributor
There was a problem hiding this comment.
I agree, that's the prize for choosing meaningful element names. =)
Contributor
Author
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
While working more on the UI tests recently, I noticed multiple screens are structured differently. And when going through some flows (especially login and editor) it took a while for me to understand them individually, even though they aim to do the same thing. While all of the screens work (nothing wrong with the different implementations), I wondered if it was necessary, the main reason it happened was that different people were working on them at different times. There wasn't a standard for how the screens were defined.
To make it easier for contributors (especially first-time contributors to UI tests), I'm updating the screens to follow the same structure (especially for
getters,elements, and screen initializationinit). While at it, I also did some cleanup to remove unused code and some comments that are no longer relevant on the screens I updated.This first cleanup is for Login and Editor-related screens. As these two are used in most of the tests
Setup()I figured it would be good to combine them.Testing
CI should be 🟢