-
Notifications
You must be signed in to change notification settings - Fork 0
/
Input_Form_Submit.js
59 lines (56 loc) · 1.48 KB
/
Input_Form_Submit.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
import {
firstName,
lastName,
email,
phone,
address,
city,
state,
zipCode,
websiteDomain,
doYouHaveHostingYes,
doYouHaveHostingNo,
projectDescription,
send
} from './myConst'
const x = require('./DateTime')
function mywait() {
cy.wait(100)
}
function Input_Form_Submit(){
cy.contains('Input Forms').click()
mywait()
cy.contains('Input Form Submit').click()
Cypress.on('uncaught:exception', (err, runnable) => {
return false
})
mywait()
cy.request('https://demo.seleniumeasy.com/input-form-demo.html').then((response) => {expect(response.status).to.eq(200)})
mywait()
cy.get(firstName).type('John')
mywait()
cy.get(lastName).type('Walsh')
mywait()
cy.get(email).type('[email protected]')
mywait()
cy.get(phone).type('12679999191')
mywait()
cy.get(address).type('111 Market Street')
mywait()
cy.get(city).type('Philadelphia')
mywait()
cy.get(state).select('Pennsylvania')
mywait()
cy.get(zipCode).type('19106')
mywait()
cy.get(websiteDomain).type('www.test.com')
mywait()
cy.get(doYouHaveHostingYes).click()
mywait()
cy.get(projectDescription).type('Simple Test')
mywait()
cy.get(send).click()
mywait()
cy.writeFile('cypress/integration/testResults.txt', x.myDateTime() + ' '+'Input_Form_Submit passed'+'\n', { flag: 'a+' })
}
module.exports={Input_Form_Submit}