This commit is contained in:
Isaac 2026-02-14 23:20:28 +04:00
parent 9988158f83
commit 038a6e928c
4 changed files with 54 additions and 7 deletions

View file

@ -1,17 +1,58 @@
import XCTest
class UITests: XCTestCase {
private var app: XCUIApplication!
override func setUpWithError() throws {
continueAfterFailure = false
app = XCUIApplication()
app.launchArguments.append("--ui-test")
}
override func tearDownWithError() throws {
app = nil
}
func testLaunch() throws {
let app = XCUIApplication()
app.launchArguments.append("--ui-test")
app.launch()
XCTAssert(app.wait(for: .runningForeground, timeout: 10.0))
let _ = app.buttons["___non_existing"].waitForExistence(timeout: 10000.0)
}
func testLoginToCodeEntry() throws {
app.launch()
// Welcome screen tap Start Messaging
let startButton = app.buttons["Auth.Welcome.StartButton"]
XCTAssert(startButton.waitForExistence(timeout: 5.0))
startButton.tap()
// Phone entry screen enter test phone number
let countryCodeField = app.textFields["Auth.PhoneEntry.CountryCodeField"]
XCTAssert(countryCodeField.waitForExistence(timeout: 5.0))
countryCodeField.tap()
countryCodeField.press(forDuration: 0.5)
if app.menuItems["Select All"].waitForExistence(timeout: 2.0) {
app.menuItems["Select All"].tap()
}
countryCodeField.typeText("999")
let phoneNumberField = app.textFields["Auth.PhoneEntry.PhoneNumberField"]
phoneNumberField.tap()
phoneNumberField.typeText("6621234")
let continueButton = app.buttons["Auth.PhoneEntry.ContinueButton"]
XCTAssert(continueButton.waitForExistence(timeout: 3.0))
XCTAssert(continueButton.isEnabled)
continueButton.tap()
// Confirmation dialog tap Continue
let confirmButton = app.buttons["Auth.PhoneConfirm.ContinueButton"]
XCTAssert(confirmButton.waitForExistence(timeout: 5.0))
confirmButton.tap()
// Code entry screen verify we arrived
let codeEntryTitle = app.staticTexts["Auth.CodeEntry.Title"]
XCTAssert(codeEntryTitle.waitForExistence(timeout: 10.0))
}
}

View file

@ -131,7 +131,8 @@ final class AuthorizationSequenceCodeEntryControllerNode: ASDisplayNode, UITextF
self.titleActivateAreaNode = AccessibilityAreaNode()
self.titleActivateAreaNode.accessibilityTraits = .staticText
self.titleActivateAreaNode.accessibilityIdentifier = "Auth.CodeEntry.Title"
self.titleIconNode = ASImageNode()
self.titleIconNode.isLayerBacked = true
self.titleIconNode.displayWithoutProcessing = true

View file

@ -118,7 +118,9 @@ private final class PhoneAndCountryNode: ASDisplayNode {
self.phoneInputNode.numberField.textField.tintColor = theme.list.itemAccentColor
self.phoneInputNode.countryCodeField.accessibilityHint = strings.Login_VoiceOver_PhoneCountryCode
self.phoneInputNode.numberField.accessibilityHint = strings.Login_VoiceOver_PhoneNumber
self.phoneInputNode.countryCodeField.textField.accessibilityIdentifier = "Auth.PhoneEntry.CountryCodeField"
self.phoneInputNode.numberField.textField.accessibilityIdentifier = "Auth.PhoneEntry.PhoneNumberField"
self.phoneInputNode.countryCodeField.textField.tintColor = theme.list.itemAccentColor
self.phoneInputNode.numberField.textField.tintColor = theme.list.itemAccentColor
@ -426,7 +428,8 @@ final class AuthorizationSequencePhoneEntryControllerNode: ASDisplayNode {
self.proceedNode = SolidRoundedButtonNode(title: self.strings.Login_Continue, theme: SolidRoundedButtonTheme(theme: self.theme), glass: false, height: 50.0, cornerRadius: 50 * 0.5)
self.proceedNode.progressType = .embedded
self.proceedNode.isEnabled = false
self.proceedNode.accessibilityIdentifier = "Auth.PhoneEntry.ContinueButton"
super.init()
self.setViewBlock({
@ -859,7 +862,8 @@ final class PhoneConfirmationController: ViewController {
self.proceedNode = SolidRoundedButtonNode(title: strings.Login_Continue, theme: SolidRoundedButtonTheme(theme: theme), glass: false, height: 50.0, cornerRadius: 50.0 * 0.5)
self.proceedNode.progressType = .embedded
self.proceedNode.accessibilityIdentifier = "Auth.PhoneConfirm.ContinueButton"
let font = Font.with(size: 20.0, design: .regular, traits: [.monospacedNumbers])
let largeFont = Font.with(size: 34.0, design: .regular, weight: .bold, traits: [.monospacedNumbers])

View file

@ -74,7 +74,8 @@ public final class AuthorizationSequenceSplashController: ViewController {
self.controller = RMIntroViewController(backgroundColor: theme.list.plainBackgroundColor, primaryColor: theme.list.itemPrimaryTextColor, buttonColor: theme.intro.startButtonColor, accentColor: theme.list.itemAccentColor, regularDotColor: theme.intro.dotColor, highlightedDotColor: theme.list.itemAccentColor, suggestedLocalizationSignal: localizationSignal)
self.startButton = SolidRoundedButtonNode(title: "Start Messaging", theme: SolidRoundedButtonTheme(theme: theme), glass: false, height: 50.0, cornerRadius: 50.0 * 0.5, isShimmering: true)
self.startButton.accessibilityIdentifier = "Auth.Welcome.StartButton"
super.init(navigationBarPresentationData: nil)
self._hasGlassStyle = true