Skip to content

Commit e0905e5

Browse files
authored
chore(github-actions): migrate e2e tests to overlays (#1991)
Signed-off-by: Jan Richter <jrichter@redhat.com>
1 parent df70e6c commit e0905e5

8 files changed

Lines changed: 2588 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": "github-actions-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 <your-plugin>",
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.13",
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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
process.env.SKIP_KEYCLOAK_DEPLOYMENT = "true";
6+
7+
export default defineConfig({
8+
projects: [
9+
{
10+
name: "github-actions",
11+
},
12+
],
13+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
catalog:
2+
import:
3+
entityFilename: catalog-info.yaml
4+
pullRequestBranchName: backstage-integration
5+
rules:
6+
- allow: [API, Component, Group, Location, Resource, System, Template]
7+
locations:
8+
- type: url
9+
target: https://github.com/redhat-developer/rhdh/blob/main/catalog-entities/all.yaml
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { test } from "@red-hat-developer-hub/e2e-test-utils/test";
2+
import {
3+
APIHelper,
4+
GITHUB_API_ENDPOINTS,
5+
} from "@red-hat-developer-hub/e2e-test-utils/helpers";
6+
7+
test.describe("Test github-actions", () => {
8+
test.beforeAll(async ({ rhdh }) => {
9+
await rhdh.configure({ auth: "github" });
10+
await rhdh.deploy();
11+
});
12+
13+
test("Verify that the CI tab renders 5 most recent github actions", async ({
14+
page,
15+
loginHelper,
16+
uiHelper,
17+
}) => {
18+
const component = "Red Hat Developer Hub";
19+
await loginHelper.loginAsGithubUser();
20+
21+
await uiHelper.openSidebar("Catalog");
22+
await uiHelper.selectMuiBox("Kind", "Component");
23+
await uiHelper.searchInputPlaceholder(component);
24+
await uiHelper.clickLink(component);
25+
26+
await page.locator("a").getByText("CI", { exact: true }).first().click();
27+
await page.getByRole("button", { name: "Log in" }).click();
28+
29+
const response = await APIHelper.githubRequest(
30+
"GET",
31+
GITHUB_API_ENDPOINTS.workflowRuns,
32+
);
33+
const json = await response.json();
34+
const workflowRuns = json.workflow_runs;
35+
36+
for (const workflowRun of workflowRuns.slice(0, 5)) {
37+
await uiHelper.verifyText(workflowRun.id);
38+
}
39+
});
40+
});
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "@red-hat-developer-hub/e2e-test-utils/tsconfig",
3+
"include": ["**/*.ts"]
4+
}

0 commit comments

Comments
 (0)