Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tests): Login #1942

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions NextcloudTalkTests/UI/Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@
loginButton.tap()

let webViewsQuery = app.webViews.webViews.webViews
let main = webViewsQuery.otherElements["main"]

// Wait for the webview to be available
XCTAssert(main.waitForExistence(timeout: TestConstants.timeoutLong))

// Wait for the login button to be available and to get enabled/hittable
let loginButtonWeb = webViewsQuery.buttons["Log in"]
Expand All @@ -78,10 +74,8 @@

loginButtonWeb.tap()

XCTAssert(main.waitForExistence(timeout: TestConstants.timeoutLong))

let usernameTextField = main.descendants(matching: .textField).firstMatch
let passwordTextField = main.descendants(matching: .secureTextField).firstMatch
let usernameTextField = webViewsQuery.descendants(matching: .textField).firstMatch
let passwordTextField = webViewsQuery.descendants(matching: .secureTextField).firstMatch

XCTAssert(usernameTextField.waitForExistence(timeout: TestConstants.timeoutLong))
XCTAssert(passwordTextField.waitForExistence(timeout: TestConstants.timeoutLong))
Expand All @@ -93,14 +87,14 @@
passwordTextField.typeText(TestConstants.password + "\n")

let accountAccess = webViewsQuery.staticTexts["Account access"]
XCTAssert(accountAccess.waitForExistence(timeout: TestConstants.timeoutLong))

Check failure on line 90 in NextcloudTalkTests/UI/Helpers.swift

View workflow job for this annotation

GitHub Actions / Test (stable27, stable27, 8.2)

test_Login, XCTAssertTrue failed

Check failure on line 90 in NextcloudTalkTests/UI/Helpers.swift

View workflow job for this annotation

GitHub Actions / Test (main, master, 8.3)

test_Login, XCTAssertTrue failed

Check failure on line 90 in NextcloudTalkTests/UI/Helpers.swift

View workflow job for this annotation

GitHub Actions / Test (main, master, 8.3)

test_Login, XCTAssertTrue failed

let grantAccessButton = webViewsQuery.buttons["Grant access"]
XCTAssert(grantAccessButton.waitForExistence(timeout: TestConstants.timeoutLong))
waitForEnabled(object: grantAccessButton)
waitForHittable(object: grantAccessButton)

// TODO: Find a better way to reliable detect if the grant access button is tappable

Check warning on line 97 in NextcloudTalkTests/UI/Helpers.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Todo Violation: TODOs should be resolved (Find a better way to reliable ...) (todo)
sleep(5)

grantAccessButton.tap()
Expand Down
Loading