From 414bfa694f65a733857ea268fbb124d18cd30ff3 Mon Sep 17 00:00:00 2001 From: isabelrios Date: Fri, 15 Nov 2019 11:50:16 +0100 Subject: [PATCH] 1127-xcuitests-add-fake-login-ipad (#1128) --- LockwiseXCUITests/LockwiseXCUITests.swift | 27 ++++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/LockwiseXCUITests/LockwiseXCUITests.swift b/LockwiseXCUITests/LockwiseXCUITests.swift index 8d01082f4..5913fdc21 100644 --- a/LockwiseXCUITests/LockwiseXCUITests.swift +++ b/LockwiseXCUITests/LockwiseXCUITests.swift @@ -23,23 +23,27 @@ class LockwiseXCUITests: BaseTestCase { func testDeleteEntry() { loginToEntryListView() - waitforExistence(app.tables.cells.staticTexts["aaafakeTesterDelete"]) + if !iPad() { + waitforExistence(app.tables.cells.staticTexts["aaafakeTesterDelete"]) + } + // Need to add firstMatch for iPad case - app.tables.cells.staticTexts["aaafakeTesterDelete"].firstMatch.swipeLeft() + app.tables.cells.staticTexts.firstMatch.swipeLeft() app.tables.buttons["Delete"].tap() waitforExistence(app.alerts["Delete this login?"]) // First check the Cancel button app.alerts.buttons["Cancel"].tap() - waitforExistence(app.tables.cells.staticTexts["aaafakeTesterDelete"]) - app.tables.cells.staticTexts["aaafakeTesterDelete"].firstMatch.swipeLeft() - app.tables.buttons["Delete"].tap() - waitforExistence(app.alerts["Delete this login?"]) - // Then Delete the login - app.alerts.buttons["Delete"].tap() - waitforExistence(app.navigationBars["firefoxLockwise.navigationBar"]) - // Now check that the login has been removed - // On iPad, entry is removed but only from the entry list, the entry detail view is still there if !iPad() { + waitforExistence(app.tables.cells.staticTexts["aaafakeTesterDelete"]) + } + // Deleting login only on iPhone + if !iPad() { + app.tables.cells.staticTexts["aaafakeTesterDelete"].firstMatch.swipeLeft() + app.tables.buttons["Delete"].tap() + waitforExistence(app.alerts["Delete this login?"]) + // Then Delete the login + app.alerts.buttons["Delete"].tap() + waitforExistence(app.navigationBars["firefoxLockwise.navigationBar"]) waitforNoExistence(app.tables.cells.staticTexts["aaafakeTesterDelete"]) } } @@ -97,6 +101,7 @@ class LockwiseXCUITests: BaseTestCase { func testSettingsAccountUI() { loginToEntryListView() + navigator.goto(Screen.AccountSettingsMenu) waitforExistence(app.navigationBars["accountSetting.navigationBar"]) XCTAssertTrue(app.staticTexts["username.Label"].exists)