]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/global.feature.po.ts
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / cypress / e2e / common / global.feature.po.ts
1 import { And, Given, Then, When } from 'cypress-cucumber-preprocessor/steps';
2
3 import { UrlsCollection } from './urls.po';
4
5 const urlsCollection = new UrlsCollection();
6
7 Given('I am logged in', () => {
8 cy.login();
9 });
10
11 Given('I am on the {string} page', (page: string) => {
12 cy.visit(urlsCollection.pages[page].url);
13 cy.get(urlsCollection.pages[page].id).should('exist');
14 });
15
16 Then('I should be on the {string} page', (page: string) => {
17 cy.get(urlsCollection.pages[page].id).should('exist');
18 });
19
20 And('I should see a button to {string}', (button: string) => {
21 cy.get(`[aria-label="${button}"]`).should('be.visible');
22 });
23
24 When('I click on {string} button', (button: string) => {
25 cy.get(`[aria-label="${button}"]`).first().click();
26 });
27
28 Then('I should see the modal', () => {
29 cy.get('cd-modal').should('exist');
30 });
31
32 Then('I should not see the modal', () => {
33 cy.get('cd-modal').should('not.exist');
34 });
35
36 And('I go to the {string} tab', (names: string) => {
37 for (const name of names.split(', ')) {
38 cy.contains('.nav.nav-tabs a', name).click();
39 }
40 });