2022-04-13 17:19:11 +03:00
|
|
|
//
|
2022-08-11 08:54:24 +01:00
|
|
|
// Copyright 2022 New Vector Ltd
|
2022-04-13 17:19:11 +03:00
|
|
|
//
|
2022-08-11 08:54:24 +01:00
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
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
|
|
|
}
|
|
|
|
}
|