-
Notifications
You must be signed in to change notification settings - Fork 295
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
Fix UI Tests #1345
Changes from all commits
f031476
6bfe76b
5d6d5ce
ede2054
88f9abe
ba12606
26cbb1f
971ac57
48dcd6f
067f8ac
daf9309
59d8669
6be8e7d
e5542fe
1c2411d
60c0543
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -992,6 +992,7 @@ | |
"$(inherited)", | ||
"@executable_path/Frameworks", | ||
"@loader_path/Frameworks", | ||
"$(FRAMEWORK_SEARCH_PATHS)", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
); | ||
PRODUCT_BUNDLE_IDENTIFIER = com.braintree.DemoUITests; | ||
"PRODUCT_BUNDLE_IDENTIFIER[sdk=macosx*]" = ""; | ||
|
@@ -1015,6 +1016,7 @@ | |
"$(inherited)", | ||
"@executable_path/Frameworks", | ||
"@loader_path/Frameworks", | ||
"$(FRAMEWORK_SEARCH_PATHS)", | ||
); | ||
PRODUCT_BUNDLE_IDENTIFIER = com.braintree.DemoUITests; | ||
"PRODUCT_BUNDLE_IDENTIFIER[sdk=macosx*]" = ""; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is pulled from the findings in PR #1290 |
||
let urlContexts = connectionOptions.urlContexts | ||
AppSwitcher.openVenmoURL = urlContexts.first?.url | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
} | ||
|
||
func testInsufficientPointsCard_receivesErrorMessage() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,10 @@ class ThreeDSecure_V2_UITests: XCTestCase { | |
app.launchArguments.append("-UITestHardcodedClientToken") | ||
app.launchArguments.append("-Integration:ThreeDSecureViewController") | ||
app.launch() | ||
|
||
waitForElementToAppear(app.cardNumberTextField) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
} | ||
|
||
func testThreeDSecurePaymentFlowV2_frictionlessFlow_andTransacts() { | ||
waitForElementToAppear(app.cardNumberTextField) | ||
app.enterCardDetailsWith(cardNumber: "4000000000001000", expirationDate: expirationDate) | ||
app.tokenizeButton.tap() | ||
sleep(2) | ||
|
@@ -25,6 +24,7 @@ class ThreeDSecure_V2_UITests: XCTestCase { | |
} | ||
|
||
func testThreeDSecurePaymentFlowV2_challengeFlow_andTransacts() { | ||
waitForElementToAppear(app.cardNumberTextField) | ||
app.enterCardDetailsWith(cardNumber: "4000000000001091", expirationDate: expirationDate) | ||
app.tokenizeButton.tap() | ||
sleep(2) | ||
|
@@ -44,6 +44,7 @@ class ThreeDSecure_V2_UITests: XCTestCase { | |
} | ||
|
||
func testThreeDSecurePaymentFlowV2_noChallenge_andFails() { | ||
waitForElementToAppear(app.cardNumberTextField) | ||
app.enterCardDetailsWith(cardNumber: "5200000000001013", expirationDate: expirationDate) | ||
app.tokenizeButton.tap() | ||
sleep(2) | ||
|
@@ -52,6 +53,7 @@ class ThreeDSecure_V2_UITests: XCTestCase { | |
} | ||
|
||
func testThreeDSecurePaymentFlowV2_challengeFlow_andFails() { | ||
waitForElementToAppear(app.cardNumberTextField) | ||
app.enterCardDetailsWith(cardNumber: "4000000000001109", expirationDate: expirationDate) | ||
app.tokenizeButton.tap() | ||
sleep(2) | ||
|
@@ -71,6 +73,7 @@ class ThreeDSecure_V2_UITests: XCTestCase { | |
} | ||
|
||
func testThreeDSecurePaymentFlowV2_acceptsPassword_failsToAuthenticateNonce_dueToCardinalError() { | ||
waitForElementToAppear(app.cardNumberTextField) | ||
app.enterCardDetailsWith(cardNumber: "4000000000001125") | ||
app.tokenizeButton.tap() | ||
sleep(2) | ||
|
@@ -90,6 +93,7 @@ class ThreeDSecure_V2_UITests: XCTestCase { | |
} | ||
|
||
func testThreeDSecurePaymentFlowV2_returnsToApp_whenCancelTapped() { | ||
waitForElementToAppear(app.cardNumberTextField) | ||
app.enterCardDetailsWith(cardNumber: "4000000000001091") | ||
app.tokenizeButton.tap() | ||
sleep(2) | ||
|
@@ -102,6 +106,7 @@ class ThreeDSecure_V2_UITests: XCTestCase { | |
} | ||
|
||
func testThreeDSecurePaymentFlowV2_bypassedAuthentication() { | ||
waitForElementToAppear(app.cardNumberTextField) | ||
app.enterCardDetailsWith(cardNumber: "4000000000001083") | ||
app.tokenizeButton.tap() | ||
sleep(2) | ||
|
@@ -110,6 +115,7 @@ class ThreeDSecure_V2_UITests: XCTestCase { | |
} | ||
|
||
func testThreeDSecurePaymentFlowV2_lookupError() { | ||
waitForElementToAppear(app.cardNumberTextField) | ||
app.enterCardDetailsWith(cardNumber: "4000000000001034") | ||
app.tokenizeButton.tap() | ||
sleep(2) | ||
|
@@ -118,10 +124,11 @@ class ThreeDSecure_V2_UITests: XCTestCase { | |
} | ||
|
||
func testThreeDSecurePaymentFlowV2_timeout() { | ||
waitForElementToAppear(app.cardNumberTextField) | ||
app.enterCardDetailsWith(cardNumber: "4000000000001075") | ||
app.tokenizeButton.tap() | ||
sleep(2) | ||
|
||
waitForElementToAppear(app.liabilityCouldNotBeShiftedMessage, timeout:30) | ||
waitForElementToAppear(app.liabilityCouldNotBeShiftedMessage, timeout:45) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
} | ||
} |
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.
This is pulled from the findings in PR #1328