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 UI tests failing in the CI #3254

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion DuckDuckGo/Menus/MainMenuActions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,6 @@ extension MainViewController {
@objc func resetBookmarks(_ sender: Any?) {
LocalBookmarkManager.shared.resetBookmarks()
UserDefaults.standard.set(false, forKey: UserDefaultsWrapper<Bool>.Key.homePageContinueSetUpImport.rawValue)
UserDefaults.standard.set(false, forKey: UserDefaultsWrapper<Bool>.Key.bookmarksBarPromptShown.rawValue)
LocalBookmarkManager.shared.sortMode = .manual
}

Expand Down
10 changes: 9 additions & 1 deletion UITests/Common/XCUIApplicationExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,19 @@ extension XCUIApplication {
static let resetBookmarksMenuItem = "MainMenu.resetBookmarks"
}

/// Dismiss popover with the passed button identifier
/// Dismiss popover with the passed button identifier if exists. If it does not exist it continues the execution without failing.
/// - Parameter buttonIdentifier: The button identifier we want to tap from the popover
func dismissPopover(buttonIdentifier: String) {
let popover = popovers.firstMatch
guard popover.exists else {
return
}

let button = popover.buttons[buttonIdentifier]
guard button.exists else {
return
}

button.tap()
}

Expand Down
Loading