-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add bookmarks search UI tests #3161
Conversation
bookmarksMenuToggleBookmarksBarMenuItem | ||
NSMenuItem.separator() | ||
NSMenuItem(title: UserText.bookmarks) | ||
.withAccessibilityIdentifier("MainMenu.bookmarks") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ This the only change to this class. I added an accessibility identifier, but I had to fix the indentation.
f8834ba
to
131b5dd
Compare
@@ -797,6 +797,10 @@ 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ I had to to add this to be consistent between new tests. When we reset bookmarks, I want to reset the show bookmarks bar prompt dialog, so it’s shown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes perfect sense 👍 but why are you adjusting onboardingFinished in the line below? It feels to me like a side effect (one wouldn't normally expect onboarding flag to be adjusted when you reset bookmarks, and especially not to have that flag set to true
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was needed for the show bookmarks bar dialog to appear, but that is not the case. I removed it
74ef78a
to
fd58733
Compare
|
||
import XCTest | ||
|
||
class BookmarkUtilities { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 'I’m having second thoughts about this class. I think another approach is to have an extension of XCUIApplication
and define those methods there. Thoughts?
Then it’s easier to read in the tests:
app.openBookmarksManager(..)
app.openSiteToBookmark(…)
app.dismissPopover(…)
// etc ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I second your idea 👍 would much better prefer to have an extension on XCUIApplication than standalone utility classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. I’ve done that ✅
/// Open the initial site to be bookmarked, bookmarking it and/or escaping out of the dialog only if needed | ||
/// - Parameter url: The URL we will use to load the bookmark | ||
/// - Parameter pageTitle: The page title that would become the bookmark name | ||
/// - Parameter bookmarkingViaDialog: open bookmark dialog, adding bookmark | ||
/// - Parameter escapingDialog: `esc` key to leave dialog | ||
/// - Parameter folderName: The name of the folder where you want to save the bookmark. If the folder does not exist, it fails. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for taking time to document the code, especially for these utility APIs 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @jotaemepereira, thanks!
I've run UI Tests in CI for your branch and it's green: https://github.com/duckduckgo/macos-browser/actions/runs/10613949826
Left a few comments. I'm mostly interested about adjusting onboardingFinished flag from "Reset Bookmarks" menu option.
BookmarksUtilities can be rewritten as XCUIApplication extension now, or after you merge this 👍
805c2d1
to
7f19b10
Compare
7f19b10
to
33357fe
Compare
* main: (28 commits) Fix bookmark sort UI tests failure (#3219) Add tests for DuckPlayer pixel calculation (#3216) Implement checkbox VPN exclusions UI (#3207) fix zoom updated (#3140) Bump version to 1.105.0 (255) Add DuckPlayer enrollment pixels (#3190) Update PeopleFinders to address broker changes (#3208) Bump BSK with C-S-S to 6.14.0 (#3209) Zoom PDF controls (#3204) Fix exception on Copy in Save dialog (#3205) Remove DuckPlayer onboarding animation (#3198) Fix wrong URL displayed for auth dialog (#3191) Bump version to 1.105.0 (254) UI Ship review feedback for Duck Player onboarding (#3186) Implement bookmarks sort UI tests (#3162) Add bookmarks search UI tests (#3161) Bug: Disable boomark reordering when searching (#3188) Bump version to 1.105.0 (253) Remote feature flag for New Tab Page Improvements (#3176) Fix bookmarks bar issues (#3187) ...
Task/Issue URL: https://app.asana.com/0/1204006570077678/1208027756712863/f
Tech Design URL:
CC:
Description
Adds the following UI tests:
Steps to test
UI Tests
targetBookmarkSearchTests
Definition of Done:
—
Internal references:
Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation