-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[XCUITests] Initial tests for Activity Indicator #1458
[XCUITests] Initial tests for Activity Indicator #1458
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use lint to enforce some stylistic conventions. I got it with homebrew (https://formulae.brew.sh/formula/swiftlint) and you can run it in the terminal before pushing PRs and it'll fix the warnings for you :)
} | ||
|
||
func testSizes() throws { | ||
XCTAssertEqual(app.images.element(boundBy: 0).identifier, "Activity Indicator that is In progress of size 4") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting note: these tests fail if your simulator is set to any language other than en-US
. Are we okay with that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't have access to language inside each test so I think we might have to be if we want any sort of ui tests but I am open to any suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think any tests we write should eventually work for any language we configure the tests to run on. Accessibility label/accessibility names both get localized, can we build the accessibility identifier off of something else?
Looks like the accessibility label is created from the isAnimating property on the activity indicator, maybe we can use that directly. Color seems a little more tricky - I wonder if we can use the RGB value
if app.staticTexts["FluentUI DEV"].exists { | ||
app.staticTexts["ActivityIndicator"].tap() | ||
} else if !app.staticTexts["ActivityIndicator"].exists { | ||
app.buttons["FluentUI DEV"].tap() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm is there a button called FluentUI Dev?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no label for the back button so it defaulted to FluentUI Dev. I wasn't sure if I should go in and change it so I left if for now.
continueAfterFailure = false | ||
app.launch() | ||
|
||
if app.staticTexts["FluentUI DEV"].exists { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we might want to consider setting up "FluentUI DEV" and "ActivityIndicator" as constants, as well as some of the controls we're testing ex. "app.switches["Animating"]" maybe could be defined once
} | ||
|
||
func testSizes() throws { | ||
XCTAssertEqual(app.images.element(boundBy: 0).identifier, "Activity Indicator that is In progress of size 4") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think any tests we write should eventually work for any language we configure the tests to run on. Accessibility label/accessibility names both get localized, can we build the accessibility identifier off of something else?
Looks like the accessibility label is created from the isAnimating property on the activity indicator, maybe we can use that directly. Color seems a little more tricky - I wonder if we can use the RGB value
Some overall notes:
And also great work on getting the first XCUITest up and running in FUA! Setting up anything new can be really daunting so great work diving in this :) |
Closing to focus on launch tests first. |
Platforms Impacted
Description of changes
Binary change:
Added initial tests for activity indicator. These include tests for size, color, and starting/stopping activity (both when hidden when stopped is turned on and off).
Verification
Pull request checklist
This PR has considered:
Microsoft Reviewers: Open in CodeFlow