-
Notifications
You must be signed in to change notification settings - Fork 10
/
CheckInvalidEmailRecipient.spec.ts
49 lines (40 loc) · 1.9 KB
/
CheckInvalidEmailRecipient.spec.ts
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
import { SplashScreen, SetupKeyScreen, MailFolderScreen, NewMessageScreen } from '../../../screenobjects/all-screens';
import { CommonData } from '../../../data';
import BaseScreen from '../../../screenobjects/base.screen';
import { MockApi } from 'api-mocks/mock';
import { MockApiConfig } from 'api-mocks/mock-config';
import { MockUserList } from 'api-mocks/mock-data';
describe('COMPOSE EMAIL: ', () => {
it('user should enter correct email address into recipients', async () => {
const invalidRecipient = 'abc';
const recipient = MockUserList.dmitry;
const subject = CommonData.simpleEmail.subject;
const message = CommonData.simpleEmail.message;
const mockApi = new MockApi();
mockApi.fesConfig = MockApiConfig.defaultEnterpriseFesConfiguration;
mockApi.ekmConfig = MockApiConfig.defaultEnterpriseEkmConfiguration;
mockApi.attesterConfig = {
servedPubkeys: {
[recipient.email]: recipient.pub!,
},
};
const invalidRecipientError = CommonData.errors.invalidRecipient;
await mockApi.withMockedApis(async () => {
await SplashScreen.mockLogin();
await SetupKeyScreen.setPassPhrase();
await MailFolderScreen.checkInboxScreen();
await MailFolderScreen.clickCreateEmail();
await NewMessageScreen.setAddRecipient(invalidRecipient);
await BaseScreen.checkModalMessage(invalidRecipientError);
await BaseScreen.clickOkButtonOnError();
await NewMessageScreen.deleteEnteredRecipient(invalidRecipient);
await NewMessageScreen.composeEmail(recipient.email, subject, message);
await NewMessageScreen.setAddRecipient(invalidRecipient);
await BaseScreen.checkModalMessage(invalidRecipientError);
await BaseScreen.clickOkButtonOnError();
await NewMessageScreen.clickSendButton();
await BaseScreen.checkModalMessage(invalidRecipientError);
await BaseScreen.clickOkButtonOnError();
});
});
});