Skip to content

Commit e399953

Browse files
authored
chore(e2e): global header tests migration to overlays (#2015)
global header tests migration to overlays
1 parent 6c93690 commit e399953

11 files changed

Lines changed: 2925 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { createEslintConfig } from "@red-hat-developer-hub/e2e-test-utils/eslint";
2+
3+
export default createEslintConfig(import.meta.dirname);
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "global-header-e2e-tests",
3+
"version": "1.0.0",
4+
"private": true,
5+
"type": "module",
6+
"engines": {
7+
"node": ">=22",
8+
"yarn": ">=3"
9+
},
10+
"packageManager": "yarn@3.8.7",
11+
"description": "E2E tests for global-header",
12+
"scripts": {
13+
"test": "playwright test",
14+
"report": "playwright show-report",
15+
"test:ui": "playwright test --ui",
16+
"test:headed": "playwright test --headed",
17+
"lint:check": "eslint .",
18+
"lint:fix": "eslint . --fix",
19+
"prettier:check": "prettier --check .",
20+
"prettier:fix": "prettier --write .",
21+
"tsc:check": "tsc --noEmit",
22+
"check": "yarn tsc:check && yarn lint:check && yarn prettier:check"
23+
},
24+
"devDependencies": {
25+
"@eslint/js": "^9.39.2",
26+
"@playwright/test": "1.57.0",
27+
"@red-hat-developer-hub/e2e-test-utils": "1.1.14",
28+
"@types/node": "^24.10.1",
29+
"dotenv": "^16.4.7",
30+
"eslint": "^9.39.2",
31+
"eslint-plugin-check-file": "^3.3.1",
32+
"eslint-plugin-playwright": "^2.4.0",
33+
"prettier": "^3.7.4",
34+
"typescript": "^5.9.3",
35+
"typescript-eslint": "^8.50.0"
36+
}
37+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { defineConfig } from "@red-hat-developer-hub/e2e-test-utils/playwright-config";
2+
import dotenv from "dotenv";
3+
4+
dotenv.config({ path: `${import.meta.dirname}/.env` });
5+
6+
export default defineConfig({
7+
projects: [
8+
{
9+
name: "global-header-default",
10+
testMatch: "**/tests/specs/default-global-header.spec.ts",
11+
},
12+
{
13+
name: "global-header-header-mount-points",
14+
testMatch: "**/tests/specs/header-mount-points.spec.ts",
15+
},
16+
],
17+
});
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
app:
2+
support:
3+
url: https://github.com/redhat-developer/rhdh/issues
4+
items:
5+
- title: Red Hat Developer Hub
6+
links:
7+
- url: https://access.redhat.com/products/red-hat-developer-hub
8+
title: Product Information
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
plugins:
2+
- package: ./dynamic-plugins/dist/backstage-community-plugin-catalog-backend-module-keycloak-dynamic
3+
disabled: false
4+
- package: ./dynamic-plugins/dist/backstage-plugin-notifications
5+
disabled: false
6+
- package: ./dynamic-plugins/dist/backstage-plugin-notifications-backend-dynamic
7+
disabled: false
8+
- package: ./dynamic-plugins/dist/backstage-plugin-signals-backend-dynamic
9+
disabled: false
10+
- package: ./dynamic-plugins/dist/backstage-plugin-signals
11+
disabled: false
12+
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-global-header
13+
pluginConfig:
14+
app:
15+
sidebar:
16+
search: false
17+
settings: false
18+
logo: false
19+
dynamicPlugins:
20+
frontend:
21+
default.main-menu-items:
22+
menuItems:
23+
default.create:
24+
title: ""
25+
default.admin:
26+
title: Administration
27+
textKey: menuItem.administration
28+
icon: admin
29+
red-hat-developer-hub.backstage-plugin-global-header:
30+
translationResources:
31+
- importName: globalHeaderTranslations
32+
ref: globalHeaderTranslationRef
33+
mountPoints:
34+
- mountPoint: application/header
35+
importName: GlobalHeader
36+
config:
37+
position: above-sidebar
38+
- mountPoint: global.header/component
39+
importName: CompanyLogo
40+
config:
41+
priority: 200
42+
props:
43+
logo:
44+
dark: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22160pt%22%20height%3D%2280pt%22%20viewBox%3D%220%200%20160%2080%22%3E%3Cg%20fill%3D%22%23fff%22%20style%3D%22text-align%3Astart%3Btext-align-last%3Aauto%22%20letter-spacing%3D%220%22%3E%3Ctext%20font-family%3D%22Red%20Hat%20Display%22%20font-size%3D%2240%22%20font-weight%3D%22700%22%20transform%3D%22translate(-.177%2054.263)%22%20word-spacing%3D%220%22%3E%3Ctspan%20x%3D%220%22%3EQE%3C%2Ftspan%3E%3C%2Ftext%3E%3Ctext%20font-family%3D%22Red%20Hat%20Text%22%20font-size%3D%2214%22%20font-weight%3D%22700%22%20transform%3D%22translate(57.565%2035.73)%22%20word-spacing%3D%220%22%3E%3Ctspan%20x%3D%220%22%3ERed%20Hat%3C%2Ftspan%3E%3Ctspan%20x%3D%220%22%20dy%3D%2218.516%22%3EDeveloper%20Hub%3C%2Ftspan%3E%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fsvg%3E"
45+
width: 160
46+
height: 80
47+
to: "/"
48+
- mountPoint: global.header/component
49+
importName: HeaderIconButton
50+
config:
51+
priority: 110
52+
props:
53+
title: test-logo
54+
icon: <svg id="logo" width="20" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 10 192 145"><defs><style>.cls-1{fill:#e00;}</style></defs><path d="M157.77,62.61a14,14,0,0,1,.31,3.42c0,14.88-18.1,17.46-30.61,17.46C78.83,83.49,42.53,53.26,42.53,44a6.43,6.43,0,0,1,.22-1.94l-3.66,9.06a18.45,18.45,0,0,0-1.51,7.33c0,18.11,41,45.48,87.74,45.48,20.69,0,36.43-7.76,36.43-21.77,0-1.08,0-1.94-1.73-10.13Z"/><path class="cls-1" d="M127.47,83.49c12.51,0,30.61-2.58,30.61-17.46a14,14,0,0,0-.31-3.42l-7.45-32.36c-1.72-7.12-3.23-10.35-15.73-16.6C124.89,8.69,103.76.5,97.51.5,91.69.5,90,8,83.06,8c-6.68,0-11.64-5.6-17.89-5.6-6,0-9.91,4.09-12.93,12.5,0,0-8.41,23.72-9.49,27.16A6.43,6.43,0,0,0,42.53,44c0,9.22,36.3,39.45,84.94,39.45M160,72.07c1.73,8.19,1.73,9.05,1.73,10.13,0,14-15.74,21.77-36.43,21.77C78.54,104,37.58,76.6,37.58,58.49a18.45,18.45,0,0,1,1.51-7.33C22.27,52,.5,55,.5,74.22c0,31.48,74.59,70.28,133.65,70.28,45.28,0,56.7-20.48,56.7-36.65,0-12.72-11-27.16-30.83-35.78"/></svg>
55+
to: /
56+
- mountPoint: global.header/component
57+
importName: SearchComponent
58+
config:
59+
priority: 100
60+
- mountPoint: global.header/component
61+
importName: Spacer
62+
config:
63+
priority: 99
64+
props:
65+
growFactor: 0
66+
- mountPoint: global.header/component
67+
importName: HeaderIconButton
68+
config:
69+
priority: 90
70+
props:
71+
title: Self-service
72+
icon: add
73+
to: create
74+
- mountPoint: global.header/component
75+
importName: HelpDropdown
76+
config:
77+
priority: 80
78+
- mountPoint: global.header/help
79+
importName: SupportButton
80+
config:
81+
priority: 10
82+
- mountPoint: global.header/component
83+
importName: NotificationButton
84+
config:
85+
priority: 70
86+
- mountPoint: global.header/component
87+
importName: Divider
88+
config:
89+
priority: 50
90+
- mountPoint: global.header/component
91+
importName: ProfileDropdown
92+
config:
93+
priority: 10
94+
- mountPoint: global.header/profile
95+
importName: MenuItemLink
96+
config:
97+
priority: 100
98+
props:
99+
title: Settings
100+
link: /settings
101+
icon: manageAccounts
102+
- mountPoint: global.header/profile
103+
importName: MenuItemLink
104+
config:
105+
priority: 90
106+
props:
107+
title: My profile
108+
type: myProfile
109+
icon: account
110+
- mountPoint: global.header/profile
111+
importName: LogoutButton
112+
config:
113+
priority: 10
114+
- package: "@red-hat-developer-hub/backstage-plugin-global-header-test@0.0.2"
115+
integrity: "sha512-Dlay4DUAC3SifSJx4dmKDeD07DITGX9ZZ2SMCgcMMc00GJVKToD3DFuPYZ7lV2C2Ve7gWDufCf5NUmqaUWf6GA=="
116+
pluginConfig:
117+
dynamicPlugins:
118+
frontend:
119+
red-hat-developer-hub.backstage-plugin-global-header-test:
120+
mountPoints:
121+
- mountPoint: application/header
122+
importName: TestHeader
123+
config:
124+
position: above-main-content
125+
- mountPoint: global.header/component
126+
importName: TestButton
127+
config:
128+
priority: 95
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Mirrors PR #2050 notifications e2e: static external token for /api/notifications (Helm-injected appConfig).
2+
# https://github.com/redhat-developer/rhdh-plugin-export-overlays/pull/2050
3+
upstream:
4+
backstage:
5+
appConfig:
6+
backend:
7+
auth:
8+
externalAccess:
9+
- type: static
10+
options:
11+
token: test-token
12+
subject: test-subject

0 commit comments

Comments
 (0)