forked from rancher/dashboard
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Cypress to version 10 (rancher#6146)
* Run Cypress migration scripts; Update failing parts * Move env var assignments to Cypress configuration; Correct env patterns * Correct imports within the Cypress tests * Correct TS linting configuration errors after update * Return directly spec path in cypress configuration
- Loading branch information
1 parent
39866fa
commit b6be5ca
Showing
32 changed files
with
882 additions
and
173 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,44 @@ | ||
import { defineConfig } from 'cypress'; | ||
require('dotenv').config(); | ||
|
||
/** | ||
* Filter test spec paths based on env var configuration | ||
* @returns | ||
*/ | ||
const getSpecPattern = (): string[] => { | ||
const optionalPaths = [ | ||
{ | ||
path: 'cypress/e2e/tests/setup/**/*.spec.ts', | ||
active: process.env.TEST_SKIP_SETUP !== 'true' | ||
} | ||
]; | ||
const activePaths = optionalPaths.filter(({ active }) => Boolean(active)).map(({ path }) => path); | ||
|
||
return [ | ||
...activePaths, | ||
'cypress/e2e/tests/pages/**/*.spec.ts', | ||
'cypress/e2e/tests/navigation/**/*.spec.ts' | ||
]; | ||
}; | ||
const baseUrl = (process.env.TEST_BASE_URL || 'https://localhost:8005').replace(/\/$/, ''); | ||
|
||
export default defineConfig({ | ||
defaultCommandTimeout: 60000, | ||
trashAssetsBeforeRuns: true, | ||
env: { | ||
baseUrl, | ||
username: process.env.TEST_USERNAME, | ||
password: process.env.TEST_PASSWORD, | ||
bootstrapPassword: process.env.CATTLE_BOOTSTRAP_PASSWORD, | ||
}, | ||
e2e: { | ||
// We've imported your old cypress plugins here. | ||
// You may want to clean this up later by importing these. | ||
setupNodeEvents(on, config) { | ||
return require('./cypress/plugins/index.ts')(on, config); | ||
}, | ||
experimentalSessionAndOrigin: true, | ||
specPattern: getSpecPattern(), | ||
baseUrl | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...egration/po/components/async-button.po.ts → cypress/e2e/po/components/async-button.po.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
2 changes: 1 addition & 1 deletion
2
...ration/po/components/checkbox-input.po.ts → ...ss/e2e/po/components/checkbox-input.po.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
2 changes: 1 addition & 1 deletion
2
...integration/po/components/component.po.ts → cypress/e2e/po/components/component.po.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
2 changes: 1 addition & 1 deletion
2
cypress/integration/po/components/form.po.ts → cypress/e2e/po/components/form.po.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
2 changes: 1 addition & 1 deletion
2
...gration/po/components/labeled-input.po.ts → ...ess/e2e/po/components/labeled-input.po.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
2 changes: 1 addition & 1 deletion
2
.../integration/po/components/password.po.ts → cypress/e2e/po/components/password.po.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
2 changes: 1 addition & 1 deletion
2
...ion/po/components/radio-group-input.po.ts → ...e2e/po/components/radio-group-input.po.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
2 changes: 1 addition & 1 deletion
2
...tegration/po/components/radio-input.po.ts → cypress/e2e/po/components/radio-input.po.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
2 changes: 1 addition & 1 deletion
2
cypress/integration/po/pages/home.po.ts → cypress/e2e/po/pages/home.po.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
8 changes: 4 additions & 4 deletions
8
...ess/integration/po/pages/login-page.po.ts → cypress/e2e/po/pages/login-page.po.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
2 changes: 1 addition & 1 deletion
2
cypress/integration/po/pages/page.po.ts → cypress/e2e/po/pages/page.po.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
12 changes: 6 additions & 6 deletions
12
.../po/pages/rancher-setup-auth-verify.po.ts → .../po/pages/rancher-setup-auth-verify.po.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
8 changes: 4 additions & 4 deletions
8
.../integration/po/pages/rancher-setup.po.ts → cypress/e2e/po/pages/rancher-setup.po.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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ation/po/side-bars/burger-side-menu.po.ts → ...s/e2e/po/side-bars/burger-side-menu.po.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
2 changes: 1 addition & 1 deletion
2
...tegration/po/side-bars/page-actions.po.ts → cypress/e2e/po/side-bars/page-actions.po.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
2 changes: 1 addition & 1 deletion
2
...ation/po/side-bars/product-side-nav.po.ts → ...s/e2e/po/side-bars/product-side-nav.po.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
4 changes: 2 additions & 2 deletions
4
...ion/tests/navigation/page-actions.spec.ts → ...e2e/tests/navigation/page-actions.spec.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
4 changes: 2 additions & 2 deletions
4
...avigation/side-nav/main-side-menu.spec.ts → ...avigation/side-nav/main-side-menu.spec.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
6 changes: 3 additions & 3 deletions
6
...igation/side-nav/product-side-nav.spec.ts → ...igation/side-nav/product-side-nav.spec.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
6 changes: 3 additions & 3 deletions
6
cypress/integration/tests/pages/home.spec.ts → cypress/e2e/tests/pages/home.spec.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
2 changes: 1 addition & 1 deletion
2
...ess/integration/tests/pages/login.spec.ts → cypress/e2e/tests/pages/login.spec.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
4 changes: 2 additions & 2 deletions
4
...gration/tests/setup/rancher-setup.spec.ts → ...ess/e2e/tests/setup/rancher-setup.spec.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
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
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
Oops, something went wrong.