-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathcheckReactHost.cy.ts
189 lines (162 loc) · 7.18 KB
/
checkReactHost.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
import { BaseMethods } from '../../cypress-e2e/common/base';
import { baseSelectors } from '../../cypress-e2e/common/selectors';
import { Constants } from '../../cypress-e2e/fixtures/constants';
const basePage: BaseMethods = new BaseMethods();
describe('i18next Nextjs React', () => {
// TODO cy.exec don't build the apps correctly cause lerna executes without exit code. Uncomment after fix this issue!
// before(() => {
// basePage.buildTheSample(Constants.samplesPath.i18nextNextjsReact)
// })
// after(() => {
// basePage.shutdownTheSample(Constants.samplesPath.i18nextNextjsReact)
// })
context('Check Next host', () => {
beforeEach(() => {
basePage.openLocalhost({
number: 3001,
});
});
it('Check the content exist on React host', () => {
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.english.button,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.english.text,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.english.title,
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.button,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.title,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.text,
});
});
it('Check the language is changed from Next section', () => {
basePage.clickElementWithText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.english.button,
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.francais.button,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.francais.text,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.francais.title,
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.francais.button,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.francais.title,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.francais.text,
});
basePage.clickElementWithText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.francais.button,
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.english.button,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.english.text,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.english.title,
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.button,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.title,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.text,
});
});
it('Check the language is changed from remote child section', () => {
basePage.clickElementWithText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.button,
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.francais.button,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.francais.text,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.francais.title,
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.francais.button,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.francais.title,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.francais.text,
});
basePage.clickElementWithText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.francais.button,
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.english.button,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.english.text,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.host.english.title,
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.button,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.title,
});
basePage.checkElementContainText({
selector: baseSelectors.tags.section,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.text,
});
});
});
});