Skip to content

Commit 2f2c9aa

Browse files
authored
Merge pull request ceph#50037 from rhcs-dashboard/cypress-10
mgr/dashboard: update to cypress 10 Reviewed-by: Pegonzal <NOT@FOUND>
2 parents afbb3b0 + 3279afa commit 2f2c9aa

File tree

86 files changed

+1987
-1535
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1987
-1535
lines changed

src/pybind/mgr/dashboard/ci/cephadm/run-cephadm-e2e-tests.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export CYPRESS_BASE_URL CYPRESS_LOGIN_USER CYPRESS_LOGIN_PWD
2424
cypress_run () {
2525
local specs="$1"
2626
local timeout="$2"
27-
local override_config="ignoreTestFiles=*.po.ts,retries=0,testFiles=${specs},chromeWebSecurity=false"
27+
local override_config="excludeSpecPattern=*.po.ts,retries=0,specPattern=${specs},chromeWebSecurity=false"
2828
if [[ -n "$timeout" ]]; then
2929
override_config="${override_config},defaultCommandTimeout=${timeout}"
3030
fi
@@ -55,5 +55,5 @@ kcli ssh -u root ceph-node-00 'cephadm shell "ceph orch apply node-exporter --pl
5555

5656
kcli ssh -u root ceph-node-00 'cephadm shell "ceph config set mgr mgr/prometheus/exclude_perf_counters false"'
5757

58-
cypress_run ["orchestrator/workflow/*.feature, orchestrator/workflow/*-spec.ts"]
59-
cypress_run "orchestrator/grafana/*.feature"
58+
cypress_run ["cypress/e2e/orchestrator/workflow/*.feature","cypress/e2e/orchestrator/workflow/*-spec.ts"]
59+
cypress_run "cypress/e2e/orchestrator/grafana/*.feature"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { defineConfig } from 'cypress'
2+
3+
export default defineConfig({
4+
video: true,
5+
videoUploadOnPasses: false,
6+
defaultCommandTimeout: 120000,
7+
responseTimeout: 45000,
8+
viewportHeight: 1080,
9+
viewportWidth: 1920,
10+
projectId: 'k7ab29',
11+
reporter: 'cypress-multi-reporters',
12+
reporterOptions: {
13+
reporterEnabled: 'spec, mocha-junit-reporter',
14+
mochaJunitReporterReporterOptions: {
15+
mochaFile: 'cypress/reports/results-[hash].xml',
16+
},
17+
},
18+
retries: 1,
19+
env: {
20+
LOGIN_USER: 'admin',
21+
LOGIN_PWD: 'admin',
22+
CEPH2_URL: 'https://localhost:4202/',
23+
},
24+
chromeWebSecurity: false,
25+
eyesIsDisabled: false,
26+
eyesFailCypressOnDiff: true,
27+
eyesDisableBrowserFetching: false,
28+
eyesLegacyHooks: true,
29+
eyesTestConcurrency: 5,
30+
eyesPort: 35321,
31+
e2e: {
32+
// We've imported your old cypress plugins here.
33+
// You may want to clean this up later by importing these.
34+
setupNodeEvents(on, config) {
35+
return require('./cypress/plugins/index.js')(on, config)
36+
},
37+
baseUrl: 'https://localhost:4200/',
38+
excludeSpecPattern: ['*.po.ts', '**/orchestrator/**'],
39+
experimentalSessionAndOrigin: true,
40+
specPattern: 'cypress/e2e/**/*-spec.{js,jsx,ts,tsx}',
41+
},
42+
})

src/pybind/mgr/dashboard/frontend/cypress.json

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/pybind/mgr/dashboard/frontend/cypress/integration/a11y/dashboard.e2e-spec.ts renamed to src/pybind/mgr/dashboard/frontend/cypress/e2e/a11y/dashboard.e2e-spec.ts

File renamed without changes.

src/pybind/mgr/dashboard/frontend/cypress/integration/a11y/navigation.e2e-spec.ts renamed to src/pybind/mgr/dashboard/frontend/cypress/e2e/a11y/navigation.e2e-spec.ts

File renamed without changes.

src/pybind/mgr/dashboard/frontend/cypress/integration/block/images.e2e-spec.ts renamed to src/pybind/mgr/dashboard/frontend/cypress/e2e/block/images.e2e-spec.ts

File renamed without changes.

src/pybind/mgr/dashboard/frontend/cypress/integration/block/images.po.ts renamed to src/pybind/mgr/dashboard/frontend/cypress/e2e/block/images.po.ts

File renamed without changes.

src/pybind/mgr/dashboard/frontend/cypress/integration/block/iscsi.e2e-spec.ts renamed to src/pybind/mgr/dashboard/frontend/cypress/e2e/block/iscsi.e2e-spec.ts

File renamed without changes.

src/pybind/mgr/dashboard/frontend/cypress/integration/block/iscsi.po.ts renamed to src/pybind/mgr/dashboard/frontend/cypress/e2e/block/iscsi.po.ts

File renamed without changes.

src/pybind/mgr/dashboard/frontend/cypress/integration/block/mirroring.e2e-spec.ts renamed to src/pybind/mgr/dashboard/frontend/cypress/e2e/block/mirroring.e2e-spec.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ describe('Mirroring page', () => {
2929
const poolName = 'rbd-mirror';
3030

3131
beforeEach(() => {
32+
// login to the second ceph cluster
33+
cy.ceph2Login();
3234
cy.login();
3335
Cypress.Cookies.preserveOnce('token');
3436
pools.navigateTo('create');
@@ -44,18 +46,21 @@ describe('Mirroring page', () => {
4446
mirroring.generateToken(poolName);
4547
cy.get('@token').then((bootstrapToken) => {
4648
// pass the token to the origin as an arg
47-
const args = { name: poolName, token: String(bootstrapToken) };
48-
49-
// login to the second ceph cluster
50-
cy.ceph2Login();
51-
49+
const args = { name: poolName, bootstrapToken: String(bootstrapToken) };
5250
// can't use any imports or functions inside the origin
5351
// so writing the code to copy the token inside the origin manually
5452
// rather than using a function call
5553
// @ts-ignore
56-
cy.origin(url, { args }, ({ name, token }: any) => {
54+
cy.origin(url, { args }, ({ name, bootstrapToken }) => {
5755
// Create an rbd pool in the second cluster
56+
57+
// Login to the second cluster
58+
// Somehow its not working with the cypress login function
5859
cy.visit('#/pool/create').wait(100);
60+
61+
cy.get('[name=username]').type('admin');
62+
cy.get('#password').type('admin');
63+
cy.get('[type=submit]').click();
5964
cy.get('input[name=name]').clear().type(name);
6065
cy.get(`select[name=poolType]`).select('replicated');
6166
cy.get(`select[name=poolType] option:checked`).contains('replicated');
@@ -71,7 +76,7 @@ describe('Mirroring page', () => {
7176
cy.get('[aria-label="Import Bootstrap Token"]').click();
7277
cy.get('cd-bootstrap-import-modal').within(() => {
7378
cy.get(`label[for=${name}]`).click();
74-
cy.get('textarea[id=token]').wait(100).type(token);
79+
cy.get('textarea[id=token]').wait(100).type(bootstrapToken);
7580
cy.get('button[type=submit]').click();
7681
});
7782
});

0 commit comments

Comments
 (0)