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

UI Tests: Bookmarks and Favorites tests #2568

Merged
merged 127 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
fdf89c3
Add accessibiity identifiers for Find in Page controller elements
Halle Mar 14, 2024
f4270bc
Add accessibilityIdentifier to NSMenuItemExtension.swift
Halle Mar 14, 2024
55e0e42
Set accessibilityIdentifier for address bar text field
Halle Mar 14, 2024
1141095
Add accessibilityIdentifier for Find in Page menu item
Halle Mar 14, 2024
1b74f49
Add FindInPageTests.swift to project
Halle Mar 14, 2024
8566be2
Add more accessibility identifiers to menu items and fix one incorrec…
Halle Mar 14, 2024
c7163ea
Add accessibilityIdentifier to more options find in page
Halle Mar 14, 2024
6c98b35
Change in-use accessibilityIdentifier for optionsButton so it isn't a…
Halle Mar 14, 2024
d1e2190
Find in page tests
Halle Mar 14, 2024
1d36c57
Fix accessibilityIdentifiers for find in page text fields, add roles …
Halle Mar 14, 2024
5d7ff4f
Test for number of search hits in page, single window enforecement, a…
Halle Mar 14, 2024
067ea21
Only deal with the HTML once in the test case run
Halle Mar 14, 2024
4e56b98
Merge branch 'main' into halle/find-in-page-tests
Halle Mar 15, 2024
d5b4bf3
Add waitForNonExistence XCUIElement extension to UI Tests Common
Halle Mar 15, 2024
2b71d4e
Add NSImage cropping to NSImageExtensions.swift
Halle Mar 15, 2024
0599135
Add extensions to UI Tests target
Halle Mar 15, 2024
5e38ef9
Clean up tests and language
Halle Mar 15, 2024
956a6be
Adds test to detect selected find result highlight color
Halle Mar 15, 2024
21b1d23
Merge branch 'main' into halle/find-in-page-tests
Halle Mar 15, 2024
cf26a1a
Add two more accessibility identifiers to menus
Halle Mar 15, 2024
bca6b11
Tests of find next, generalize screenshot color checking
Halle Mar 15, 2024
d25a6fb
Test cleanup
Halle Mar 15, 2024
0554d06
Formatting cleanup
Halle Mar 15, 2024
3ca9266
Test cleanup
Halle Mar 18, 2024
d706994
Merge branch 'main' into halle/find-in-page-tests
Halle Mar 18, 2024
95c0651
Fix line spaces
Halle Mar 18, 2024
e1ba012
Add tests
Halle Mar 18, 2024
b971c9c
Skip failing test with some info about required fixes
Halle Mar 18, 2024
42ed55e
Bring late fix from Find in Page
Halle Mar 18, 2024
27e01c4
Bring over fix of pixel matching from find in page branch
Halle Mar 18, 2024
3a7dded
Improvements to find in page tests from parallel branch
Halle Mar 19, 2024
4cb3242
Fixes for tests-server on independent scheme
Halle Mar 19, 2024
a494a7b
Add accessibility identifiers for recently visited sites
Halle Mar 19, 2024
ba5a011
Test of whether visited site is added to recently visited
Halle Mar 19, 2024
91d7981
Merge branch 'main' into halle/browsing-history-tests
Halle Mar 19, 2024
c4fc7f4
Set clear history accessibility identifier
Halle Mar 19, 2024
f705a9d
Set clear all history alert buttons accessibility identifiers
Halle Mar 19, 2024
fd121f4
WIP commit showing fatal error
Halle Mar 19, 2024
aee805b
WIP fatal error more cleanup
Halle Mar 19, 2024
b42661d
Fix for validateMenuItem error during burning
Halle Mar 19, 2024
f746aeb
All passing tests
Halle Mar 19, 2024
5f54cd6
Merge branch 'main' into halle/browsing-history-tests
Halle Mar 19, 2024
906ff8d
Clean up accessibility identifier assignment
Halle Mar 20, 2024
5311891
Merge branch 'main' into halle/browsing-history-tests
Halle Mar 20, 2024
59abc79
Fix bad pbxproj merge
Halle Mar 20, 2024
f7ce14f
Remove warnings from tab bar tests
Halle Mar 20, 2024
a9a41cb
Restore test dependencies to pbxproj bad merge fix file
Halle Mar 20, 2024
91b155d
Improvement to accessibility identifier for window and tab restoration
Halle Mar 20, 2024
4abac8b
Simplify and clarify tests
Halle Mar 20, 2024
508cebb
Linter warning fixes
Halle Mar 20, 2024
0aa615b
Add test case
Halle Mar 20, 2024
00340e3
Fix tabs in FindInPageTests
Halle Mar 20, 2024
e9f324c
Elements and access levels
Halle Mar 20, 2024
ffd104f
Sync previous test cases already in PR
Halle Mar 20, 2024
c519aeb
More of this file's tabs and spaces linter warning saga
Halle Mar 20, 2024
f7a80a6
Formatting fix
Halle Mar 20, 2024
8e95661
Update sync tests with new accessibility identifiers
Halle Mar 20, 2024
e504083
Add accessibility identifier for adding bookmarks
Halle Mar 20, 2024
961cbf2
Add accessibility identifiers for resetting data menu items
Halle Mar 20, 2024
807bf6c
Add accessibility identifier to suggestions tableView
Halle Mar 21, 2024
e316533
Passing autocomplete tests
Halle Mar 21, 2024
0197f65
Standardize test style across all three test cases
Halle Mar 21, 2024
36d2b89
Standardize test style across test cases
Halle Mar 21, 2024
1384f36
Add BookmarksBarTests
Halle Mar 21, 2024
91c6fb2
Adding accessibility identifiers
Halle Mar 21, 2024
adde31e
First working test
Halle Mar 21, 2024
5bb2b44
All tests, one failing
Halle Mar 21, 2024
14c8448
Add URL extension for UI tests
Halle Mar 22, 2024
25dd363
Add extension to project
Halle Mar 22, 2024
0a35341
Use extension for all simple locally-served pages
Halle Mar 22, 2024
7ea6aa5
Bring over find in page test name fixes
Halle Mar 22, 2024
6a57cb1
Fix test names
Halle Mar 22, 2024
a067841
Merge branch 'main' into halle/browsing-history-tests
Halle Mar 22, 2024
675dc51
Merge branch 'main' into halle/browsing-history-tests
Halle Mar 22, 2024
6ea92d8
Add files back into project to avoid pbxproj merge badness
Halle Mar 22, 2024
0784ee7
More clarity in makeMenuItems
Halle Mar 25, 2024
cd56bcb
Added UITEST_MODE env var
Halle Mar 25, 2024
6a8580a
Merge branch 'main' into halle/browsing-history-tests
Halle Mar 25, 2024
5e9ac28
Don't change menu items more than needed
Halle Mar 25, 2024
4b71bc8
Remove added linebreaks
Halle Mar 25, 2024
8f007b8
Don't use utf8String in TestsURLExtension
Halle Mar 25, 2024
9e1da48
Merge branch 'main' into halle/browsing-history-tests
Halle Mar 25, 2024
5393069
Remove unused DataExtension.swift from target
Halle Mar 25, 2024
d290ca0
Merge branch 'main' into halle/browsing-history-tests
Halle Mar 25, 2024
d95c05e
Remove unnecessary import
Halle Mar 25, 2024
49e9fa4
Merge branch 'main' into halle/bookmarks-bar-tests
Halle Mar 26, 2024
56ef7c8
Merge branch 'main' into halle/browsing-history-tests
Halle Mar 26, 2024
62ffa72
Merge branch 'halle/browsing-history-tests' into halle/bookmarks-bar-…
Halle Mar 26, 2024
521a0f7
Re-add bookmark bar tests after safety-first pbxproj merge
Halle Mar 26, 2024
0d5ef85
Add accessibility ID for other button on bookmark dialog
Halle Mar 27, 2024
4133f39
Test improvements
Halle Mar 27, 2024
b196c11
Merge branch 'main' into halle/bookmarks-bar-tests
Halle Mar 28, 2024
ce1f842
Commit fixes for test scheme building review
Halle Mar 29, 2024
a09ef6b
Update tests to current style
Halle Mar 29, 2024
eae14a7
Add tests back in after safety-first merge
Halle Mar 29, 2024
80a3050
Make pixel matching more forgiving
Halle Mar 29, 2024
f8555d1
Merge branch 'main' into halle/bookmarks-bar-tests
Halle Mar 29, 2024
559967b
Make setup easier to follow, arrange act assert spacing
Halle Mar 29, 2024
957b281
SwiftFormat
Halle Mar 29, 2024
5fbabe1
Keeps reappearing
Halle Mar 29, 2024
af2e3d0
Better naming
Halle Mar 29, 2024
5df0aa9
Remove extraneous unwraps
Halle Mar 29, 2024
9bec32d
Standardize title string creation
Halle Mar 29, 2024
8ad4d66
Add tests
Halle Mar 29, 2024
5a7e8cd
Remove extraneous imports
Halle Mar 29, 2024
eb10b9f
Add accessibility IDs and values
Halle Mar 29, 2024
a7834fe
Add accessibiity IDs
Halle Mar 29, 2024
15b29fe
First three pasing tests
Halle Mar 29, 2024
b973769
New accessibility function on menu items
Halle Apr 3, 2024
dd47d32
Accessibility IDs and values
Halle Apr 3, 2024
dd6e0f6
Favorites tests
Halle Apr 3, 2024
c3da7ba
Merge branch 'main' into halle/bookmarks-and-favorites-tests
Halle Apr 3, 2024
d4cedbe
Set accessibility IDs
Halle Apr 3, 2024
7b6f14c
Merge branch 'main' into halle/bookmarks-and-favorites-tests
Halle Apr 5, 2024
5179582
Re-add test case after safety-first merge
Halle Apr 5, 2024
831d2f9
Add accessibility IDs and values
Halle Apr 5, 2024
5ac85d6
Remove unused id
Halle Apr 8, 2024
f37c372
Abstract click and hover after existence is proven
Halle Apr 8, 2024
430cf0d
Increase timeout
Halle Apr 8, 2024
3496bc8
Add IDs
Halle Apr 8, 2024
e78f060
Finalize tests
Halle Apr 8, 2024
f93bdb0
Merge branch 'main' into halle/bookmarks-and-favorites-tests
Halle Apr 8, 2024
aba9a99
Whitespace warnings
Halle Apr 8, 2024
faebda4
Move function to extension
Halle Apr 8, 2024
d7aa557
Workaround for typing problem
Halle Apr 9, 2024
6c49974
Restore previous typer
Halle Apr 9, 2024
4e62055
Comment explaining why this test uses coords
Halle Apr 9, 2024
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
4 changes: 4 additions & 0 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3286,6 +3286,7 @@
EE339228291BDEFD009F62C1 /* JSAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE339227291BDEFD009F62C1 /* JSAlertController.swift */; };
EE3424602BA0853900173B1B /* VPNUninstaller.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE34245D2BA0853900173B1B /* VPNUninstaller.swift */; };
EE3424612BA0853900173B1B /* VPNUninstaller.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE34245D2BA0853900173B1B /* VPNUninstaller.swift */; };
EE54F7B32BBFEA49006218DB /* BookmarksAndFavoritesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE54F7B22BBFEA48006218DB /* BookmarksAndFavoritesTests.swift */; };
EE66418C2B9B1981005BCD17 /* NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE66418B2B9B1981005BCD17 /* NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift */; };
EE66418D2B9B1981005BCD17 /* NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE66418B2B9B1981005BCD17 /* NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift */; };
EE66666F2B56EDE4001D898D /* VPNLocationsHostingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE66666E2B56EDE4001D898D /* VPNLocationsHostingViewController.swift */; };
Expand Down Expand Up @@ -4765,6 +4766,7 @@
EE0429DF2BA31D2F009EB20F /* FindInPageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FindInPageTests.swift; sourceTree = "<group>"; };
EE339227291BDEFD009F62C1 /* JSAlertController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSAlertController.swift; sourceTree = "<group>"; };
EE34245D2BA0853900173B1B /* VPNUninstaller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNUninstaller.swift; sourceTree = "<group>"; };
EE54F7B22BBFEA48006218DB /* BookmarksAndFavoritesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BookmarksAndFavoritesTests.swift; sourceTree = "<group>"; };
EE66418B2B9B1981005BCD17 /* NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift"; sourceTree = "<group>"; };
EE66666E2B56EDE4001D898D /* VPNLocationsHostingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNLocationsHostingViewController.swift; sourceTree = "<group>"; };
EE7F74902BB5D76600CD9456 /* BookmarksBarTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BookmarksBarTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -6547,6 +6549,7 @@
children = (
EEBCE6802BA444FA00B9DF00 /* Common */,
EED735352BB46B6000F173D6 /* AutocompleteTests.swift */,
EE54F7B22BBFEA48006218DB /* BookmarksAndFavoritesTests.swift */,
EE7F74902BB5D76600CD9456 /* BookmarksBarTests.swift */,
EE02D41B2BB460A600DBE6B3 /* BrowsingHistoryTests.swift */,
EE0429DF2BA31D2F009EB20F /* FindInPageTests.swift */,
Expand Down Expand Up @@ -12267,6 +12270,7 @@
EE02D41A2BB4609900DBE6B3 /* UITests.swift in Sources */,
EE0429E02BA31D2F009EB20F /* FindInPageTests.swift in Sources */,
EE02D4212BB460FE00DBE6B3 /* StringExtension.swift in Sources */,
EE54F7B32BBFEA49006218DB /* BookmarksAndFavoritesTests.swift in Sources */,
EE02D4222BB4611A00DBE6B3 /* TestsURLExtension.swift in Sources */,
7B4CE8E726F02135009134B1 /* TabBarTests.swift in Sources */,
EEBCE6832BA463DD00B9DF00 /* NSImageExtensions.swift in Sources */,
Expand Down
5 changes: 5 additions & 0 deletions DuckDuckGo/Bookmarks/Services/ContextualMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,15 @@ private extension ContextualMenu {
static func addBookmarkToFavoritesMenuItem(isFavorite: Bool, bookmark: Bookmark?) -> NSMenuItem {
let title = isFavorite ? UserText.removeFromFavorites : UserText.addToFavorites
return menuItem(title, #selector(BookmarkMenuItemSelectors.toggleBookmarkAsFavorite(_:)), bookmark)
.withAccessibilityIdentifier(isFavorite == false ? "ContextualMenu.addBookmarkToFavoritesMenuItem" :
"ContextualMenu.removeBookmarkFromFavoritesMenuItem")
}

static func addBookmarksToFavoritesMenuItem(bookmarks: [Bookmark], allFavorites: Bool) -> NSMenuItem {
let title = allFavorites ? UserText.removeFromFavorites : UserText.addToFavorites
let accessibilityValue = allFavorites ? "Favorited" : "Unfavorited"
return menuItem(title, #selector(BookmarkMenuItemSelectors.toggleBookmarkAsFavorite(_:)), bookmarks)
.withAccessibilityIdentifier("ContextualMenu.addBookmarksToFavoritesMenuItem").withAccessibilityValue(accessibilityValue)
}

static func editBookmarkMenuItem(bookmark: Bookmark?) -> NSMenuItem {
Expand All @@ -180,6 +184,7 @@ private extension ContextualMenu {

static func deleteBookmarkMenuItem(bookmark: Bookmark?) -> NSMenuItem {
menuItem(UserText.bookmarksBarContextMenuDelete, #selector(BookmarkMenuItemSelectors.deleteBookmark(_:)), bookmark)
.withAccessibilityIdentifier("ContextualMenu.deleteBookmark")
}

static func moveToEndMenuItem(entity: BaseBookmarkEntity?, parent: BookmarkFolder?) -> NSMenuItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ final class BookmarkManagementSidebarViewController: NSViewController {
tabSwitcherButton.menu = NSMenu {
for content in Tab.TabContent.displayableTabTypes {
NSMenuItem(title: content.title!, representedObject: content)
.withAccessibilityIdentifier("BookmarkManagementSidebarViewController.\(content.title!)")
}
}

Expand Down
1 change: 1 addition & 0 deletions DuckDuckGo/Bookmarks/View/BookmarkOutlineCellView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ final class BookmarkOutlineCellView: NSTableCellView {
faviconImageView.imageScaling = .scaleProportionallyDown
faviconImageView.wantsLayer = true
faviconImageView.layer?.cornerRadius = 2.0
faviconImageView.setAccessibilityIdentifier("BookmarkOutlineCellView.favIconImageView")

titleLabel.translatesAutoresizingMaskIntoConstraints = false
titleLabel.isEditable = false
Expand Down
4 changes: 4 additions & 0 deletions DuckDuckGo/Bookmarks/View/BookmarkTableCellView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ final class BookmarkTableCellView: NSTableCellView {
menuButton.translatesAutoresizingMaskIntoConstraints = false
menuButton.isBordered = false
menuButton.isHidden = true
menuButton.setAccessibilityIdentifier("BookmarkTableCellView.menuButton")
}

private func setupLayout() {
Expand Down Expand Up @@ -209,11 +210,14 @@ final class BookmarkTableCellView: NSTableCellView {

faviconImageView.image = bookmark.favicon(.small) ?? .bookmarkDefaultFavicon

faviconImageView.setAccessibilityIdentifier("BookmarkTableCellView.favIconImageView")
if bookmark.isFavorite {
accessoryImageView.isHidden = false
}

accessoryImageView.image = bookmark.isFavorite ? .favoriteFilledBorder : nil
accessoryImageView.setAccessibilityIdentifier("BookmarkTableCellView.accessoryImageView")
accessoryImageView.setAccessibilityValue(bookmark.isFavorite ? "Favorited" : "Unfavorited")
titleLabel.stringValue = bookmark.title
primaryTitleLabelValue = bookmark.title
tertiaryTitleLabelValue = bookmark.url
Expand Down
5 changes: 5 additions & 0 deletions DuckDuckGo/Common/Extensions/NSMenuItemExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ extension NSMenuItem {
return self
}

func withAccessibilityValue(_ accessibilityValue: String) -> NSMenuItem {
self.setAccessibilityValue(accessibilityValue)
return self
}

@discardableResult
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set accessibility values on menu items.

func withImage(_ image: NSImage?) -> NSMenuItem {
self.image = image
Expand Down
16 changes: 8 additions & 8 deletions DuckDuckGo/HomePage/View/FavoritesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,12 @@ struct Favorite: View {
.link {
model.open(bookmark)
}.contextMenu(ContextMenu(menuItems: {
Button(UserText.openInNewTab, action: { model.openInNewTab(bookmark) })
Button(UserText.openInNewWindow, action: { model.openInNewWindow(bookmark) })
Button(UserText.openInNewTab, action: { model.openInNewTab(bookmark) }).accessibilityIdentifier("HomePage.Views.openInNewTab")
Button(UserText.openInNewWindow, action: { model.openInNewWindow(bookmark) }).accessibilityIdentifier("HomePage.Views.openInNewWindow")
Divider()
Button(UserText.edit, action: { model.edit(bookmark) })
Button(UserText.removeFavorite, action: { model.removeFavorite(bookmark) })
Button(UserText.deleteBookmark, action: { model.deleteBookmark(bookmark) })
Button(UserText.edit, action: { model.edit(bookmark) }).accessibilityIdentifier("HomePage.Views.editBookmark")
Button(UserText.removeFavorite, action: { model.removeFavorite(bookmark) }).accessibilityIdentifier("HomePage.Views.removeFavorite")
Button(UserText.deleteBookmark, action: { model.deleteBookmark(bookmark) }).accessibilityIdentifier("HomePage.Views.deleteBookmark")
}))

}
Expand All @@ -344,13 +344,13 @@ extension HomePage.Models.FavoriteModel {
var favoriteView: some View {
switch favoriteType {
case .bookmark(let bookmark):
HomePage.Views.Favorite(bookmark: bookmark)
HomePage.Views.Favorite(bookmark: bookmark)?.accessibilityIdentifier("HomePage.Models.FavoriteModel.\(bookmark.title)")

case .addButton:
HomePage.Views.FavoritesGridAddButton()
HomePage.Views.FavoritesGridAddButton().accessibilityIdentifier("HomePage.Models.FavoriteModel.addButton")

case .ghostButton:
HomePage.Views.FavoritesGridGhostButton()
HomePage.Views.FavoritesGridGhostButton().accessibilityIdentifier("HomePage.Models.FavoriteModel.ghostButton")
}
}
}
3 changes: 2 additions & 1 deletion DuckDuckGo/Menus/MainMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ import SubscriptionUI
var forwardMenuItem: NSMenuItem { historyMenu.forwardMenuItem }

// MARK: Bookmarks
let manageBookmarksMenuItem = NSMenuItem(title: UserText.mainMenuHistoryManageBookmarks, action: #selector(MainViewController.showManageBookmarks))
let manageBookmarksMenuItem = NSMenuItem(title: UserText.mainMenuHistoryManageBookmarks, action: #selector(MainViewController.showManageBookmarks)).withAccessibilityIdentifier("MainMenu.manageBookmarksMenuItem")
var bookmarksMenuToggleBookmarksBarMenuItem = NSMenuItem(title: "BookmarksBarMenuPlaceholder", action: #selector(MainViewController.toggleBookmarksBarFromMenu), keyEquivalent: "B")
let importBookmarksMenuItem = NSMenuItem(title: UserText.importBookmarks, action: #selector(AppDelegate.openImportBrowserDataWindow))
let bookmarksMenu = NSMenu(title: UserText.bookmarks)
Expand Down Expand Up @@ -313,6 +313,7 @@ import SubscriptionUI
.submenu(favoritesMenu.buildItems {
NSMenuItem(title: UserText.mainMenuHistoryFavoriteThisPage, action: #selector(MainViewController.favoriteThisPage))
.withImage(.favorite)
.withAccessibilityIdentifier("MainMenu.favoriteThisPage")
NSMenuItem.separator()
})
.withImage(.favorite)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ final class AddressBarButtonsViewController: NSViewController {

private func updateBookmarkButtonVisibility() {
guard view.window?.isPopUpWindow == false else { return }
bookmarkButton.setAccessibilityIdentifier("Bookmarks Button")
bookmarkButton.setAccessibilityIdentifier("AddressBarButtonsViewController.bookmarkButton")
let hasEmptyAddressBar = textFieldValue?.isEmpty ?? true
var showBookmarkButton: Bool {
guard let tabViewModel, tabViewModel.canBeBookmarked else { return false }
Expand Down Expand Up @@ -727,15 +727,18 @@ final class AddressBarButtonsViewController: NSViewController {

private func updateBookmarkButtonImage(isUrlBookmarked: Bool = false) {
if let url = tabViewModel?.tab.content.url,
isUrlBookmarked || bookmarkManager.isUrlBookmarked(url: url) {
isUrlBookmarked || bookmarkManager.isUrlBookmarked(url: url)
{
bookmarkButton.image = .bookmarkFilled
bookmarkButton.mouseOverTintColor = NSColor.bookmarkFilledTint
bookmarkButton.toolTip = UserText.editBookmarkTooltip
bookmarkButton.setAccessibilityValue("Bookmarked")
} else {
bookmarkButton.mouseOverTintColor = nil
bookmarkButton.image = .bookmark
bookmarkButton.contentTintColor = nil
bookmarkButton.toolTip = UserText.addBookmarkTooltip
bookmarkButton.setAccessibilityValue("Unbookmarked")
}
}

Expand Down
3 changes: 2 additions & 1 deletion DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ final class MoreOptionsMenu: NSMenu {
.targetting(self)
.withImage(.bookmarks)
.withSubmenu(bookmarksSubMenu)

.withAccessibilityIdentifier("MoreOptionsMenu.openBookmarks")
addItem(withTitle: UserText.downloads, action: #selector(openDownloads), keyEquivalent: "j")
.targetting(self)
.withImage(.downloads)
Expand Down Expand Up @@ -673,6 +673,7 @@ final class BookmarksSubMenu: NSMenu {
let bookmarkPageItem = addItem(withTitle: UserText.bookmarkThisPage, action: #selector(MoreOptionsMenu.bookmarkPage(_:)), keyEquivalent: "d")
.withModifierMask([.command])
.targetting(target)
.withAccessibilityIdentifier("MoreOptionsMenu.bookmarkPage")

bookmarkPageItem.isEnabled = tabCollectionViewModel.selectedTabViewModel?.canBeBookmarked == true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ extension Preferences {
if model.isContinueSetUpAvailable {
ToggleMenuItem(UserText.newTabSetUpSectionTitle, isOn: $model.isContinueSetUpVisible)
}
ToggleMenuItem(UserText.newTabFavoriteSectionTitle, isOn: $model.isFavoriteVisible)
ToggleMenuItem(UserText.newTabFavoriteSectionTitle, isOn: $model.isFavoriteVisible).accessibilityIdentifier("Preferences.AppearanceView.showFavoritesToggle")
ToggleMenuItem(UserText.newTabRecentActivitySectionTitle, isOn: $model.isRecentActivityVisible)
}

Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Tab/TabExtensions/ContextMenuManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private extension ContextMenuManager {
}

func bookmarkPageMenuItem() -> NSMenuItem {
NSMenuItem(title: UserText.bookmarkPage, action: #selector(MainViewController.bookmarkThisPage), target: nil, keyEquivalent: "")
NSMenuItem(title: UserText.bookmarkPage, action: #selector(MainViewController.bookmarkThisPage), target: nil, keyEquivalent: "").withAccessibilityIdentifier("ContextMenuManager.bookmarkPageMenuItem")
}

func openLinkInNewWindowMenuItem(from item: NSMenuItem) -> NSMenuItem {
Expand Down
1 change: 0 additions & 1 deletion UITests/AutocompleteTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// limitations under the License.
//

import Common
import XCTest

class AutocompleteTests: XCTestCase {
Expand Down
Loading
Loading