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