Skip to content

Commit

Permalink
feat(tests): remove ie11 targeting tests (#6415)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhayab authored and Haroenv committed Oct 29, 2024
1 parent bf2d04a commit e456c87
Show file tree
Hide file tree
Showing 18 changed files with 11 additions and 50 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ workflows:
- examples
matrix:
parameters:
browser: [chrome, firefox, internet explorer]
browser: [chrome, firefox]
filters:
branches:
only:
Expand Down Expand Up @@ -137,7 +137,7 @@ workflows:
- examples
matrix:
parameters:
browser: [chrome, firefox, internet explorer]
browser: [chrome, firefox]
- e2e tests router nextjs:
context: fx-libraries
requires:
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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.)
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/all-flavors.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
17 changes: 5 additions & 12 deletions tests/e2e/flavors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
};
1 change: 0 additions & 1 deletion tests/e2e/helpers/clickClearRefinements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/helpers/clickHierarchicalMenuItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/helpers/clickNextPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/helpers/clickPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/helpers/clickPreviousPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/helpers/clickRatingMenuItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/helpers/clickRefinementListItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/helpers/clickToggleRefinement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/helpers/dragRangeSliderLowerBoundTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/helpers/dragRangeSliderUpperBoundTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/helpers/setHitsPerPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions tests/e2e/helpers/setSearchBoxValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/helpers/setSortByValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
17 changes: 0 additions & 17 deletions tests/e2e/wdio.saucelabs.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e456c87

Please sign in to comment.