From 33fe625db5fdaf1de4c0015c6efb8b4ea3511591 Mon Sep 17 00:00:00 2001 From: Tuan Pham Date: Thu, 7 Dec 2023 12:35:43 -0600 Subject: [PATCH] chore: update integration test to match latest UX updates --- .../LivenessIntegrationUITests.swift | 13 ++++--------- .../IntegrationTestAppUITests/UIConstants.swift | 9 ++++----- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Tests/IntegrationTestApp/IntegrationTestAppUITests/LivenessIntegrationUITests.swift b/Tests/IntegrationTestApp/IntegrationTestAppUITests/LivenessIntegrationUITests.swift index 237dafec..95db95bc 100644 --- a/Tests/IntegrationTestApp/IntegrationTestAppUITests/LivenessIntegrationUITests.swift +++ b/Tests/IntegrationTestApp/IntegrationTestAppUITests/LivenessIntegrationUITests.swift @@ -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 { @@ -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) diff --git a/Tests/IntegrationTestApp/IntegrationTestAppUITests/UIConstants.swift b/Tests/IntegrationTestApp/IntegrationTestAppUITests/UIConstants.swift index 12b8e392..04a5db64 100644 --- a/Tests/IntegrationTestApp/IntegrationTestAppUITests/UIConstants.swift +++ b/Tests/IntegrationTestApp/IntegrationTestAppUITests/UIConstants.swift @@ -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"