-
Notifications
You must be signed in to change notification settings - Fork 0
/
contactForm.cy.js
31 lines (26 loc) · 902 Bytes
/
contactForm.cy.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
import ContactFormPageObject from '../support/pages/contactForm.pageObject';
import HomeAndCataloguePageObject
from '../support/pages/homeСatalogue.pageObject';
import faker from 'faker';
/// <reference types='cypress' />
const contactForm = new ContactFormPageObject();
const homePage = new HomeAndCataloguePageObject();
const testData = {
email: faker.internet.email(),
name: faker.name.firstName(),
message: faker.random.words(),
successMessage: 'Thanks for the message!!'
};
describe('Contact', () => {
before(() => {
homePage.visit();
});
it('should provide the ability to send feedback', () => {
homePage.clickOnLink('Contact');
contactForm.typeEmail(testData.email);
contactForm.typeName(testData.name);
contactForm.typeMessage(testData.message);
contactForm.clickOnSendMessageBtn();
contactForm.assertAllert(testData.successMessage);
});
});