Skip to content

Commit

Permalink
Fix bookmark sort UI tests failure (#3219)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1204006570077678/1208220055565873/f
Tech Design URL:
CC:

**Description**:
A bad merge introduced this, we should use the `newApp` instead of the
terminated `app` for the test that checks state restoration.

**Steps to test this PR**:
1. Run the `testThatSortIsPersistedThroughBrowserRestarts` UI test
2. Check is passing

**Definition of Done**:

* [x] Does this PR satisfy our [Definition of
Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)?

—
###### Internal references:
[Pull Request Review
Checklist](https://app.asana.com/0/1202500774821704/1203764234894239/f)
[Software Engineering
Expectations](https://app.asana.com/0/59792373528535/199064865822552)
[Technical Design
Template](https://app.asana.com/0/59792373528535/184709971311943)
[Pull Request
Documentation](https://app.asana.com/0/1202500774821704/1204012835277482/f)
  • Loading branch information
jotaemepereira authored Sep 5, 2024
1 parent 80b6a5b commit 7ff796a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion UITests/BookmarkSortTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,14 @@ class BookmarkSortTests: XCTestCase {

app.terminate()
let newApp = XCUIApplication()
newApp.launchEnvironment["UITEST_MODE"] = "1"
newApp.launch()
newApp.enforceSingleWindow()

app.openBookmarksPanel()
// Wait for new application to start
XCTAssertTrue(newApp.waitForExistence(timeout: UITests.Timeouts.elementExistence))

newApp.openBookmarksPanel()

let sortBookmarksPanelButton = newApp.buttons[AccessibilityIdentifiers.sortBookmarksButtonPanel]
sortBookmarksPanelButton.tap()
Expand Down
2 changes: 1 addition & 1 deletion UITests/Common/XCUIApplicationExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension XCUIApplication {
func openBookmarksPanel() {
let bookmarksPanelShortcutButton = buttons[AccessibilityIdentifiers.bookmarksPanelShortcutButton]
if !bookmarksPanelShortcutButton.exists {
typeKey("K", modifierFlags: [.command, .shift])
typeKey("k", modifierFlags: [.command, .shift])
}

bookmarksPanelShortcutButton.tap()
Expand Down

0 comments on commit 7ff796a

Please sign in to comment.