-
Notifications
You must be signed in to change notification settings - Fork 125
/
discharge-wizard.cypress.spec.js
75 lines (60 loc) · 1.74 KB
/
discharge-wizard.cypress.spec.js
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { questionLabels } from '../../constants';
function axeTestPage() {
cy.injectAxe();
cy.axeCheck('main', {
rules: {
'aria-roles': {
enabled: false,
},
},
});
}
describe('functionality of discharge wizard', () => {
it('fill out the form and expect the form to have elements', () => {
// navigate to discharge wizard and make an axe check
// landing page
cy.visit('/discharge-upgrade-instructions/');
axeTestPage();
// questions page | fill out form
cy.get('.main .vads-c-action-link--green').click();
cy.get('va-radio-option[name=1_branchOfService][value="army"]')
.find('label')
.click();
cy.get('select[name="2_dischargeYear"]').select('2016');
cy.get(`va-radio-option[label="${questionLabels['4_reason']['1']}"]`)
.find('label')
.click();
cy.get(
`va-radio-option[label="Yes, ${questionLabels['6_intention']['1']}"]`,
)
.find('label')
.click();
cy.get(
`va-radio-option[label="Yes, ${questionLabels['7_courtMartial'][
'1'
].toLowerCase()}"]`,
)
.find('label')
.click();
cy.get('va-radio-option[name="8_prevApplication"][value="1"]')
.find('label')
.click();
cy.get('va-radio-option[name="9_prevApplicationYear"][value="1"]')
.find('label')
.click();
cy.get(
`va-radio-option[label="Yes, ${questionLabels['12_priorService']['1']}"`,
)
.find('label')
.click();
// a11y check after all elements are visible
axeTestPage();
cy.get('.main .vads-c-action-link--green').click();
// a11y check on results page
axeTestPage();
// open Form download
cy.get('.main .step-1-download')
.first()
.click();
});
});