-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathcheckLoadableReact16Apps.cy.ts
119 lines (114 loc) · 4.35 KB
/
checkLoadableReact16Apps.cy.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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import { Constants } from '../../cypress-e2e/fixtures/constants';
import { baseSelectors, selectors } from '../../cypress-e2e/common/selectors';
import { BaseMethods } from '../../cypress-e2e/common/base';
const basePage: BaseMethods = new BaseMethods();
describe('Loadable React 16', () => {
context('Check App1', () => {
beforeEach(() => {
basePage.openLocalhost({
number: 3000,
});
});
it('Check App headers and buttons visability', () => {
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.headers.h1,
text: Constants.elementsText.reactApps.header,
visibilityState: 'be.visible',
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.headers.h2,
text: Constants.elementsText.reactApps.app1.subHeader,
visibilityState: 'be.visible',
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.headers.h3,
text: Constants.elementsText.reactApps.header3,
visibilityState: 'be.visible',
});
basePage.checkElementVisibility({
selector: baseSelectors.tags.inputs.input,
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.coreElements.button,
text: Constants.elementsText.reactApps.regularButton,
visibilityState: 'be.visible',
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.coreElements.button,
text: Constants.elementsText.reactApps.loadableButton,
visibilityState: 'be.visible',
});
});
it('Check that App 2 Content Block with filled text appear', () => {
basePage.fillField({
selector: baseSelectors.tags.inputs.input,
text: Constants.commonConstantsData.standardPhrase,
});
basePage.checkElementWithTextPresence({
selector: `${selectors.reactApp.app2ContentBlock} ${baseSelectors.tags.headers.h2}`,
text: Constants.elementsText.reactApps.splitedApp.header,
visibilityState: 'be.visible',
});
basePage.checkElementWithTextPresence({
selector: `${selectors.reactApp.app2ContentBlock} ${baseSelectors.tags.paragraph}`,
text: Constants.elementsText.reactApps.splitedApp.subHeader,
visibilityState: 'be.visible',
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.strong,
text: Constants.commonConstantsData.standardPhrase,
visibilityState: 'be.visible',
});
});
});
});
describe('Loadable React 16', () => {
context('Check App2', () => {
beforeEach(() => {
basePage.openLocalhost({
number: 3001,
});
});
it('Check App elements visability', () => {
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.headers.h1,
text: Constants.elementsText.reactApps.header,
visibilityState: 'be.visible',
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.headers.h2,
text: Constants.elementsText.reactApps.app2.subHeader,
visibilityState: 'be.visible',
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.headers.h3,
text: Constants.elementsText.reactApps.header3,
visibilityState: 'be.visible',
});
basePage.checkElementVisibility({
selector: baseSelectors.tags.inputs.input,
});
});
it('Check that App 2 Content Block with filled text appear', () => {
basePage.fillField({
selector: baseSelectors.tags.inputs.input,
text: Constants.commonConstantsData.standardPhrase,
});
basePage.checkElementWithTextPresence({
selector: `${selectors.reactApp.app2ContentBlock} ${baseSelectors.tags.headers.h2}`,
text: Constants.elementsText.reactApps.splitedApp.header,
visibilityState: 'be.visible',
});
basePage.checkElementWithTextPresence({
selector: `${selectors.reactApp.app2ContentBlock} ${baseSelectors.tags.paragraph}`,
text: Constants.elementsText.reactApps.splitedApp.subHeader,
visibilityState: 'be.visible',
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.strong,
text: Constants.commonConstantsData.standardPhrase,
visibilityState: 'be.visible',
});
});
});
});