From 448a00e15297cb9846177b35de9c20c5000a6239 Mon Sep 17 00:00:00 2001 From: Dhaya <154633+dhayab@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:58:52 +0100 Subject: [PATCH] feat(tests): remove ie11 targeting tests (#6415) --- .circleci/config.yml | 4 ++-- tests/e2e/CONTRIBUTING.md | 6 +++--- tests/e2e/all-flavors.spec.ts | 2 +- tests/e2e/flavors.js | 17 +++++------------ tests/e2e/helpers/clickClearRefinements.ts | 1 - tests/e2e/helpers/clickHierarchicalMenuItem.ts | 1 - tests/e2e/helpers/clickNextPage.ts | 1 - tests/e2e/helpers/clickPage.ts | 1 - tests/e2e/helpers/clickPreviousPage.ts | 1 - tests/e2e/helpers/clickRatingMenuItem.ts | 1 - tests/e2e/helpers/clickRefinementListItem.ts | 1 - tests/e2e/helpers/clickToggleRefinement.ts | 1 - .../e2e/helpers/dragRangeSliderLowerBoundTo.ts | 1 - .../e2e/helpers/dragRangeSliderUpperBoundTo.ts | 1 - tests/e2e/helpers/setHitsPerPage.ts | 1 - tests/e2e/helpers/setSearchBoxValue.ts | 3 --- tests/e2e/helpers/setSortByValue.ts | 1 - tests/e2e/wdio.saucelabs.conf.js | 17 ----------------- 18 files changed, 11 insertions(+), 50 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a1538e6971..8e3b04a7e8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -80,7 +80,7 @@ workflows: - examples matrix: parameters: - browser: [chrome, firefox, internet explorer] + browser: [chrome, firefox] filters: branches: only: @@ -137,7 +137,7 @@ workflows: - examples matrix: parameters: - browser: [chrome, firefox, internet explorer] + browser: [chrome, firefox] - e2e tests router nextjs: context: fx-libraries requires: diff --git a/tests/e2e/CONTRIBUTING.md b/tests/e2e/CONTRIBUTING.md index 72151c4d76..222505a7ce 100644 --- a/tests/e2e/CONTRIBUTING.md +++ b/tests/e2e/CONTRIBUTING.md @@ -25,8 +25,8 @@ E2E_FLAVOR="react" yarn test:e2e When using the Sauce Labs service, tests are run on multiple browsers. To run a Sauce Labs test on a single browser, you can set the `E2E_BROWSER` environment variable: ```sh -E2E_BROWSER="internet explorer" yarn test:e2e:saucelabs -# Possible values: chrome, firefox, internet explorer +E2E_BROWSER="firefox" yarn test:e2e:saucelabs +# Possible values: chrome, firefox ``` > [!NOTE] @@ -106,7 +106,7 @@ function createBrandAndQueryFilteringTestSuite(flavor: string) { Here are some general guidelines when writing end-to-end tests: - Each separate step should be in its own `it` function. This isn't a hard rule, but it helps make the scenario more readable and properly [separate each action in Sauce Labs reports](https://user-images.githubusercontent.com/13209/62311104-56217d80-b48b-11e9-94dc-3c18b9ddc2af.png). -- All actions on the browser are asynchronous, so be sure to always `await` them. **Never run multiple asynchronous commands in parallel as it can confuse some browsers (Internet Explorer)**. +- All actions on the browser are asynchronous, so be sure to always `await` them. **Never run multiple asynchronous commands in parallel as it can confuse some browsers**. - Use [helper](#helpers) functions whenever possible, for readability but also for maintainability—if one widget is updated, we only have to updates its helpers without touching the tests. - Only assert what you want to see on the page after an action—for example, is the checkbox selected, is the result list correct, etc. - Only assert what you want to see on the page after an action (Is this checkbox selected? Is the result list correct? etc.) diff --git a/tests/e2e/all-flavors.spec.ts b/tests/e2e/all-flavors.spec.ts index 32a0c4e3f2..7ea3aa3fe5 100644 --- a/tests/e2e/all-flavors.spec.ts +++ b/tests/e2e/all-flavors.spec.ts @@ -5,7 +5,7 @@ import { createInitialStateFromRouteTestSuite } from './specs/initial-state-from import { createPaginationTestSuite } from './specs/pagination.spec'; import { createPriceRangeTestSuite } from './specs/price-range.spec'; -getFilteredFlavors(browser).forEach((flavor) => { +getFilteredFlavors().forEach((flavor) => { describe(`${flavor}`, () => { createBrandAndQueryTestSuite(flavor); createCategoryTestSuite(flavor); diff --git a/tests/e2e/flavors.js b/tests/e2e/flavors.js index 2c3bab6f95..b74fa8b18c 100644 --- a/tests/e2e/flavors.js +++ b/tests/e2e/flavors.js @@ -5,20 +5,13 @@ module.exports = { /** * Returns the list of flavors to be tested on. * When E2E_FLAVOR is set, it only tests the requested flavor. - * When it is not set, it will tests all flavors, except on Internet Explorer - * where it will only test the JS flavors. + * When it is not set, it will tests all flavors. * - * @param {import("webdriverio").BrowserObject} browser The WebdriverIO browser object * @returns The list of flavors to be tested on */ - getFilteredFlavors(browser) { - return ALL_FLAVORS.filter( - !process.env.E2E_FLAVOR - ? (flavor) => - browser.capabilities.browserName !== 'internet explorer' - ? true - : flavor.startsWith('js') - : (flavor) => flavor === process.env.E2E_FLAVOR - ); + getFilteredFlavors() { + return process.env.E2E_FLAVOR + ? ALL_FLAVORS.filter((flavor) => flavor === process.env.E2E_FLAVOR) + : ALL_FLAVORS; }, }; diff --git a/tests/e2e/helpers/clickClearRefinements.ts b/tests/e2e/helpers/clickClearRefinements.ts index b93235100b..864a3d1094 100644 --- a/tests/e2e/helpers/clickClearRefinements.ts +++ b/tests/e2e/helpers/clickClearRefinements.ts @@ -14,7 +14,6 @@ browser.addCommand('clickClearRefinements', async () => { await browser.waitForElement(`.ais-ClearRefinements-button--disabled`); - // Changing the URL will also change the page element IDs in Internet Explorer // Not waiting for the URL to be properly updated before continuing can make the next tests fail await browser.waitUntil( async () => (await browser.getUrl()) !== oldUrl, diff --git a/tests/e2e/helpers/clickHierarchicalMenuItem.ts b/tests/e2e/helpers/clickHierarchicalMenuItem.ts index dfd3bd00ae..4cf4e7c16b 100644 --- a/tests/e2e/helpers/clickHierarchicalMenuItem.ts +++ b/tests/e2e/helpers/clickHierarchicalMenuItem.ts @@ -12,7 +12,6 @@ browser.addCommand('clickHierarchicalMenuItem', async (label: string) => { await item.click(); - // Changing the URL will also change the page element IDs in Internet Explorer // Not waiting for the URL to be properly updated before continuing can make the next tests fail await browser.waitUntil( async () => (await browser.getUrl()) !== oldUrl, diff --git a/tests/e2e/helpers/clickNextPage.ts b/tests/e2e/helpers/clickNextPage.ts index a1550f1010..8544b744d1 100644 --- a/tests/e2e/helpers/clickNextPage.ts +++ b/tests/e2e/helpers/clickNextPage.ts @@ -19,7 +19,6 @@ browser.addCommand('clickNextPage', async () => { `.ais-Pagination-item--selected=${pageNumber + 1}` ); - // Changing the URL will also change the page element IDs in Internet Explorer // Not waiting for the URL to be properly updated before continuing can make the next tests fail await browser.waitUntil( async () => (await browser.getUrl()) !== oldUrl, diff --git a/tests/e2e/helpers/clickPage.ts b/tests/e2e/helpers/clickPage.ts index 2d55662ff7..56544d12af 100644 --- a/tests/e2e/helpers/clickPage.ts +++ b/tests/e2e/helpers/clickPage.ts @@ -14,7 +14,6 @@ browser.addCommand('clickPage', async (number: number) => { await browser.waitForElement(`.ais-Pagination-item--selected=${number}`); - // Changing the URL will also change the page element IDs in Internet Explorer // Not waiting for the URL to be properly updated before continuing can make the next tests fail await browser.waitUntil( async () => (await browser.getUrl()) !== oldUrl, diff --git a/tests/e2e/helpers/clickPreviousPage.ts b/tests/e2e/helpers/clickPreviousPage.ts index 612d5be0bd..e74a1f74d3 100644 --- a/tests/e2e/helpers/clickPreviousPage.ts +++ b/tests/e2e/helpers/clickPreviousPage.ts @@ -19,7 +19,6 @@ browser.addCommand('clickPreviousPage', async () => { `.ais-Pagination-item--selected=${pageNumber - 1}` ); - // Changing the URL will also change the page element IDs in Internet Explorer // Not waiting for the URL to be properly updated before continuing can make the next tests fail await browser.waitUntil( async () => (await browser.getUrl()) !== oldUrl, diff --git a/tests/e2e/helpers/clickRatingMenuItem.ts b/tests/e2e/helpers/clickRatingMenuItem.ts index b94755d08c..8071fbae9c 100644 --- a/tests/e2e/helpers/clickRatingMenuItem.ts +++ b/tests/e2e/helpers/clickRatingMenuItem.ts @@ -16,7 +16,6 @@ browser.addCommand('clickRatingMenuItem', async (label: string) => { `.ais-RatingMenu-item--selected .ais-RatingMenu-link[aria-label="${label}"]` ); - // Changing the URL will also change the page element IDs in Internet Explorer // Not waiting for the URL to be properly updated before continuing can make the next tests fail await browser.waitUntil( async () => (await browser.getUrl()) !== oldUrl, diff --git a/tests/e2e/helpers/clickRefinementListItem.ts b/tests/e2e/helpers/clickRefinementListItem.ts index ab3b0d8a58..a46635f580 100644 --- a/tests/e2e/helpers/clickRefinementListItem.ts +++ b/tests/e2e/helpers/clickRefinementListItem.ts @@ -12,7 +12,6 @@ browser.addCommand('clickRefinementListItem', async (label: string) => { await item.click(); - // Changing the URL will also change the page element IDs in Internet Explorer // Not waiting for the URL to be properly updated before continuing can make the next tests fail await browser.waitUntil( async () => (await browser.getUrl()) !== oldUrl, diff --git a/tests/e2e/helpers/clickToggleRefinement.ts b/tests/e2e/helpers/clickToggleRefinement.ts index 2b5b911064..1d64f1fab8 100644 --- a/tests/e2e/helpers/clickToggleRefinement.ts +++ b/tests/e2e/helpers/clickToggleRefinement.ts @@ -12,7 +12,6 @@ browser.addCommand('clickToggleRefinement', async () => { await checkbox.click(); - // Changing the URL will also change the page element IDs in Internet Explorer // Not waiting for the URL to be properly updated before continuing can make the next tests fail await browser.waitUntil( async () => (await browser.getUrl()) !== oldUrl, diff --git a/tests/e2e/helpers/dragRangeSliderLowerBoundTo.ts b/tests/e2e/helpers/dragRangeSliderLowerBoundTo.ts index b6e2f3e7a1..afdd8800ca 100644 --- a/tests/e2e/helpers/dragRangeSliderLowerBoundTo.ts +++ b/tests/e2e/helpers/dragRangeSliderLowerBoundTo.ts @@ -39,7 +39,6 @@ browser.addCommand('dragRangeSliderLowerBoundTo', async (value: number) => { await browser.waitForElement(RANGE_SLIDER_HANDLE_SELECTOR); - // Changing the URL will also change the page element IDs in Internet Explorer // Not waiting for the URL to be properly updated before continuing can make the next tests fail await browser.waitUntil( async () => (await browser.getUrl()) !== oldUrl, diff --git a/tests/e2e/helpers/dragRangeSliderUpperBoundTo.ts b/tests/e2e/helpers/dragRangeSliderUpperBoundTo.ts index ea530c41a2..974c63b811 100644 --- a/tests/e2e/helpers/dragRangeSliderUpperBoundTo.ts +++ b/tests/e2e/helpers/dragRangeSliderUpperBoundTo.ts @@ -39,7 +39,6 @@ browser.addCommand('dragRangeSliderUpperBoundTo', async (value: number) => { await browser.waitForElement(RANGE_SLIDER_HANDLE_SELECTOR); - // Changing the URL will also change the page element IDs in Internet Explorer // Not waiting for the URL to be properly updated before continuing can make the next tests fail await browser.waitUntil( async () => (await browser.getUrl()) !== oldUrl, diff --git a/tests/e2e/helpers/setHitsPerPage.ts b/tests/e2e/helpers/setHitsPerPage.ts index 0fc9a49d88..ecf06490d6 100644 --- a/tests/e2e/helpers/setHitsPerPage.ts +++ b/tests/e2e/helpers/setHitsPerPage.ts @@ -10,7 +10,6 @@ browser.addCommand('setHitsPerPage', async (label: string) => { await hitsPerPage.selectByVisibleText(label); - // Changing the URL will also change the page element IDs in Internet Explorer // Not waiting for the URL to be properly updated before continuing can make the next tests fail await browser.waitUntil( async () => (await browser.getUrl()) !== oldUrl, diff --git a/tests/e2e/helpers/setSearchBoxValue.ts b/tests/e2e/helpers/setSearchBoxValue.ts index c50d946a7a..7cfc9e360a 100644 --- a/tests/e2e/helpers/setSearchBoxValue.ts +++ b/tests/e2e/helpers/setSearchBoxValue.ts @@ -18,11 +18,8 @@ browser.addCommand('setSearchBoxValue', async (value: string) => { await resetButton.click(); } - // In Internet Explorer the input must be focused before updating its value - await searchBox.click(); await searchBox.setValue(value); - // Changing the URL will also change the page element IDs in Internet Explorer // Not waiting for the URL to be properly updated before continuing can make the next tests fail await browser.waitUntil( async () => { diff --git a/tests/e2e/helpers/setSortByValue.ts b/tests/e2e/helpers/setSortByValue.ts index cc85282116..deaafd0042 100644 --- a/tests/e2e/helpers/setSortByValue.ts +++ b/tests/e2e/helpers/setSortByValue.ts @@ -10,7 +10,6 @@ browser.addCommand('setSortByValue', async (label: string) => { await sortBy.selectByVisibleText(label); - // Changing the URL will also change the page element IDs in Internet Explorer // Not waiting for the URL to be properly updated before continuing can make the next tests fail await browser.waitUntil( async () => (await browser.getUrl()) !== oldUrl, diff --git a/tests/e2e/wdio.saucelabs.conf.js b/tests/e2e/wdio.saucelabs.conf.js index 62ac0ed8f2..c855b7fa83 100644 --- a/tests/e2e/wdio.saucelabs.conf.js +++ b/tests/e2e/wdio.saucelabs.conf.js @@ -107,23 +107,6 @@ module.exports = { seleniumVersion: '3.11.0', }, }, - { - browserName: 'internet explorer', - browserVersion: '11', - platformName: 'Windows 10', - /* - * Sauce Labs specific options - * https://wiki.saucelabs.com/display/DOCS/Test+Configuration+Options - */ - 'sauce:options': { - screenResolution: '1680x1050', - }, - 'se:ieOptions': { - // Required for drag and drop to work - // https://stackoverflow.com/questions/14299392/selenium-webdriver-draganddrop-for-ie9 - requireWindowFocus: true, - }, - }, ].filter( !process.env.E2E_BROWSER ? Boolean