Skip to content

Commit b0803fa

Browse files
VladyslavZinchenkoVladyslav Zinchenko
andauthored
Add e2e test for delegate-module and federated-npm (#2739)
* Add e2e test for delegate-module and federated-npm * fix tests after review * removed appNameText and host constants * changed let to const --------- Co-authored-by: Vladyslav Zinchenko <Vladyslav.Zinchenko@universalplant.com>
1 parent d27111a commit b0803fa

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { BaseMethods } from '../../cypress/common/base';
2+
import { baseSelectors } from '../../cypress/common/selectors';
3+
import { Constants } from '../../cypress/fixtures/constants';
4+
5+
const basePage: BaseMethods = new BaseMethods()
6+
7+
const appsData = [
8+
{
9+
appNameText: Constants.commonConstantsData.commonCountAppNames.app1,
10+
host: 3001
11+
},
12+
{
13+
appNameText: Constants.commonConstantsData.commonCountAppNames.app2,
14+
host: 3002
15+
}
16+
]
17+
18+
appsData.forEach(
19+
function(
20+
property: {
21+
appNameText: string,
22+
host: number
23+
}) {
24+
25+
describe(`Check ${property.appNameText}`, () => {
26+
27+
it(`Check header block with text visibility`, () => {
28+
basePage.openLocalhost(property.host)
29+
basePage.checkElementWithTextPresence({
30+
selector: baseSelectors.tags.headers.h1,
31+
text: Constants.commonConstantsData.basicComponents.basicHostRemote,
32+
visibilityState: 'be.visible'
33+
})
34+
basePage.checkElementWithTextPresence({
35+
selector: baseSelectors.tags.headers.h2,
36+
text: `${property.appNameText}`,
37+
visibilityState: 'be.visible'
38+
})
39+
})
40+
41+
it(`Check button text visibility`, () => {
42+
basePage.openLocalhost(property.host)
43+
basePage.checkElementWithTextPresence({
44+
selector: baseSelectors.tags.coreElements.button,
45+
text: Constants.updatedConstantsData.commonAppWithButton.app2,
46+
visibilityState: 'be.visible'
47+
})
48+
})
49+
})
50+
})
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { BaseMethods } from '../../cypress/common/base';
2+
import { baseSelectors } from '../../cypress/common/selectors';
3+
import { Constants } from '../../cypress/fixtures/constants';
4+
5+
const basePage: BaseMethods = new BaseMethods()
6+
7+
const appsData = [
8+
{
9+
appNameText: Constants.commonConstantsData.commonCountAppNames.app1,
10+
host: 3001
11+
},
12+
{
13+
appNameText: Constants.commonConstantsData.commonCountAppNames.app2,
14+
host: 3002
15+
},
16+
{
17+
appNameText: Constants.commonConstantsData.commonCountAppNames.app2,
18+
host: 3003
19+
},
20+
]
21+
22+
appsData.forEach(
23+
function(
24+
property: {
25+
appNameText: string,
26+
host: number
27+
}) {
28+
29+
describe(`Check ${property.appNameText}`, () => {
30+
31+
it(`Check header block with text visibility`, () => {
32+
basePage.openLocalhost(property.host)
33+
basePage.checkElementWithTextPresence({
34+
selector: baseSelectors.tags.headers.h1,
35+
text: Constants.commonConstantsData.basicComponents.basicHostRemote,
36+
visibilityState: 'be.visible'
37+
})
38+
basePage.checkElementWithTextPresence({
39+
selector: baseSelectors.tags.headers.h2,
40+
text: `${property.appNameText}`,
41+
visibilityState: 'be.visible'
42+
})
43+
})
44+
45+
it(`Check button text visibility`, () => {
46+
basePage.openLocalhost(property.host)
47+
basePage.checkElementWithTextPresence({
48+
selector: baseSelectors.tags.coreElements.button,
49+
text: Constants.updatedConstantsData.commonAppWithButton.app2,
50+
visibilityState: 'be.visible'
51+
})
52+
})
53+
})
54+
})

0 commit comments

Comments
 (0)