Skip to content
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

Fix UI Tests #1345

Merged
merged 16 commits into from
Jul 16, 2024
Merged

Fix UI Tests #1345

merged 16 commits into from
Jul 16, 2024

Conversation

jaxdesmarais
Copy link
Contributor

@jaxdesmarais jaxdesmarais commented Jun 25, 2024

Summary of changes

Checklist

  • [ ] Added a changelog entry

Authors

@jaxdesmarais jaxdesmarais mentioned this pull request Jun 28, 2024
1 task
@@ -20,7 +20,7 @@ jobs:
- name: Install CocoaPod dependencies
run: pod install
- name: Run Unit Tests
run: set -o pipefail && xcodebuild -workspace 'Braintree.xcworkspace' -sdk 'iphonesimulator' -configuration 'Debug' -scheme 'UnitTests' -destination 'name=iPhone 14,OS=17.2,platform=iOS Simulator' test | ./Pods/xcbeautify/xcbeautify
run: set -o pipefail && xcodebuild -workspace 'Braintree.xcworkspace' -sdk 'iphonesimulator' -configuration 'Debug' -scheme 'UnitTests' -destination 'name=iPhone 15,OS=17.2,platform=iOS Simulator' test | ./Pods/xcbeautify/xcbeautify
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pulled from the findings in PR #1328

@@ -7,5 +7,10 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
AppSwitcher.openVenmoURL = URLContexts.first?.url
}

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pulled from the findings in PR #1290

app.enterCardDetailsWith(cardNumber: "4000000000001075")
app.tokenizeButton.tap()
sleep(2)

waitForElementToAppear(app.liabilityCouldNotBeShiftedMessage, timeout:30)
waitForElementToAppear(app.liabilityCouldNotBeShiftedMessage, timeout:45)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was failing because the Cardinal timeout for this card number is 30s, so I bumped it a bit beyond to ensure we always get a response

@@ -992,6 +992,7 @@
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
"$(FRAMEWORK_SEARCH_PATHS)",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a few threads in the GitHub actions issues that indicated that at times the CI runner cannot find the frameworks, so adding this to the demo app should increase the search path coverage in addition to the above paths.

@@ -12,11 +12,10 @@ class ThreeDSecure_V2_UITests: XCTestCase {
app.launchArguments.append("-UITestHardcodedClientToken")
app.launchArguments.append("-Integration:ThreeDSecureViewController")
app.launch()

waitForElementToAppear(app.cardNumberTextField)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving this logic out of setup produced more stability in the tests both locally and in CI.

@@ -19,7 +19,7 @@ class AmericanExpress_UITests: XCTestCase {
app.buttons["Valid card"].tap()
sleep(2)

XCTAssertTrue(app.buttons["45256433 Points, 316795.03 USD"].waitForExistence(timeout: 10))
XCTAssertTrue(app.buttons["45256433 Points, 316795.03 USD"].waitForExistence(timeout: 20))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While there are several instances in this PR just bumping timeouts, several of these test were also hitting the same timeouts locally. If the test completes before time timeout is hit it'll move on to the next test so there is no real harm in bumping the timeouts for the recurring failing tests.

@jaxdesmarais
Copy link
Contributor Author

I have run the UI tests 10x between Friday and today and all 10 runs have passed. You can see this under the "checks" tab.

@jaxdesmarais jaxdesmarais changed the title [DO NOT REVIEW] Venmo UITests Fix Venmo UI Tests Jul 15, 2024
@jaxdesmarais jaxdesmarais marked this pull request as ready for review July 15, 2024 14:29
@jaxdesmarais jaxdesmarais requested a review from a team as a code owner July 15, 2024 14:29
@jaxdesmarais jaxdesmarais changed the title Fix Venmo UI Tests Fix UI Tests Jul 15, 2024
@jaxdesmarais jaxdesmarais merged commit f794bdc into main Jul 16, 2024
7 checks passed
@jaxdesmarais jaxdesmarais deleted the venmo-ui-tests branch July 16, 2024 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants