-
Notifications
You must be signed in to change notification settings - Fork 0
/
Radio_Buttons_Demo.js
92 lines (89 loc) · 2.37 KB
/
Radio_Buttons_Demo.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import {
radio1,
radio2,
getCheckValue,
getCheckValueResult,
getCheckValueText1,
getCheckValueText2,
getValuesResultText1,
getValuesResultText2,
getValuesResultText3,
getValuesResultText4,
getValuesResultText5,
getValuesResultText6,
sexmaleoption,
sexfemaleoption,
age1option,
age2option,
age3option,
getValues,
getValuesResult
} from './myConst'
const x = require('./DateTime')
function mywait() {
cy.wait(100)
}
function Radio_Buttons_Demo(){
cy.contains('Input Forms').click()
mywait()
cy.contains('Radio Buttons Demo').click()
mywait()
cy.request('https://demo.seleniumeasy.com/basic-radiobutton-demo.html').then((response) => {
expect(response.status).to.eq(200)
})
mywait()
cy.get(radio1).check()
mywait()
cy.get(getCheckValue).click()
mywait()
cy.get(getCheckValueResult).contains(getCheckValueText1)
mywait()
cy.get(radio2).check()
mywait()
cy.get(getCheckValue).click()
mywait()
cy.get(getCheckValueResult).contains(getCheckValueText2)
mywait()
cy.get(sexmaleoption).click()
mywait()
cy.get(age1option).click()
mywait()
cy.get(getValues).click()
mywait()
cy.get(getValuesResult).contains(getValuesResultText1)
mywait()
cy.get(age2option).click()
mywait()
cy.get(getValues).click()
mywait()
cy.get(getValuesResult).contains(getValuesResultText2)
mywait()
cy.get(age3option).click()
mywait()
cy.get(getValues).click()
mywait()
cy.get(getValuesResult).contains(getValuesResultText3)
mywait()
cy.get(sexfemaleoption).click()
mywait()
cy.get(age1option).click()
mywait()
cy.get(getValues).click()
mywait()
cy.get(getValuesResult).contains(getValuesResultText4)
mywait()
cy.get(age2option).click()
mywait()
cy.get(getValues).click()
mywait()
cy.get(getValuesResult).contains(getValuesResultText5)
mywait()
cy.get(age3option).click()
mywait()
cy.get(getValues).click()
mywait()
cy.get(getValuesResult).contains(getValuesResultText6)
mywait()
cy.writeFile('cypress/integration/testResults.txt', x.myDateTime() + ' '+'Radio_Buttons_Demo passed' +'\n', { flag: 'a+' })
}
module.exports={Radio_Buttons_Demo}