-
Notifications
You must be signed in to change notification settings - Fork 168
/
Copy pathhome-page-customization.spec.ts
46 lines (41 loc) · 1.85 KB
/
home-page-customization.spec.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
import { test } from "@playwright/test";
import { UIhelper } from "../utils/ui-helper";
import { Common } from "../utils/common";
import { HomePage } from "../support/pages/home-page";
test.describe("Home page customization", () => {
let common: Common;
let uiHelper: UIhelper;
let homePage: HomePage;
test.beforeEach(async ({ page }) => {
uiHelper = new UIhelper(page);
common = new Common(page);
homePage = new HomePage(page);
await common.loginAsGuest();
});
test("Verify that home page is customized", async () => {
await uiHelper.verifyTextinCard("Quick Access", "Quick Access");
await uiHelper.verifyTextinCard(
"Your Starred Entities",
"Your Starred Entities",
);
await uiHelper.verifyHeading("Placeholder tests");
await uiHelper.verifyDivHasText("Home page customization test 1");
await uiHelper.verifyDivHasText("Home page customization test 2");
await uiHelper.verifyDivHasText("Home page customization test 3");
await uiHelper.verifyHeading("Markdown tests");
await uiHelper.verifyTextinCard("Company links", "Company links");
await uiHelper.verifyHeading("Important company links");
await uiHelper.verifyHeading("RHDH");
await uiHelper.verifyTextinCard("Featured Docs", "Featured Docs");
await uiHelper.verifyTextinCard("Random Joke", "Random Joke");
await uiHelper.clickButton("Reroll");
});
test("Verify that the Top Visited card in the Home page renders without an error", async () => {
await uiHelper.verifyTextinCard("Top Visited", "Top Visited");
await homePage.verifyVisitedCardContent("Top Visited");
});
test("Verify that the Recently Visited card in the Home page renders without an error", async () => {
await uiHelper.verifyTextinCard("Recently Visited", "Recently Visited");
await homePage.verifyVisitedCardContent("Recently Visited");
});
});