forked from activist-org/activist
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor component IDs and add accessibility improvements
List of changes: 1. Updated component IDs across multiple files for consistency and improved accessibility: * SearchBar.vue * DropdownItemsLayout.vue * HeaderMobile.vue * MenuMobileNavBar.vue * MenuMobileNavigationDropdown.vue * SidebarLeftFooter.vue * SidebarLeftIndex.vue * SidebarLeftMainSectionSelectors.vue 2. Added new component objects for improved testing and accessibility: * MobileNav.ts * Navigation.ts * OrganizationMenu.ts * EventMenu.ts 3. Updated SearchBar.ts with new methods for opening and closing search input. 4. Modified HeaderWebsite.ts to use the new SearchBar component. 5. Updated package.json to include axe-core and axe-html-reporter for accessibility testing.
- Loading branch information
1 parent
b2ef3fb
commit 4e2f97d
Showing
26 changed files
with
869 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import type { Page, Locator } from "@playwright/test"; | ||
import { PageObjectBase } from "../utils/PageObjectBase"; | ||
|
||
const locators = { | ||
TOGGLE: "#submenu", | ||
ABOUT: "#event-about", | ||
TEAM: "#event-team", | ||
RESOURCES: "#event-resources", | ||
TASKS: "#event-tasks", | ||
DISCUSSION: "#event-discussion", | ||
SETTINGS: "#event-settings", | ||
}; | ||
|
||
export class EventMenu extends PageObjectBase { | ||
constructor(page: Page) { | ||
super(page, locators); | ||
} | ||
|
||
get toggle(): Locator { | ||
return this.getLocator("TOGGLE"); | ||
} | ||
|
||
get about(): Locator { | ||
return this.getLocator("ABOUT"); | ||
} | ||
|
||
get team(): Locator { | ||
return this.getLocator("TEAM"); | ||
} | ||
|
||
get resources(): Locator { | ||
return this.getLocator("RESOURCES"); | ||
} | ||
|
||
get tasks(): Locator { | ||
return this.getLocator("TASKS"); | ||
} | ||
|
||
get discussion(): Locator { | ||
return this.getLocator("DISCUSSION"); | ||
} | ||
|
||
get settings(): Locator { | ||
return this.getLocator("SETTINGS"); | ||
} | ||
|
||
async open(): Promise<void> { | ||
if (!(await this.isOpen())) { | ||
await this.toggle.click(); | ||
} | ||
} | ||
|
||
async close(): Promise<void> { | ||
if (await this.isOpen()) { | ||
await this.toggle.click(); | ||
} | ||
} | ||
|
||
async isOpen(): Promise<boolean> { | ||
return await this.toggle.getAttribute("aria-expanded") === "true"; | ||
} | ||
|
||
async isVisible(): Promise<boolean> { | ||
return await this.toggle.isVisible(); | ||
} | ||
|
||
async isOptionsVisible(): Promise<boolean> { | ||
return await this.options.isVisible(); | ||
} | ||
|
||
async getActiveSelectedOption(): Promise<string> { | ||
const selector = await this.isMobile() | ||
? "[data-headlessui-state='active selected']" | ||
: ".style-menu-option-cta"; | ||
return (await this.options.locator(selector).textContent()) || ""; | ||
} | ||
|
||
async selectOption(option: Locator): Promise<void> { | ||
await option.click(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.