-
Notifications
You must be signed in to change notification settings - Fork 223
Expand file tree
/
Copy pathhome-page-customization.spec.ts
More file actions
65 lines (55 loc) · 2.61 KB
/
Copy pathhome-page-customization.spec.ts
File metadata and controls
65 lines (55 loc) · 2.61 KB
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
import { test } from "@support/coverage/test";
import { HomePage } from "../support/pages/home-page";
import { runAccessibilityTests } from "../utils/accessibility";
import { Common } from "../utils/common";
import { UIhelper } from "../utils/ui-helper";
test.describe("Home page customization", () => {
let common: Common;
let uiHelper: UIhelper;
let homePage: HomePage;
test.beforeAll(() => {
test.info().annotations.push({
type: "component",
description: "core",
});
});
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 ({ page }, testInfo) => {
await uiHelper.verifyTextinCard("Quick Access", "Quick Access");
await runAccessibilityTests(page, testInfo);
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");
});
test("Verify Customized Quick Access", async () => {
// Expanded by default
await homePage.verifyQuickAccess("Developer Tools", "Podman Desktop");
await homePage.verifyQuickAccess("CI/CD Tools", ["ArgoCD", "SonarQube", "Quay.io"]);
await homePage.verifyQuickAccess("OpenShift Clusters", "OpenShift");
// Collapsed by default
await homePage.verifyQuickAccess("Monitoring Tools", "Grafana", true);
await homePage.verifyQuickAccess("Security Tools", ["GitHub Security", "Keycloak"], true);
});
});