-
Notifications
You must be signed in to change notification settings - Fork 996
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 Customize Link-inline sign up view appearance (#913)
* Customize link inline sign up appearance * Styleize region placeholder * Change text color for legal view * Update from PR feedback * set font lastt * One more little hack * Call super and fix border color * update snapshots * update more snapshots
- Loading branch information
1 parent
6c6aa43
commit 69f7bbc
Showing
28 changed files
with
136 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,6 +148,34 @@ class PaymentSheetSnapshotTests: FBSnapshotTestCase { | |
let imageView = UIImageView(image: screenshot) | ||
verify(imageView) | ||
} | ||
|
||
func testLink() { | ||
app.staticTexts["PaymentSheet (test playground)"].tap() | ||
setupLink() | ||
let screenshot = app.screenshot().image.removingStatusBar | ||
let imageView = UIImageView(image: screenshot) | ||
verify(imageView) | ||
} | ||
|
||
func testLink_darkMode() { | ||
launchInDarkMode() | ||
app.staticTexts["PaymentSheet (test playground)"].tap() | ||
setupLink() | ||
let screenshot = app.screenshot().image.removingStatusBar | ||
let imageView = UIImageView(image: screenshot) | ||
verify(imageView) | ||
} | ||
|
||
func testLinkWithAppearance() { | ||
app.staticTexts["PaymentSheet (test playground)"].tap() | ||
applySnapshotTestingAppearance() | ||
setupLink() | ||
let screenshot = app.screenshot().image.removingStatusBar | ||
let imageView = UIImageView(image: screenshot) | ||
verify(imageView) | ||
} | ||
|
||
// MARK: Common Helpers | ||
|
||
private func testCard() { | ||
app.staticTexts[ | ||
|
@@ -224,6 +252,28 @@ class PaymentSheetSnapshotTests: FBSnapshotTestCase { | |
XCTAssertTrue(app.buttons["Checkout (Complete)"].waitForExistence(timeout: 60.0)) | ||
} | ||
|
||
private func setupLink() { | ||
let apmSelector = app.segmentedControls["automatic_payment_methods_selector"] | ||
XCTAssertTrue(apmSelector.waitForExistence(timeout: 60.0)) | ||
apmSelector.buttons["off"].tap() | ||
app.segmentedControls["link_selector"].buttons["on"].tap() | ||
reload() | ||
app.buttons["Checkout (Complete)"].tap() | ||
|
||
let saveSwitch = app.switches["Save my info for secure 1-click checkout"] | ||
XCTAssertTrue(saveSwitch.waitForExistence(timeout: 60.0)) | ||
saveSwitch.tap() | ||
|
||
let emailField = app.textFields["Email"] | ||
XCTAssertTrue(emailField.waitForExistence(timeout: 60.0)) | ||
emailField.tap() | ||
emailField.typeText("[email protected]") | ||
emailField.typeText(XCUIKeyboardKey.return.rawValue) | ||
|
||
app.scrollViews.firstMatch.scrollToElement(element: app.buttons["Pay $50.99"]) | ||
Thread.sleep(forTimeInterval: 1.0) // wait for scroll animation to finish | ||
} | ||
|
||
private func reload() { | ||
app.buttons["Reload PaymentSheet"].tap() | ||
|
||
|
@@ -278,3 +328,16 @@ private extension UIImage { | |
return nil | ||
} | ||
} | ||
|
||
private extension XCUIElement { | ||
func scrollToElement(element: XCUIElement) { | ||
while !element.visible() { | ||
swipeUp() | ||
} | ||
} | ||
|
||
func visible() -> Bool { | ||
guard self.exists && !self.frame.isEmpty else { return false } | ||
return XCUIApplication().windows.element(boundBy: 0).frame.contains(self.frame) | ||
} | ||
} |
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
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
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
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
Binary file modified
BIN
-1.49 KB
(99%)
...PaymentSheetUITest.PaymentSheetSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+210 KB
...ReferenceImages_64/PaymentSheetUITest.PaymentSheetSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+190 KB
...s_64/PaymentSheetUITest.PaymentSheetSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+188 KB
...Images_64/PaymentSheetUITest.PaymentSheetSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-364 Bytes
(99%)
...64/StripeiOS_Tests.LinkInlineSignupElementSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.47 KB
(100%)
...4/StripeiOS_Tests.LinkInlineSignupElementSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+51 Bytes
(100%)
...ceImages_64/StripeiOS_Tests.LinkLegalTermsViewSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-52 Bytes
(100%)
...4/StripeiOS_Tests.LinkLegalTermsViewSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-28 Bytes
(100%)
...nceImages_64/StripeiOS_Tests.LinkLegalTermsViewSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-51 Bytes
(100%)
...s_64/StripeiOS_Tests.LinkLegalTermsViewSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.26 KB
(89%)
...4/StripeiOS_Tests.LinkLegalTermsViewSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-67 Bytes
(100%)
...s_64/StripeiOS_Tests.LinkLegalTermsViewSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+92 Bytes
(100%)
...s_64/StripeiOS_Tests.LinkLegalTermsViewSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+197 Bytes
(100%)
...s_64/StripeiOS_Tests.LinkLegalTermsViewSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+234 Bytes
(100%)
...s_64/StripeiOS_Tests.LinkLegalTermsViewSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+82 Bytes
(100%)
...StripeiOS_Tests.LinkLegalTermsViewSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.