Skip to content

Commit bebdb60

Browse files
authored
chore: update integration test to match latest UX updates (#91)
1 parent e6db58c commit bebdb60

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

Tests/IntegrationTestApp/IntegrationTestAppUITests/LivenessIntegrationUITests.swift

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ class CreateLivenessSessionUITests: XCTestCase {
2626
Thread.sleep(forTimeInterval: 2)
2727
XCTAssert(app!.buttons[UIConstants.BeginCheck.primaryButton].exists)
2828
XCTAssertFalse(app!.buttons[UIConstants.primaryButton].exists)
29-
let scrollViewsQuery = app!.scrollViews
30-
let elementsQuery = scrollViewsQuery.otherElements
31-
XCTAssertEqual(elementsQuery.staticTexts.element(boundBy: 1).label, UIConstants.BeginCheck.description)
32-
XCTAssert(elementsQuery.buttons[UIConstants.BeginCheck.warning].exists)
33-
XCTAssert(elementsQuery.staticTexts[UIConstants.BeginCheck.instruction].exists)
29+
XCTAssert(app!.staticTexts[UIConstants.BeginCheck.warningTitle].exists)
30+
XCTAssert(app!.staticTexts[UIConstants.BeginCheck.warningDescription].exists)
31+
XCTAssert(app!.staticTexts[UIConstants.BeginCheck.instruction].exists)
3432
}
3533

3634
func testStartLivenessIntegration() throws {
@@ -40,14 +38,11 @@ class CreateLivenessSessionUITests: XCTestCase {
4038
app?.buttons[UIConstants.primaryButton].tap()
4139
Thread.sleep(forTimeInterval: 2)
4240
XCTAssert(app!.buttons[UIConstants.BeginCheck.primaryButton].exists)
43-
XCTAssertFalse(app!.buttons[UIConstants.primaryButton].exists)
4441
app!.buttons[UIConstants.BeginCheck.primaryButton].tap()
4542
Thread.sleep(forTimeInterval: 2)
46-
XCTAssert(app!.staticTexts[UIConstants.LivenessCheck.countdownInstruction].exists)
4743
XCTAssert(app!.buttons[UIConstants.LivenessCheck.closeButton].exists)
48-
Thread.sleep(forTimeInterval: 3)
4944
XCTAssert(app!.staticTexts[UIConstants.LivenessCheck.moveInstruction].exists)
50-
Thread.sleep(forTimeInterval: 3)
45+
Thread.sleep(forTimeInterval: 4)
5146
XCTAssert(app!.staticTexts[UIConstants.LivenessCheck.holdInstruction].exists)
5247
Thread.sleep(forTimeInterval: 8)
5348
XCTAssert(app!.buttons[UIConstants.LivenessResult.primaryButton].exists)

Tests/IntegrationTestApp/IntegrationTestAppUITests/UIConstants.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ struct UIConstants {
1010
static let primaryButton = "Create Liveness Session"
1111

1212
struct BeginCheck {
13-
static let primaryButton = "Begin Check"
14-
static let description = "You will go through a face verification process to prove that you are a real person. Your screen's brightness will temporarily be set to 100% for highest accuracy."
15-
static let warning = "Photosensitivity Warning, This check displays colored lights. Use caution if you are photosensitive."
16-
static let instruction = "Follow the instructions to complete the check:"
13+
static let primaryButton = "Start video check"
14+
static let warningTitle = "Photosensitivity Warning"
15+
static let warningDescription = "This check flashes different colors. Use caution if you are photosensitive."
16+
static let instruction = "Center your face"
1717
}
1818

1919
struct LivenessCheck {
20-
static let countdownInstruction = "Hold face position during countdown."
2120
static let moveInstruction = "Move closer"
2221
static let holdInstruction = "Hold still"
2322
static let closeButton = "Close"

0 commit comments

Comments
 (0)