-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to Cypress 13. * This involved some folder restructuring (integration => e2e). * Some subfolders because there are not enough suites to warrant them. * Some steps had duplicated titles and were therefore either consolidated to a single step in the /common folder, or else name changed.
- Loading branch information
1 parent
9454825
commit e3303c3
Showing
98 changed files
with
3,509 additions
and
4,569 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"nonGlobalStepDefinitions": true, | ||
"e2e": { | ||
"stepDefinitions": ["cypress/e2e/**/*.{js,ts}"] | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
const { | ||
addCucumberPreprocessorPlugin, | ||
} = require('@badeball/cypress-cucumber-preprocessor') | ||
const createEsbuildPlugin = require('@badeball/cypress-cucumber-preprocessor/esbuild') | ||
const createBundler = require('@bahmutov/cypress-esbuild-preprocessor') | ||
const { chromeAllowXSiteCookies } = require('@dhis2/cypress-plugins') | ||
const { defineConfig } = require('cypress') | ||
|
||
async function setupNodeEvents(on, config) { | ||
await addCucumberPreprocessorPlugin(on, config) | ||
chromeAllowXSiteCookies(on, config) | ||
|
||
on( | ||
'file:preprocessor', | ||
createBundler({ | ||
plugins: [createEsbuildPlugin.default(config)], | ||
}) | ||
) | ||
|
||
return config | ||
} | ||
|
||
module.exports = defineConfig({ | ||
projectId: '5fk191', | ||
chromeWebSecurity: false, | ||
e2e: { | ||
setupNodeEvents, | ||
baseUrl: 'http://localhost:3000', | ||
specPattern: 'cypress/e2e/*.feature', | ||
viewportWidth: 1280, | ||
viewportHeight: 800, | ||
defaultCommandTimeout: 45000, | ||
/* Globally disable test isolation because the test suite | ||
* contains many tests with sequential steps */ | ||
testIsolation: false, | ||
// Record video | ||
video: true, | ||
// Enabled to reduce the risk of out-of-memory issues | ||
experimentalMemoryManagement: true, | ||
// Set to a low number to reduce the risk of out-of-memory issues | ||
numTestsKeptInMemory: 5, | ||
/* When allowing 1 retry on CI, the test suite will pass if | ||
* it's flaky. And/but we also get to identify flaky tests on the | ||
* Cypress Dashboard. */ | ||
retries: { | ||
runMode: 1, | ||
openMode: 0, | ||
}, | ||
}, | ||
env: { | ||
networkMode: 'live', | ||
}, | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Then } from '@badeball/cypress-cucumber-preprocessor' | ||
import { dashboards } from '../../assets/backends/index.js' | ||
// import { gridItemSel, chartSel } from '../../elements/dashboardItem.js' | ||
import { dashboardTitleSel } from '../../elements/viewDashboard.js' | ||
// import { EXTENDED_TIMEOUT } from '../../support/utils.js' | ||
|
||
Then('the {string} dashboard displays in view mode', (title) => { | ||
cy.location().should((loc) => { | ||
expect(loc.hash).to.equal(dashboards[title].route) | ||
}) | ||
|
||
cy.get(dashboardTitleSel).should('be.visible').and('contain', title) | ||
// cy.get(gridItemSel) | ||
// .first() | ||
// .getIframeBody() | ||
// .find(chartSel, EXTENDED_TIMEOUT) | ||
// .should('exist') | ||
}) |
6 changes: 3 additions & 3 deletions
6
...on/common/view/add_a_FILTERTYPE_filter.js → ...ess/e2e/common/add_a_FILTERTYPE_filter.js
This file contains 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
2 changes: 1 addition & 1 deletion
2
...ration/common/edit/add_dashboard_items.js → cypress/e2e/common/add_dashboard_items.js
This file contains 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
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { When } from '@badeball/cypress-cucumber-preprocessor' | ||
import { clickEditActionButton } from '../../elements/editDashboard.js' | ||
|
||
When('I choose to delete dashboard', () => { | ||
clickEditActionButton('Delete') | ||
}) |
8 changes: 4 additions & 4 deletions
8
...n/common/view/choose_to_edit_dashboard.js → ...ss/e2e/common/choose_to_edit_dashboard.js
This file contains 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
4 changes: 2 additions & 2 deletions
4
...w/click_on_the_FILTERTYPE_filter_badge.js → ...n/click_on_the_FILTERTYPE_filter_badge.js
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { When } from '@badeball/cypress-cucumber-preprocessor' | ||
import { itemMenuSel } from '../../elements/editDashboard.js' | ||
|
||
When('I close the item selector', () => { | ||
//close modal | ||
cy.get('[data-test="dhis2-uicore-layer"]').click('topLeft') | ||
|
||
cy.get(itemMenuSel).should('not.exist') | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { When } from '@badeball/cypress-cucumber-preprocessor' | ||
import { confirmActionDialogSel } from '../../elements/editDashboard.js' | ||
|
||
When('I confirm delete', () => { | ||
cy.get(confirmActionDialogSel).find('button').contains('Delete').click() | ||
}) |
4 changes: 2 additions & 2 deletions
4
...on/common/edit/confirm_discard_changes.js → ...ess/e2e/common/confirm_discard_changes.js
This file contains 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
4 changes: 2 additions & 2 deletions
4
...egration/common/view/exit_print_layout.js → cypress/e2e/common/exit_print_layout.js
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { When } from '@badeball/cypress-cucumber-preprocessor' | ||
import { clickEditActionButton } from '../../elements/editDashboard.js' | ||
|
||
When('I click Exit without saving', () => { | ||
clickEditActionButton('Exit without saving') | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import './before_each_visit_root.js' | ||
import './add_dashboard_items.js' | ||
import './confirm_discard_changes.js' | ||
import './exit_without_saving.js' | ||
import './add_a_FILTERTYPE_filter.js' | ||
import './choose_to_edit_dashboard.js' | ||
import './click_on_the_FILTERTYPE_filter_badge.js' | ||
import './exit_print_layout.js' | ||
import './open_print_layout.js' | ||
import './open_the_SL_dashboard.js' | ||
import './print_layout_displays.js' | ||
import './start_new_dashboard.js' | ||
import './the_dashboard_description_is_(not)_displayed.js' | ||
import './SL_dashboard_displays_in_view_mode.js' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Then } from '@badeball/cypress-cucumber-preprocessor' | ||
import { dashboardTitleSel } from '../../elements/viewDashboard.js' | ||
|
||
Then('a message displays informing that the dashboard is not found', () => { | ||
cy.contains('Requested dashboard not found').should('be.visible') | ||
cy.get(dashboardTitleSel).should('not.exist') | ||
}) |
4 changes: 2 additions & 2 deletions
4
...egration/common/view/open_print_layout.js → cypress/e2e/common/open_print_layout.js
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Given } from '@badeball/cypress-cucumber-preprocessor' | ||
import { dashboards } from '../../assets/backends/index.js' | ||
// import { gridItemSel, chartSel } from '../../elements/dashboardItem.js' | ||
import { | ||
dashboardTitleSel, | ||
dashboardChipSel, | ||
} from '../../elements/viewDashboard.js' | ||
import { EXTENDED_TIMEOUT } from '../../support/utils.js' | ||
|
||
Given('I open the {string} dashboard', (title) => { | ||
cy.get(dashboardChipSel, EXTENDED_TIMEOUT).contains(title).click() | ||
|
||
cy.location().should((loc) => { | ||
expect(loc.hash).to.equal(dashboards[title].route) | ||
}) | ||
|
||
cy.get(dashboardTitleSel).should('be.visible').and('contain', title) | ||
// cy.get(`${gridItemSel}.VISUALIZATION`) | ||
// .first() | ||
// .getIframeBody() | ||
// .find(chartSel, EXTENDED_TIMEOUT) | ||
// .as('vis') | ||
// cy.get('@vis').should('exist') | ||
}) |
Oops, something went wrong.