Skip to content

Commit

Permalink
For #6587 - FollowUp to Fix RTL screenshots tests
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelrios committed May 13, 2020
1 parent 13db9e3 commit 228d156
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions L10nSnapshotTests/L10nSuite1SnapshotTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,30 +70,35 @@ class L10nSuite1SnapshotTests: L10nBaseSnapshotTests {
snapshot("ContextMenuReloadButton-03", waitForLoadingIndicator: false)
}

func test4PasscodeSettings() {
navigator.goto(SetPasscodeScreen)
snapshot("SetPasscodeScreen-1-nopasscode")
userState.newPasscode = "111111"

// Workaround to be able to type numbers in right to left locales
waitForExistence(app.navigationBars["Set Passcode"])
if (app.keys["123"].exists) {
app.keys["123"].tap()
private func typePasscode(n: Int, keyNumber: Int) {
for _ in 1...n {
app.keys.element(boundBy: keyNumber).tap()
sleep(1)
}
waitForExistence(app.keys["1"])
}

navigator.performAction(Action.SetPasscodeTypeOnce)
func test4PasscodeSettings() {
navigator.goto(PasscodeSettings)
app.tables.cells["TurnOnPasscode"].tap()
snapshot("SetPasscodeScreen-1-nopasscode")

// Type "111111 passcode"
typePasscode(n: 6, keyNumber: 2)
snapshot("SetPasscodeScreen-2-typepasscode")

userState.newPasscode = "111112"
navigator.performAction(Action.SetPasscodeTypeOnce)
// Type incorrect passcode "111112"
typePasscode(n: 5, keyNumber: 2)
// Type once inkey "2"
typePasscode(n: 1, keyNumber: 1)
snapshot("SetPasscodeScreen-3-passcodesmustmatch")

userState.newPasscode = "111111"
navigator.performAction(Action.SetPasscode)

// Confitm passcode
typePasscode(n: 6, keyNumber: 2)
typePasscode(n: 6, keyNumber: 2)
snapshot("SetPasscodeScreen-3")

navigator.goto(PasscodeIntervalSettings)

// Go to interval settings
app.tables.cells["PasscodeInterval"].tap()
typePasscode(n: 6, keyNumber: 2)
snapshot("PasscodeIntervalScreen-1")
}

Expand Down

0 comments on commit 228d156

Please sign in to comment.