From d831f94ecff0f987d3d40eac9d35a340c890b595 Mon Sep 17 00:00:00 2001 From: Ghislain B Date: Fri, 10 Nov 2023 12:18:28 -0500 Subject: [PATCH] chore: use Cypress new experimental option `experimentalStrategy` (#249) - see https://docs.cypress.io/guides/references/experiments/#Experimental-Flake-Detection-Features --- .github/workflows/main.yml | 4 ++++ test/cypress.config.ts | 12 ++++++++++-- test/cypress/e2e/example01.cy.ts | 2 +- test/cypress/e2e/example02.cy.ts | 2 +- test/cypress/e2e/example03.cy.ts | 2 +- test/cypress/e2e/example04.cy.ts | 2 +- test/cypress/e2e/example05.cy.ts | 2 +- test/cypress/e2e/example06.cy.ts | 2 +- test/cypress/e2e/example07.cy.ts | 2 +- test/cypress/e2e/example08.cy.ts | 2 +- test/cypress/e2e/example09.cy.ts | 2 +- test/cypress/e2e/example10.cy.ts | 2 +- test/cypress/e2e/example11.cy.ts | 2 +- test/cypress/e2e/example12.cy.ts | 2 +- test/cypress/e2e/example13.cy.ts | 2 +- test/cypress/e2e/example14.cy.ts | 2 +- test/cypress/e2e/example15.cy.ts | 2 +- test/cypress/e2e/example16.cy.ts | 2 +- test/cypress/e2e/example18.cy.ts | 2 +- test/cypress/e2e/example20.cy.ts | 2 +- test/cypress/e2e/example21.cy.ts | 2 +- test/cypress/e2e/example22.cy.ts | 2 +- test/cypress/e2e/example23.cy.ts | 2 +- test/cypress/e2e/example24.cy.ts | 2 +- test/cypress/e2e/example25.cy.ts | 2 +- test/cypress/e2e/example27.cy.ts | 2 +- test/cypress/e2e/example28.cy.ts | 2 +- test/cypress/e2e/example29.cy.ts | 2 +- test/cypress/e2e/example30.cy.ts | 2 +- test/cypress/e2e/example31.cy.ts | 2 +- test/cypress/e2e/example32.cy.ts | 2 +- test/cypress/e2e/example33.cy.ts | 2 +- test/cypress/e2e/example34.cy.ts | 2 +- 33 files changed, 45 insertions(+), 33 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1a10458f..76bcc1b6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,6 +10,10 @@ on: branches: - '**' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: run: name: Node ${{ matrix.node }} diff --git a/test/cypress.config.ts b/test/cypress.config.ts index 19477aab..ed7af86b 100644 --- a/test/cypress.config.ts +++ b/test/cypress.config.ts @@ -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/#', diff --git a/test/cypress/e2e/example01.cy.ts b/test/cypress/e2e/example01.cy.ts index 7db21541..d3cac219 100644 --- a/test/cypress/e2e/example01.cy.ts +++ b/test/cypress/e2e/example01.cy.ts @@ -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(() => { diff --git a/test/cypress/e2e/example02.cy.ts b/test/cypress/e2e/example02.cy.ts index 02364a32..654f3579 100644 --- a/test/cypress/e2e/example02.cy.ts +++ b/test/cypress/e2e/example02.cy.ts @@ -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'); diff --git a/test/cypress/e2e/example03.cy.ts b/test/cypress/e2e/example03.cy.ts index 06328b93..6975fafd 100644 --- a/test/cypress/e2e/example03.cy.ts +++ b/test/cypress/e2e/example03.cy.ts @@ -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', diff --git a/test/cypress/e2e/example04.cy.ts b/test/cypress/e2e/example04.cy.ts index 3fe45d65..a018f177 100644 --- a/test/cypress/e2e/example04.cy.ts +++ b/test/cypress/e2e/example04.cy.ts @@ -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'); diff --git a/test/cypress/e2e/example05.cy.ts b/test/cypress/e2e/example05.cy.ts index b3e8994b..851746df 100644 --- a/test/cypress/e2e/example05.cy.ts +++ b/test/cypress/e2e/example05.cy.ts @@ -1,4 +1,4 @@ -describe('Example 5 - OData Grid', { retries: 1 }, () => { +describe('Example 5 - OData Grid', () => { const GRID_ROW_HEIGHT = 35; beforeEach(() => { diff --git a/test/cypress/e2e/example06.cy.ts b/test/cypress/e2e/example06.cy.ts index ad9c3528..c2fc8482 100644 --- a/test/cypress/e2e/example06.cy.ts +++ b/test/cypress/e2e/example06.cy.ts @@ -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'); diff --git a/test/cypress/e2e/example07.cy.ts b/test/cypress/e2e/example07.cy.ts index 882ee8cc..f508c12e 100644 --- a/test/cypress/e2e/example07.cy.ts +++ b/test/cypress/e2e/example07.cy.ts @@ -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(() => { diff --git a/test/cypress/e2e/example08.cy.ts b/test/cypress/e2e/example08.cy.ts index 3aeb7014..0f8f38e0 100644 --- a/test/cypress/e2e/example08.cy.ts +++ b/test/cypress/e2e/example08.cy.ts @@ -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(() => { diff --git a/test/cypress/e2e/example09.cy.ts b/test/cypress/e2e/example09.cy.ts index 4b000988..9993809d 100644 --- a/test/cypress/e2e/example09.cy.ts +++ b/test/cypress/e2e/example09.cy.ts @@ -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é']; diff --git a/test/cypress/e2e/example10.cy.ts b/test/cypress/e2e/example10.cy.ts index a5e78819..a0ea1844 100644 --- a/test/cypress/e2e/example10.cy.ts +++ b/test/cypress/e2e/example10.cy.ts @@ -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(() => { diff --git a/test/cypress/e2e/example11.cy.ts b/test/cypress/e2e/example11.cy.ts index 48249598..21d6902a 100644 --- a/test/cypress/e2e/example11.cy.ts +++ b/test/cypress/e2e/example11.cy.ts @@ -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', () => { diff --git a/test/cypress/e2e/example12.cy.ts b/test/cypress/e2e/example12.cy.ts index 856d7cf2..23e45531 100644 --- a/test/cypress/e2e/example12.cy.ts +++ b/test/cypress/e2e/example12.cy.ts @@ -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é']; diff --git a/test/cypress/e2e/example13.cy.ts b/test/cypress/e2e/example13.cy.ts index 436ff594..420ae4d5 100644 --- a/test/cypress/e2e/example13.cy.ts +++ b/test/cypress/e2e/example13.cy.ts @@ -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; diff --git a/test/cypress/e2e/example14.cy.ts b/test/cypress/e2e/example14.cy.ts index b8845507..119609af 100644 --- a/test/cypress/e2e/example14.cy.ts +++ b/test/cypress/e2e/example14.cy.ts @@ -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']; diff --git a/test/cypress/e2e/example15.cy.ts b/test/cypress/e2e/example15.cy.ts index bfcdeed6..19e325cb 100644 --- a/test/cypress/e2e/example15.cy.ts +++ b/test/cypress/e2e/example15.cy.ts @@ -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é']; diff --git a/test/cypress/e2e/example16.cy.ts b/test/cypress/e2e/example16.cy.ts index 3aff3045..fc362219 100644 --- a/test/cypress/e2e/example16.cy.ts +++ b/test/cypress/e2e/example16.cy.ts @@ -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', () => { diff --git a/test/cypress/e2e/example18.cy.ts b/test/cypress/e2e/example18.cy.ts index 74ba89d3..edb7728d 100644 --- a/test/cypress/e2e/example18.cy.ts +++ b/test/cypress/e2e/example18.cy.ts @@ -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; diff --git a/test/cypress/e2e/example20.cy.ts b/test/cypress/e2e/example20.cy.ts index 6d70e520..164f95b1 100644 --- a/test/cypress/e2e/example20.cy.ts +++ b/test/cypress/e2e/example20.cy.ts @@ -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']; diff --git a/test/cypress/e2e/example21.cy.ts b/test/cypress/e2e/example21.cy.ts index 5682393a..6ae1c466 100644 --- a/test/cypress/e2e/example21.cy.ts +++ b/test/cypress/e2e/example21.cy.ts @@ -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; diff --git a/test/cypress/e2e/example22.cy.ts b/test/cypress/e2e/example22.cy.ts index 60d60674..5573cd98 100644 --- a/test/cypress/e2e/example22.cy.ts +++ b/test/cypress/e2e/example22.cy.ts @@ -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']; diff --git a/test/cypress/e2e/example23.cy.ts b/test/cypress/e2e/example23.cy.ts index 3c70fd08..e97dacab 100644 --- a/test/cypress/e2e/example23.cy.ts +++ b/test/cypress/e2e/example23.cy.ts @@ -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'); diff --git a/test/cypress/e2e/example24.cy.ts b/test/cypress/e2e/example24.cy.ts index 663d1713..515d9d08 100644 --- a/test/cypress/e2e/example24.cy.ts +++ b/test/cypress/e2e/example24.cy.ts @@ -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'); }); diff --git a/test/cypress/e2e/example25.cy.ts b/test/cypress/e2e/example25.cy.ts index 1c919fda..172177ec 100644 --- a/test/cypress/e2e/example25.cy.ts +++ b/test/cypress/e2e/example25.cy.ts @@ -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']; diff --git a/test/cypress/e2e/example27.cy.ts b/test/cypress/e2e/example27.cy.ts index c09fbdb8..b3118429 100644 --- a/test/cypress/e2e/example27.cy.ts +++ b/test/cypress/e2e/example27.cy.ts @@ -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']; diff --git a/test/cypress/e2e/example28.cy.ts b/test/cypress/e2e/example28.cy.ts index bf175bbb..b13f34f0 100644 --- a/test/cypress/e2e/example28.cy.ts +++ b/test/cypress/e2e/example28.cy.ts @@ -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']; diff --git a/test/cypress/e2e/example29.cy.ts b/test/cypress/e2e/example29.cy.ts index 79da8e21..740360c7 100644 --- a/test/cypress/e2e/example29.cy.ts +++ b/test/cypress/e2e/example29.cy.ts @@ -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)') diff --git a/test/cypress/e2e/example30.cy.ts b/test/cypress/e2e/example30.cy.ts index 9cf14f04..31646ecf 100644 --- a/test/cypress/e2e/example30.cy.ts +++ b/test/cypress/e2e/example30.cy.ts @@ -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']; diff --git a/test/cypress/e2e/example31.cy.ts b/test/cypress/e2e/example31.cy.ts index c6fcda12..528e58d8 100644 --- a/test/cypress/e2e/example31.cy.ts +++ b/test/cypress/e2e/example31.cy.ts @@ -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(() => { diff --git a/test/cypress/e2e/example32.cy.ts b/test/cypress/e2e/example32.cy.ts index 637d5bf9..e2f28fef 100644 --- a/test/cypress/e2e/example32.cy.ts +++ b/test/cypress/e2e/example32.cy.ts @@ -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(() => { diff --git a/test/cypress/e2e/example33.cy.ts b/test/cypress/e2e/example33.cy.ts index c51907f0..aebbc9a7 100644 --- a/test/cypress/e2e/example33.cy.ts +++ b/test/cypress/e2e/example33.cy.ts @@ -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; diff --git a/test/cypress/e2e/example34.cy.ts b/test/cypress/e2e/example34.cy.ts index 53f6486c..0ed7da36 100644 --- a/test/cypress/e2e/example34.cy.ts +++ b/test/cypress/e2e/example34.cy.ts @@ -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;