-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathcheckReactRemote.cy.ts
78 lines (68 loc) · 2.91 KB
/
checkReactRemote.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
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 React remote', () => {
beforeEach(() => {
basePage.openLocalhost({
number: 3002,
});
});
it('Check the content of the page exist', () => {
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.coreElements.button,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.button,
});
basePage.checkElementContainText({
selector: baseSelectors.ids.app,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.title,
});
basePage.checkElementContainText({
selector: baseSelectors.ids.app,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.text,
});
});
it('Check the language is changed', () => {
basePage.clickElementWithText({
selector: baseSelectors.tags.coreElements.button,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.button,
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.coreElements.button,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.francais.button,
});
basePage.checkElementContainText({
selector: baseSelectors.ids.app,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.francais.title,
});
basePage.checkElementContainText({
selector: baseSelectors.ids.app,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.francais.text,
});
basePage.clickElementWithText({
selector: baseSelectors.tags.coreElements.button,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.francais.button,
});
basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.coreElements.button,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.button,
});
basePage.checkElementContainText({
selector: baseSelectors.ids.app,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.title,
});
basePage.checkElementContainText({
selector: baseSelectors.ids.app,
text: Constants.updatedConstantsData.reactAppsTranslations.remote.english.text,
});
});
});
});