mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Make sure the integration tests stop when running out of WAS retries 🙈 (#4730)
This commit is contained in:
@@ -8,10 +8,14 @@
|
|||||||
|
|
||||||
import XCTest
|
import XCTest
|
||||||
|
|
||||||
|
enum IntegrationTestsError: Error {
|
||||||
|
case webAuthenticationSessionFailure
|
||||||
|
}
|
||||||
|
|
||||||
extension XCUIApplication {
|
extension XCUIApplication {
|
||||||
private var doesNotExistPredicate: NSPredicate { NSPredicate(format: "exists == 0") }
|
private var doesNotExistPredicate: NSPredicate { NSPredicate(format: "exists == 0") }
|
||||||
|
|
||||||
func login(currentTestCase: XCTestCase) {
|
func login(currentTestCase: XCTestCase) throws {
|
||||||
let getStartedButton = buttons[A11yIdentifiers.authenticationStartScreen.signIn]
|
let getStartedButton = buttons[A11yIdentifiers.authenticationStartScreen.signIn]
|
||||||
|
|
||||||
XCTAssertTrue(getStartedButton.waitForExistence(timeout: 10.0))
|
XCTAssertTrue(getStartedButton.waitForExistence(timeout: 10.0))
|
||||||
@@ -55,6 +59,7 @@ extension XCUIApplication {
|
|||||||
remainingAttempts -= 1
|
remainingAttempts -= 1
|
||||||
if remainingAttempts <= 0 {
|
if remainingAttempts <= 0 {
|
||||||
XCTFail("Failed to present the web authentication session.")
|
XCTFail("Failed to present the web authentication session.")
|
||||||
|
throw IntegrationTestsError.webAuthenticationSessionFailure
|
||||||
}
|
}
|
||||||
|
|
||||||
if alerts.count > 0 {
|
if alerts.count > 0 {
|
||||||
|
|||||||
@@ -8,15 +8,16 @@
|
|||||||
|
|
||||||
import XCTest
|
import XCTest
|
||||||
|
|
||||||
|
@MainActor
|
||||||
class UserFlowTests: XCTestCase {
|
class UserFlowTests: XCTestCase {
|
||||||
private static let integrationTestsRoomName = "Element X iOS Integration Tests"
|
private static let integrationTestsRoomName = "Element X iOS Integration Tests"
|
||||||
private static let integrationTestsMessage = "Go down in flames!"
|
private static let integrationTestsMessage = "Go down in flames!"
|
||||||
|
|
||||||
private var app: XCUIApplication!
|
private var app: XCUIApplication!
|
||||||
|
|
||||||
override func setUp() {
|
override func setUp() async throws {
|
||||||
app = Application.launch()
|
app = Application.launch()
|
||||||
app.login(currentTestCase: self)
|
try app.login(currentTestCase: self)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testUserFlow() {
|
func testUserFlow() {
|
||||||
|
|||||||
Reference in New Issue
Block a user