Skip to content

Commit

Permalink
chore: update integration test to match latest UX updates
Browse files Browse the repository at this point in the history
  • Loading branch information
phantumcode committed Dec 7, 2023
1 parent e6db58c commit 33fe625
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ class CreateLivenessSessionUITests: XCTestCase {
Thread.sleep(forTimeInterval: 2)
XCTAssert(app!.buttons[UIConstants.BeginCheck.primaryButton].exists)
XCTAssertFalse(app!.buttons[UIConstants.primaryButton].exists)
let scrollViewsQuery = app!.scrollViews
let elementsQuery = scrollViewsQuery.otherElements
XCTAssertEqual(elementsQuery.staticTexts.element(boundBy: 1).label, UIConstants.BeginCheck.description)
XCTAssert(elementsQuery.buttons[UIConstants.BeginCheck.warning].exists)
XCTAssert(elementsQuery.staticTexts[UIConstants.BeginCheck.instruction].exists)
XCTAssert(app!.staticTexts[UIConstants.BeginCheck.warningTitle].exists)
XCTAssert(app!.staticTexts[UIConstants.BeginCheck.warningDescription].exists)
XCTAssert(app!.staticTexts[UIConstants.BeginCheck.instruction].exists)
}

func testStartLivenessIntegration() throws {
Expand All @@ -40,14 +38,11 @@ class CreateLivenessSessionUITests: XCTestCase {
app?.buttons[UIConstants.primaryButton].tap()
Thread.sleep(forTimeInterval: 2)
XCTAssert(app!.buttons[UIConstants.BeginCheck.primaryButton].exists)
XCTAssertFalse(app!.buttons[UIConstants.primaryButton].exists)
app!.buttons[UIConstants.BeginCheck.primaryButton].tap()
Thread.sleep(forTimeInterval: 2)
XCTAssert(app!.staticTexts[UIConstants.LivenessCheck.countdownInstruction].exists)
XCTAssert(app!.buttons[UIConstants.LivenessCheck.closeButton].exists)
Thread.sleep(forTimeInterval: 3)
XCTAssert(app!.staticTexts[UIConstants.LivenessCheck.moveInstruction].exists)
Thread.sleep(forTimeInterval: 3)
Thread.sleep(forTimeInterval: 4)
XCTAssert(app!.staticTexts[UIConstants.LivenessCheck.holdInstruction].exists)
Thread.sleep(forTimeInterval: 8)
XCTAssert(app!.buttons[UIConstants.LivenessResult.primaryButton].exists)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ struct UIConstants {
static let primaryButton = "Create Liveness Session"

struct BeginCheck {
static let primaryButton = "Begin Check"
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."
static let warning = "Photosensitivity Warning, This check displays colored lights. Use caution if you are photosensitive."
static let instruction = "Follow the instructions to complete the check:"
static let primaryButton = "Start video check"
static let warningTitle = "Photosensitivity Warning"
static let warningDescription = "This check flashes different colors. Use caution if you are photosensitive."
static let instruction = "Center your face"
}

struct LivenessCheck {
static let countdownInstruction = "Hold face position during countdown."
static let moveInstruction = "Move closer"
static let holdInstruction = "Hold still"
static let closeButton = "Close"
Expand Down

0 comments on commit 33fe625

Please sign in to comment.