Skip to content

Commit

Permalink
chore: use Cypress new experimental option experimentalStrategy (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding authored Nov 10, 2023
1 parent f017e71 commit d831f94
Show file tree
Hide file tree
Showing 33 changed files with 45 additions and 33 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
branches:
- '**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
run:
name: Node ${{ matrix.node }}
Expand Down
12 changes: 10 additions & 2 deletions test/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@ export default defineConfig({
pageLoadTimeout: 90000,
numTestsKeptInMemory: 5,
retries: {
runMode: 2,
openMode: 0,
experimentalStrategy: 'detect-flake-and-pass-on-threshold',
experimentalOptions: {
maxRetries: 2,
passesRequired: 1,
},

// you must also explicitly set openMode and runMode to
// either true or false when using experimental retries
openMode: false, // Cypress UI
runMode: true, // run in CI
},
e2e: {
baseUrl: 'http://localhost:8080/#',
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example01.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 1 - Basic Grids', { retries: 1 }, () => {
describe('Example 1 - Basic Grids', () => {
const fullTitles = ['Title', 'Duration (days)', '% Complete', 'Start', 'Finish', 'Effort Driven'];

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example02.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { removeExtraSpaces } from '../plugins/utilities';

describe('Example 2 - Grid with Formatters', { retries: 1 }, () => {
describe('Example 2 - Grid with Formatters', () => {
it('should display Example title', () => {
cy.visit(`${Cypress.config('baseUrl')}/example2`);
cy.get('h2').should('contain', 'Example 2: Grid with Formatters');
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example03.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 3 - Grid with Editors', { retries: 1 }, () => {
describe('Example 3 - Grid with Editors', () => {
const GRID_ROW_HEIGHT = 35;
const fullTitles = [
'', '', 'Title', 'Title, Custom Editor', 'Duration (days)', '% Complete',
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example04.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import moment from 'moment-mini';
import { removeExtraSpaces } from '../plugins/utilities';

describe('Example 4 - Client Side Sort/Filter Grid', { retries: 1 }, () => {
describe('Example 4 - Client Side Sort/Filter Grid', () => {
it('should display Example title', () => {
cy.visit(`${Cypress.config('baseUrl')}/example4`);
cy.get('h2').should('contain', 'Example 4: Client Side Sort/Filter');
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example05.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 5 - OData Grid', { retries: 1 }, () => {
describe('Example 5 - OData Grid', () => {
const GRID_ROW_HEIGHT = 35;

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example06.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { removeWhitespaces } from '../plugins/utilities';
const presetLowestDay = moment().add(-2, 'days').format('YYYY-MM-DD');
const presetHighestDay = moment().add(20, 'days').format('YYYY-MM-DD');

describe('Example 6 - GraphQL Grid', { retries: 1 }, () => {
describe('Example 6 - GraphQL Grid', () => {
it('should display Example title', () => {
cy.visit(`${Cypress.config('baseUrl')}/example6`);
cy.get('h2').should('contain', 'Example 6: Grid with Backend GraphQL Service');
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example07.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 7 - Header Button Plugin', { retries: 1 }, () => {
describe('Example 7 - Header Button Plugin', () => {
const titles = ['Resize me!', 'Hover me!', 'Column C', 'Column D', 'Column E', 'Column F', 'Column G', 'Column H', 'Column I', 'Column J'];

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example08.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 8 - Header Menu Plugin', { retries: 1 }, () => {
describe('Example 8 - Header Menu Plugin', () => {
const titles = ['Title', 'Duration', '% Complete', 'Start', 'Finish', 'Completed'];

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example09.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 9 - Grid Menu', { retries: 1 }, () => {
describe('Example 9 - Grid Menu', () => {
const fullEnglishTitles = ['Title', 'Duration', '% Complete', 'Start', 'Finish', 'Completed'];
const fullFrenchTitles = ['Titre', 'Durée', '% Achevée', 'Début', 'Fin', 'Terminé'];

Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example10.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 10 - Multiple Grids with Row Selection', { retries: 1 }, () => {
describe('Example 10 - Multiple Grids with Row Selection', () => {
const titles = ['', 'Title', 'Duration (days)', '% Complete', 'Start', 'Finish', 'Effort Driven'];

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example11.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 11 - Add / Update / Highlight a Datagrid Item', { retries: 1 }, () => {
describe('Example 11 - Add / Update / Highlight a Datagrid Item', () => {
const fullTitles = ['', 'Title', 'Duration (days)', '% Complete', 'Start', 'Finish', 'Effort Driven'];

it('should display Example title', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example12.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import moment from 'moment-mini';
import { removeExtraSpaces } from '../plugins/utilities';

describe('Example 12: Localization (i18n)', { retries: 1 }, () => {
describe('Example 12: Localization (i18n)', () => {
const fullEnglishTitles = ['', 'Title', 'Description', 'Duration', 'Start', 'Finish', 'Completed', 'Completed'];
const fullFrenchTitles = ['', 'Titre', 'Description', 'Durée', 'Début', 'Fin', 'Terminé', 'Terminé'];

Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example13.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

describe('Example 13 - Grouping & Aggregators', { retries: 1 }, () => {
describe('Example 13 - Grouping & Aggregators', () => {
const fullTitles = ['#', 'Title', 'Duration', '% Complete', 'Start', 'Finish', 'Cost', 'Effort Driven'];
const GRID_ROW_HEIGHT = 35;

Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example14.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 14 - Column Span & Header Grouping', { retries: 1 }, () => {
describe('Example 14 - Column Span & Header Grouping', () => {
// NOTE: everywhere there's a * 2 is because we have a top+bottom (frozen rows) containers even after Unfreeze Columns/Rows
const fullPreTitles = ['', 'Common Factor', 'Period', 'Analysis'];
const fullTitles = ['#', 'Title', 'Duration', 'Start', 'Finish', '% Complete', 'Effort Driven'];
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example15.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 15: Grid State & Presets using Local Storage', { retries: 1 }, () => {
describe('Example 15: Grid State & Presets using Local Storage', () => {
const fullEnglishTitles = ['', 'Title', 'Description', 'Duration', '% Complete', 'Start', 'Completed'];
const fullFrenchTitles = ['', 'Titre', 'Description', 'Durée', '% Achevée', 'Début', 'Terminé'];

Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example16.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 16 - Row Move & Checkbox Selector Selector Plugins', { retries: 1 }, () => {
describe('Example 16 - Row Move & Checkbox Selector Selector Plugins', () => {
const fullTitles = ['', '', 'Title', 'Duration', '% Complete', 'Start', 'Finish', 'Completed'];

it('should display Example title', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example18.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 18 - Draggable Grouping & Aggregators', { retries: 1 }, () => {
describe('Example 18 - Draggable Grouping & Aggregators', () => {
const fullTitles = ['Title', 'Duration', '% Complete', 'Start', 'Finish', 'Cost', 'Effort-Driven'];
const GRID_ROW_HEIGHT = 35;

Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example20.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 20 - Frozen Grid', { retries: 1 }, () => {
describe('Example 20 - Frozen Grid', () => {
// NOTE: everywhere there's a * 2 is because we have a top+bottom (frozen rows) containers even after Unfreeze Columns/Rows

const fullTitles = ['#', 'Title', '% Complete', 'Start', 'Finish', 'Cost | Duration', 'Effort Driven', 'Title 1', 'Title 2', 'Title 3', 'Title 4'];
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example21.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 21 - Grid AutoHeight', { retries: 1 }, () => {
describe('Example 21 - Grid AutoHeight', () => {
const fullTitles = ['Title', 'Duration (days)', '% Complete', 'Start', 'Finish', 'Effort Driven'];
const GRID_ROW_HEIGHT = 35;

Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example22.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 22 - Grids in Bootstrap Tabs', { retries: 1 }, () => {
describe('Example 22 - Grids in Bootstrap Tabs', () => {
const GRID_ROW_HEIGHT = 35;
const grid1FullTitles = ['Title', 'Duration (days)', '% Complete', 'Start', 'Finish', 'Effort Driven'];
const grid2FullTitles = ['Name', 'Gender', 'Company'];
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example23.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const presetMaxDuration = 88;
const presetLowestDay = moment().add(-2, 'days').format('YYYY-MM-DD');
const presetHighestDay = moment().add(28, 'days').format('YYYY-MM-DD');

describe('Example 23 - Range Filters', { retries: 1 }, () => {
describe('Example 23 - Range Filters', () => {
it('should display Example title', () => {
cy.visit(`${Cypress.config('baseUrl')}/example23`);
cy.get('h2').should('contain', 'Example 23: Filtering from Range of Search Values');
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example24.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ describe('Example 24 - Cell Menu & Context Menu Plugins', () => {
const fullEnglishTitles = ['#', 'Title', '% Complete', 'Start', 'Finish', 'Priority', 'Completed', 'Action'];
const fullFrenchTitles = ['#', 'Titre', '% Achevée', 'Début', 'Fin', 'Priorité', 'Terminé', 'Action'];

it('should display Example title', { retries: 1 }, () => {
it('should display Example title', () => {
cy.visit(`${Cypress.config('baseUrl')}/example24`);
cy.get('h2').should('contain', 'Example 24: Cell Menu & Context Menu Plugins');
});
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example25.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 25 - GraphQL Basic API without Pagination', { retries: 1 }, () => {
describe('Example 25 - GraphQL Basic API without Pagination', () => {
const GRID_ROW_HEIGHT = 35;
const fullPreTitles = ['Country', 'Language', 'Continent'];
const fullTitles = ['Code', 'Name', 'Native', 'Phone Area Code', 'Currency', 'Emoji', 'Names', 'Native', 'Codes', 'Name', 'Code'];
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example27.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import { changeTimezone, removeExtraSpaces, zeroPadding } from '../plugins/utilities';

describe('Example 27 - Tree Data (from a flat dataset with parentId references)', { retries: 1 }, () => {
describe('Example 27 - Tree Data (from a flat dataset with parentId references)', () => {
const GRID_ROW_HEIGHT = 40;
const titles = ['Title', 'Duration', '% Complete', 'Start', 'Finish', 'Effort Driven'];

Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example28.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 28 - Tree Data with Aggregators (from a Hierarchical Dataset)', { retries: 1 }, () => {
describe('Example 28 - Tree Data with Aggregators (from a Hierarchical Dataset)', () => {
const GRID_ROW_HEIGHT = 33;
const titles = ['Files', 'Date Modified', 'Description', 'Size'];
// const defaultSortAscList = ['bucket-list.txt', 'documents', 'misc', 'warranties.txt', 'pdf', 'internet-bill.pdf', 'map.pdf', 'map2.pdf', 'phone-bill.pdf', 'txt', 'todo.txt', 'unclassified.csv', 'unresolved.csv', 'xls', 'compilation.xls', 'music', 'mp3', 'other', 'pop', 'song.mp3', 'theme.mp3', 'rock', 'soft.mp3', 'something.txt'];
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example29.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 29 - Header and Footer slots', { retries: 1 }, () => {
describe('Example 29 - Header and Footer slots', () => {
it('should display a custom header as slot', () => {
cy.visit(`${Cypress.config('baseUrl')}/example29`);
cy.get('h5:nth(0)')
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example30.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import { changeTimezone, zeroPadding } from '../plugins/utilities';

describe('Example 30 Composite Editor Modal', { retries: 1 }, () => {
describe('Example 30 Composite Editor Modal', () => {
const fullPreTitles = ['', 'Common Factor', 'Analysis', 'Period', 'Item', ''];
const fullTitles = ['', 'Title', 'Duration', 'Cost', '% Complete', 'Complexity', 'Start', 'Completed', 'Finish', 'Product', 'Country of Origin', 'Action'];

Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example31.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 31 - OData Grid using RxJS', { retries: 1 }, () => {
describe('Example 31 - OData Grid using RxJS', () => {
const GRID_ROW_HEIGHT = 33;

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example32.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 32 - Columns Resize by Content', { retries: 1 }, () => {
describe('Example 32 - Columns Resize by Content', () => {
const GRID_ROW_HEIGHT = 33;

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example33.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 33 - Regular & Custom Tooltips', { retries: 1 }, () => {
describe('Example 33 - Regular & Custom Tooltips', () => {
const titles = ['', 'Title', 'Duration', 'Description', 'Description 2', 'Cost', '% Complete', 'Start', 'Finish', 'Effort Driven', 'Prerequisites', 'Action'];
const GRID_ROW_HEIGHT = 33;

Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/example34.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Example 34 - Real-Time Trading Platform', { retries: 1 }, () => {
describe('Example 34 - Real-Time Trading Platform', () => {
const titles = ['Currency', 'Symbol', 'Market', 'Company', 'Type', 'Change', 'Price', 'Quantity', 'Amount', 'Price History', 'Execution Timestamp'];
const GRID_ROW_HEIGHT = 35;

Expand Down

0 comments on commit d831f94

Please sign in to comment.