-
Notifications
You must be signed in to change notification settings - Fork 125
/
secure-messaging-keyboard-nav-save-draft.cypress.spec.js
47 lines (43 loc) · 1.47 KB
/
secure-messaging-keyboard-nav-save-draft.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
import SecureMessagingSite from '../sm_site/SecureMessagingSite';
import PatientInboxPage from '../pages/PatientInboxPage';
import PatientComposePage from '../pages/PatientComposePage';
import requestBody from '../fixtures/message-compose-request-body.json';
import { AXE_CONTEXT } from '../utils/constants';
describe('Check confirmation message after save draft', () => {
const site = new SecureMessagingSite();
const inboxPage = new PatientInboxPage();
const composePage = new PatientComposePage();
it('Check confirmation message after save draft', () => {
site.login();
inboxPage.loadInboxMessages();
inboxPage.navigateToComposePage(true);
composePage.selectRecipient(requestBody.recipientId);
composePage
.getCategory(requestBody.category)
.first()
.click({ force: true });
composePage.getMessageSubjectField().type(`${requestBody.subject}`);
composePage
.getMessageBodyField()
.type(`${requestBody.body}`, { force: true });
composePage.saveDraftByKeyboard();
cy.injectAxe();
cy.axeCheck(AXE_CONTEXT, {
rules: {
'aria-required-children': {
enabled: false,
},
'color-contrast': {
enabled: false,
},
},
});
// next line is for checking if assertion works properly
cy.get('#save-draft-button')
.should('exist')
.and('be.focused');
// cy.get('.last-save-time').should('be.focused');
// cy.reload();
// cy.pause();
});
});