-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathVariablesAction.ts
More file actions
41 lines (31 loc) · 1.13 KB
/
VariablesAction.ts
File metadata and controls
41 lines (31 loc) · 1.13 KB
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
41
import VariablesRepository from 'cypress/support/repositories/variables/VariablesRepository';
const environment = new VariablesRepository();
export default class VariablesAction {
doEnvNavigation() {
environment.getVariablesLink().click();
}
doHideShowToggle() {
environment.getToggleShowButton().click();
}
doValueToggle() {
environment.getEnvDataRows().getBySel('showhide-toggle').click({ multiple: true, force: true });
}
doAddVariable(name: string, value: string, permission: string = '') {
environment.getAddButton().first().click();
if (permission === '') {
cy.get('.react-select__indicator').click({ force: true });
cy.get('#react-select-2-option-1').click();
cy.getBySel('varName').focus().type(name);
cy.getBySel('varValue').focus().type(value);
cy.getBySel('add-variable').click();
}
}
doDeleteVariable(name: string) {
environment.getDeleteBtn(name);
cy.waitForNetworkIdle('@idle', 500);
environment.getDeleteBtn(name);
cy.log('enter the name and confirm');
cy.getBySel('variable-input').type(name);
cy.getBySel('delete-button').click();
}
}