Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

iOS UI tests: wait for the sheet to settle, and give a relaunch longer

Duarte Santosf01ed1bd4965
diff --git a/frontend/ios/App/AppUITests/OpenGymUITests.swift b/frontend/ios/App/AppUITests/OpenGymUITests.swift
index 51df97daa..ff5959211 100644
--- a/frontend/ios/App/AppUITests/OpenGymUITests.swift
+++ b/frontend/ios/App/AppUITests/OpenGymUITests.swift
@@ -36,7 +36,7 @@ final class OpenGymUITests: XCTestCase {
* page is still starting and go nowhere.
*/
private func chooseLocal() {
- if app.buttons["Log"].waitForExistence(timeout: 20) { return } // chosen in an earlier test
+ if app.buttons["Log"].waitForExistence(timeout: 45) { return } // chosen in an earlier test
let local = app.buttons["Use on this device"]
XCTAssertTrue(local.waitForExistence(timeout: 60), "the onboarding choice did not show up")
for _ in 0..<5 {
@@ -85,7 +85,10 @@ final class OpenGymUITests: XCTestCase {
chooseLocal()
tap(app.buttons["Log"], "Log (body weight)")
let field = app.textFields.firstMatch
- tap(field, "the weight field")
+ XCTAssertTrue(field.waitForExistence(timeout: 15), "no weight field")
+ // The sheet slides in; wait until the field is where a finger can reach it.
+ for _ in 0..<20 where !field.isHittable { usleep(500_000) }
+ field.tap()
XCTAssertTrue(app.keyboards.firstMatch.waitForExistence(timeout: 10), "no keyboard")
shot("5-keyboard")
let save = app.buttons["Save"]