Last active
February 28, 2026 11:43
-
-
Save pablocattaneo/fd062f884b3c31eda5e8ee248f03f79c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| test("Dropdown should be sorted in alphabetical order", async ({ page }) => { | |
| await page.goto(PAGE_URL); | |
| const dropdown = page.getByRole("combobox").and(page.locator("#country")); | |
| const options = await dropdown.locator("option").all(); | |
| const optionValues = await Promise.all(options.map(option => option.textContent())); | |
| const sortedOptionValues = [...optionValues].sort(); | |
| expect(optionValues).toEqual(sortedOptionValues); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment