mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Session verification UI tests update (#5120)
session verification tests UI tests update
This commit is contained in:
@@ -19,6 +19,7 @@ extension SessionVerificationControllerProxyMock {
|
||||
|
||||
static func configureMock(actions: PassthroughSubject<SessionVerificationControllerProxyAction, Never> = .init(),
|
||||
isVerified: Bool = false,
|
||||
otherDeviceStartsSasVerification: Bool = false,
|
||||
requestDelay: Duration = .seconds(1)) -> SessionVerificationControllerProxyMock {
|
||||
let mock = SessionVerificationControllerProxyMock()
|
||||
mock.underlyingActions = actions
|
||||
@@ -29,6 +30,13 @@ extension SessionVerificationControllerProxyMock {
|
||||
Task.detached {
|
||||
try await Task.sleep(for: requestDelay)
|
||||
mock.actions.send(.acceptedVerificationRequest)
|
||||
|
||||
if otherDeviceStartsSasVerification {
|
||||
try await Task.sleep(for: requestDelay)
|
||||
mock.actions.send(.startedSasVerification)
|
||||
try await Task.sleep(for: requestDelay)
|
||||
mock.actions.send(.receivedVerificationData(emojis))
|
||||
}
|
||||
}
|
||||
|
||||
return .success(())
|
||||
@@ -65,7 +73,7 @@ extension SessionVerificationControllerProxyMock {
|
||||
|
||||
return .success(())
|
||||
}
|
||||
|
||||
|
||||
mock.cancelVerificationClosure = { [unowned mock] in
|
||||
Task.detached {
|
||||
try await Task.sleep(for: requestDelay)
|
||||
|
||||
@@ -235,7 +235,6 @@ enum A11yIdentifiers {
|
||||
let acceptVerificationRequest = "session_verification-accept_verification_request"
|
||||
let ignoreVerificationRequest = "session_verification-ignore_verification_request"
|
||||
let requestVerification = "session_verification-request_verification"
|
||||
let startSasVerification = "session_verification-start_sas_verification"
|
||||
let acceptChallenge = "session_verification-accept_challenge"
|
||||
let declineChallenge = "session_verification-decline_challenge"
|
||||
let emojiWrapper = "session_verification-emojis"
|
||||
|
||||
@@ -575,7 +575,8 @@ class MockScreen: Identifiable {
|
||||
navigationStackCoordinator.setRootCoordinator(coordinator)
|
||||
return navigationStackCoordinator
|
||||
case .sessionVerification:
|
||||
var sessionVerificationControllerProxy = SessionVerificationControllerProxyMock.configureMock(requestDelay: .seconds(5))
|
||||
var sessionVerificationControllerProxy = SessionVerificationControllerProxyMock.configureMock(otherDeviceStartsSasVerification: true,
|
||||
requestDelay: .seconds(5))
|
||||
let parameters = SessionVerificationScreenCoordinatorParameters(sessionVerificationControllerProxy: sessionVerificationControllerProxy,
|
||||
flow: .deviceInitiator,
|
||||
appSettings: ServiceLocator.shared.settings,
|
||||
|
||||
@@ -13,13 +13,10 @@ class SessionVerificationUITests: XCTestCase {
|
||||
enum Step {
|
||||
static let initialState = 0
|
||||
static let waitingForOtherDevice = 1
|
||||
static let useEmojiComparisonPrompt = 2
|
||||
static let waitingForEmojis = 3
|
||||
static let compareEmojis = 4
|
||||
static let acceptingEmojis = 5
|
||||
static let verificationComplete = 6
|
||||
|
||||
static let verificationCancelled = 7
|
||||
static let compareEmojis = 2
|
||||
static let acceptingEmojis = 3
|
||||
static let verificationComplete = 4
|
||||
static let verificationCancelled = 5
|
||||
}
|
||||
|
||||
func testChallengeMatches() async throws {
|
||||
@@ -29,13 +26,7 @@ class SessionVerificationUITests: XCTestCase {
|
||||
app.buttons[A11yIdentifiers.sessionVerificationScreen.requestVerification].tap()
|
||||
try await app.assertScreenshot(step: Step.waitingForOtherDevice)
|
||||
|
||||
XCTAssert(app.buttons[A11yIdentifiers.sessionVerificationScreen.startSasVerification].waitForExistence(timeout: 10.0))
|
||||
try await app.assertScreenshot(step: Step.useEmojiComparisonPrompt)
|
||||
|
||||
app.buttons[A11yIdentifiers.sessionVerificationScreen.startSasVerification].tap()
|
||||
try await app.assertScreenshot(step: Step.waitingForEmojis)
|
||||
|
||||
XCTAssert(app.buttons[A11yIdentifiers.sessionVerificationScreen.acceptChallenge].waitForExistence(timeout: 10.0))
|
||||
XCTAssert(app.buttons[A11yIdentifiers.sessionVerificationScreen.acceptChallenge].waitForExistence(timeout: 20.0))
|
||||
try await app.assertScreenshot(step: Step.compareEmojis)
|
||||
|
||||
app.buttons[A11yIdentifiers.sessionVerificationScreen.acceptChallenge].tap()
|
||||
@@ -52,13 +43,7 @@ class SessionVerificationUITests: XCTestCase {
|
||||
app.buttons[A11yIdentifiers.sessionVerificationScreen.requestVerification].tap()
|
||||
try await app.assertScreenshot(step: Step.waitingForOtherDevice)
|
||||
|
||||
XCTAssert(app.buttons[A11yIdentifiers.sessionVerificationScreen.startSasVerification].waitForExistence(timeout: 10.0))
|
||||
try await app.assertScreenshot(step: Step.useEmojiComparisonPrompt)
|
||||
|
||||
app.buttons[A11yIdentifiers.sessionVerificationScreen.startSasVerification].tap()
|
||||
try await app.assertScreenshot(step: Step.waitingForEmojis)
|
||||
|
||||
XCTAssert(app.buttons[A11yIdentifiers.sessionVerificationScreen.acceptChallenge].waitForExistence(timeout: 10.0))
|
||||
XCTAssert(app.buttons[A11yIdentifiers.sessionVerificationScreen.acceptChallenge].waitForExistence(timeout: 20.0))
|
||||
try await app.assertScreenshot(step: Step.compareEmojis)
|
||||
|
||||
app.buttons[A11yIdentifiers.sessionVerificationScreen.declineChallenge].tap()
|
||||
@@ -72,13 +57,7 @@ class SessionVerificationUITests: XCTestCase {
|
||||
app.buttons[A11yIdentifiers.sessionVerificationScreen.requestVerification].tap()
|
||||
try await app.assertScreenshot(step: Step.waitingForOtherDevice)
|
||||
|
||||
XCTAssert(app.buttons[A11yIdentifiers.sessionVerificationScreen.startSasVerification].waitForExistence(timeout: 10.0))
|
||||
try await app.assertScreenshot(step: Step.useEmojiComparisonPrompt)
|
||||
|
||||
app.buttons[A11yIdentifiers.sessionVerificationScreen.startSasVerification].tap()
|
||||
try await app.assertScreenshot(step: Step.waitingForEmojis)
|
||||
|
||||
XCTAssert(app.buttons[A11yIdentifiers.sessionVerificationScreen.acceptChallenge].waitForExistence(timeout: 10.0))
|
||||
XCTAssert(app.buttons[A11yIdentifiers.sessionVerificationScreen.acceptChallenge].waitForExistence(timeout: 20.0))
|
||||
try await app.assertScreenshot(step: Step.compareEmojis)
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8c1ec3b2ba26126b6bdefaa447258f5c4c97ce03dfdf2a711cbc3924b83fb8e1
|
||||
size 89975
|
||||
oid sha256:730117223cb432bae4c8b8b252b810305f7145bd4cab452eeea745154b32b531
|
||||
size 89966
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2e1c5c3583910c6442c9f75c96874c292e8722ad70423deddbaf3fd46e960f46
|
||||
size 76889
|
||||
oid sha256:b6cd3dee6a121b6ca50ba5e66f3cbccaf67a9cf75c9714568f12867df34ae1a6
|
||||
size 90187
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:30016ae0925613a70be12cdbb8161e33b85e7db660697edadb98b8396a058474
|
||||
size 81794
|
||||
oid sha256:e59127c333d45495136fa8c5b19f528038b1e8df314e0a304d2f88757520af2c
|
||||
size 146472
|
||||
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2e1c5c3583910c6442c9f75c96874c292e8722ad70423deddbaf3fd46e960f46
|
||||
size 76889
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e59127c333d45495136fa8c5b19f528038b1e8df314e0a304d2f88757520af2c
|
||||
size 146472
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:22a4b0c6b6d7e98988f0d6a6e885214ea0c9b3a9fefab0269658f3fd86da13f5
|
||||
size 95258
|
||||
oid sha256:957b47edcd7e8ab1b8fa96e037b2471930aa08aba703ed9df0f71120af195d29
|
||||
size 95266
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:38d40be22599a822651a853b281f426fda6bf4b0e962d5a66f870d54878f1d6c
|
||||
size 83122
|
||||
oid sha256:23304de779aafa6bc7043203b79783954da3259bc848551ec2f19164437b1e13
|
||||
size 95791
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4c9997ea7f0160705412d93c34ccaae59b6187995ce51d4afd63c0808b63fd87
|
||||
size 83511
|
||||
oid sha256:716ebaeb55fc27105423888812a85cefeb52bc04434bac6a4863b1e5744921e0
|
||||
size 200935
|
||||
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:38d40be22599a822651a853b281f426fda6bf4b0e962d5a66f870d54878f1d6c
|
||||
size 83122
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:716ebaeb55fc27105423888812a85cefeb52bc04434bac6a4863b1e5744921e0
|
||||
size 200935
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8c1ec3b2ba26126b6bdefaa447258f5c4c97ce03dfdf2a711cbc3924b83fb8e1
|
||||
size 89975
|
||||
oid sha256:730117223cb432bae4c8b8b252b810305f7145bd4cab452eeea745154b32b531
|
||||
size 89966
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2e1c5c3583910c6442c9f75c96874c292e8722ad70423deddbaf3fd46e960f46
|
||||
size 76889
|
||||
oid sha256:9f2e7cbd6ee0008628c88d6ec9f41267dd2d5cd72d7e5284b602f87a9ac35e99
|
||||
size 90182
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:30016ae0925613a70be12cdbb8161e33b85e7db660697edadb98b8396a058474
|
||||
size 81794
|
||||
oid sha256:e59127c333d45495136fa8c5b19f528038b1e8df314e0a304d2f88757520af2c
|
||||
size 146472
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2e1c5c3583910c6442c9f75c96874c292e8722ad70423deddbaf3fd46e960f46
|
||||
size 76889
|
||||
oid sha256:1413f4acb309195609ec18bbc0af71a7d18444bd057aa4ad7fd9558d73c29e1b
|
||||
size 136929
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e59127c333d45495136fa8c5b19f528038b1e8df314e0a304d2f88757520af2c
|
||||
size 146472
|
||||
oid sha256:17cd257f479a5214b6f55c024b2be168aaca1d1409e347865875e4423b1fcb9f
|
||||
size 74251
|
||||
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1413f4acb309195609ec18bbc0af71a7d18444bd057aa4ad7fd9558d73c29e1b
|
||||
size 136929
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:17cd257f479a5214b6f55c024b2be168aaca1d1409e347865875e4423b1fcb9f
|
||||
size 74251
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:22a4b0c6b6d7e98988f0d6a6e885214ea0c9b3a9fefab0269658f3fd86da13f5
|
||||
size 95258
|
||||
oid sha256:957b47edcd7e8ab1b8fa96e037b2471930aa08aba703ed9df0f71120af195d29
|
||||
size 95266
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:38d40be22599a822651a853b281f426fda6bf4b0e962d5a66f870d54878f1d6c
|
||||
size 83122
|
||||
oid sha256:9181d42db80f8867582bc317fe40755b7432ac92b1e147dbe722aae2663f80c8
|
||||
size 95856
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4c9997ea7f0160705412d93c34ccaae59b6187995ce51d4afd63c0808b63fd87
|
||||
size 83511
|
||||
oid sha256:716ebaeb55fc27105423888812a85cefeb52bc04434bac6a4863b1e5744921e0
|
||||
size 200935
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:38d40be22599a822651a853b281f426fda6bf4b0e962d5a66f870d54878f1d6c
|
||||
size 83122
|
||||
oid sha256:c79526bfe66066447efc6e03c574e764249e2e5140e9c082c01b4730d1827e8b
|
||||
size 186156
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:716ebaeb55fc27105423888812a85cefeb52bc04434bac6a4863b1e5744921e0
|
||||
size 200935
|
||||
oid sha256:20a9666afa07696156d04173878bb0e3ede8eb4311c346ea94455cd8c6b49a35
|
||||
size 74571
|
||||
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c79526bfe66066447efc6e03c574e764249e2e5140e9c082c01b4730d1827e8b
|
||||
size 186156
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:20a9666afa07696156d04173878bb0e3ede8eb4311c346ea94455cd8c6b49a35
|
||||
size 74571
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8c1ec3b2ba26126b6bdefaa447258f5c4c97ce03dfdf2a711cbc3924b83fb8e1
|
||||
size 89975
|
||||
oid sha256:730117223cb432bae4c8b8b252b810305f7145bd4cab452eeea745154b32b531
|
||||
size 89966
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2e1c5c3583910c6442c9f75c96874c292e8722ad70423deddbaf3fd46e960f46
|
||||
size 76889
|
||||
oid sha256:630120434bb5f01e95a7fb0199f2125a8729db88923a810ca498fe1457817ad5
|
||||
size 90166
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:30016ae0925613a70be12cdbb8161e33b85e7db660697edadb98b8396a058474
|
||||
size 81794
|
||||
oid sha256:e59127c333d45495136fa8c5b19f528038b1e8df314e0a304d2f88757520af2c
|
||||
size 146472
|
||||
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2e1c5c3583910c6442c9f75c96874c292e8722ad70423deddbaf3fd46e960f46
|
||||
size 76889
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e59127c333d45495136fa8c5b19f528038b1e8df314e0a304d2f88757520af2c
|
||||
size 146472
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:22a4b0c6b6d7e98988f0d6a6e885214ea0c9b3a9fefab0269658f3fd86da13f5
|
||||
size 95258
|
||||
oid sha256:957b47edcd7e8ab1b8fa96e037b2471930aa08aba703ed9df0f71120af195d29
|
||||
size 95266
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:38d40be22599a822651a853b281f426fda6bf4b0e962d5a66f870d54878f1d6c
|
||||
size 83122
|
||||
oid sha256:9181d42db80f8867582bc317fe40755b7432ac92b1e147dbe722aae2663f80c8
|
||||
size 95856
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4c9997ea7f0160705412d93c34ccaae59b6187995ce51d4afd63c0808b63fd87
|
||||
size 83511
|
||||
oid sha256:716ebaeb55fc27105423888812a85cefeb52bc04434bac6a4863b1e5744921e0
|
||||
size 200935
|
||||
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:38d40be22599a822651a853b281f426fda6bf4b0e962d5a66f870d54878f1d6c
|
||||
size 83122
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:716ebaeb55fc27105423888812a85cefeb52bc04434bac6a4863b1e5744921e0
|
||||
size 200935
|
||||
Reference in New Issue
Block a user