2022-04-13 17:19:11 +03:00
|
|
|
//
|
|
|
|
// Application.swift
|
|
|
|
// UITests
|
|
|
|
//
|
|
|
|
// Created by Stefan Ceriu on 13/04/2022.
|
2022-05-31 13:05:30 +03:00
|
|
|
// Copyright © 2022 Element. All rights reserved.
|
2022-04-13 17:19:11 +03:00
|
|
|
//
|
|
|
|
|
|
|
|
import XCTest
|
|
|
|
|
|
|
|
struct Application {
|
2022-04-29 10:11:42 +03:00
|
|
|
static func launch() -> XCUIApplication {
|
2022-04-13 17:19:11 +03:00
|
|
|
let app = XCUIApplication()
|
|
|
|
app.launchEnvironment = ["IS_RUNNING_UI_TESTS": "1"]
|
|
|
|
app.launch()
|
2022-04-29 10:11:42 +03:00
|
|
|
return app
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extension XCUIApplication {
|
2022-06-21 20:28:42 +03:00
|
|
|
func goToScreenWithIdentifier(_ identifier: UITestScreenIdentifier) {
|
2022-07-06 14:49:05 +01:00
|
|
|
let button = buttons[identifier.rawValue]
|
2022-04-29 10:11:42 +03:00
|
|
|
let lastLabel = staticTexts["lastItem"]
|
|
|
|
|
2022-07-06 14:49:05 +01:00
|
|
|
while !button.isHittable, !lastLabel.isHittable {
|
|
|
|
tables.firstMatch.swipeUp()
|
2022-04-29 10:11:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
button.tap()
|
2022-04-13 17:19:11 +03:00
|
|
|
}
|
|
|
|
}
|