This commit is contained in:
Isaac 2026-02-15 22:50:18 +04:00
parent 038a6e928c
commit dec912f2db
9 changed files with 254 additions and 19 deletions

View file

@ -16,10 +16,9 @@ class UITests: XCTestCase {
func testLaunch() throws {
app.launch()
XCTAssert(app.wait(for: .runningForeground, timeout: 10.0))
let _ = app.buttons["___non_existing"].waitForExistence(timeout: 10000.0)
}
func testLoginToCodeEntry() throws {
func testLoginToSetName() throws {
app.launch()
// Welcome screen tap Start Messaging
@ -29,17 +28,16 @@ class UITests: XCTestCase {
// Phone entry screen enter test phone number
let countryCodeField = app.textFields["Auth.PhoneEntry.CountryCodeField"]
XCTAssert(countryCodeField.waitForExistence(timeout: 5.0))
XCTAssert(countryCodeField.waitForExistence(timeout: 10.0))
countryCodeField.tap()
countryCodeField.press(forDuration: 0.5)
if app.menuItems["Select All"].waitForExistence(timeout: 2.0) {
app.menuItems["Select All"].tap()
for _ in 0..<10 {
countryCodeField.typeText(XCUIKeyboardKey.delete.rawValue)
}
countryCodeField.typeText("999")
let phoneNumberField = app.textFields["Auth.PhoneEntry.PhoneNumberField"]
phoneNumberField.tap()
phoneNumberField.typeText("6621234")
phoneNumberField.typeText("6625678")
let continueButton = app.buttons["Auth.PhoneEntry.ContinueButton"]
XCTAssert(continueButton.waitForExistence(timeout: 3.0))
@ -51,8 +49,26 @@ class UITests: XCTestCase {
XCTAssert(confirmButton.waitForExistence(timeout: 5.0))
confirmButton.tap()
// Code entry screen verify we arrived
// Code entry screen enter verification code
let codeEntryTitle = app.staticTexts["Auth.CodeEntry.Title"]
XCTAssert(codeEntryTitle.waitForExistence(timeout: 10.0))
XCTAssert(codeEntryTitle.waitForExistence(timeout: 15.0))
let codeField = app.textFields["Auth.CodeEntry.CodeField"]
XCTAssert(codeField.waitForExistence(timeout: 3.0))
codeField.typeText("22222")
// Set name screen enter name and submit
let firstNameField = app.textFields["Auth.SetName.FirstNameField"]
XCTAssert(firstNameField.waitForExistence(timeout: 15.0))
firstNameField.tap()
firstNameField.typeText("Test")
let lastNameField = app.textFields["Auth.SetName.LastNameField"]
lastNameField.tap()
lastNameField.typeText("User")
let signUpButton = app.buttons["Auth.SetName.ContinueButton"]
XCTAssert(signUpButton.waitForExistence(timeout: 3.0))
signUpButton.tap()
}
}