Skip to content

Commit 4218b54

Browse files
committed
add playwright
Signed-off-by: Philippe Martin <[email protected]>
1 parent 53ee699 commit 4218b54

File tree

9 files changed

+561
-2
lines changed

9 files changed

+561
-2
lines changed

.github/workflows/e2e-tests.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ jobs:
8989
curl -sL "https://github.com/podman-desktop/podman-desktop/releases/download/v${PD_VERSION}/podman-desktop-${PD_VERSION}.tar.gz" | tar xvz
9090
# Move the extracted folder to the podman-desktop folder
9191
mv podman-desktop-${PD_VERSION}/ podman-desktop/
92+
echo "PODMAN_DESKTOP_BINARY_PATH=$(pwd)/podman-desktop/podman-desktop" >> $GITHUB_ENV
9293
9394
- name: Execute pnpm in extension
9495
working-directory: ./kubernetes-dashboard
@@ -110,3 +111,9 @@ jobs:
110111
working-directory: ./kubernetes-dashboard
111112
run: |
112113
ls -laR tests/extension_sources/
114+
115+
- name: Execute e2e tests
116+
working-directory: ./kubernetes-dashboard/tests/playwright
117+
env:
118+
PODMAN_DESKTOP_BINARY: ${{ env.PODMAN_DESKTOP_BINARY_PATH }}
119+
run: pnpm test:e2e

build/Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ WORKDIR /opt/app-root/extension-source
2121

2222
# copy source code
2323
COPY --chown=1001:root *.ts /opt/app-root/extension-source/
24-
COPY --chown=1001:root pnpm-workspace.yaml /opt/app-root/extension-source/
24+
COPY --chown=1001:root pnpm-workspace-image-build.yaml /opt/app-root/extension-source/pnpm-workspace.yaml
2525
COPY --chown=1001:root pnpm-lock.yaml /opt/app-root/extension-source/
2626
COPY --chown=1001:root .gitignore /opt/app-root/extension-source/
2727
COPY --chown=1001:root package.json /opt/app-root/extension-source/

pnpm-lock.yaml

Lines changed: 107 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace-image-build.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
packages:
2+
- packages/*
3+
4+
onlyBuiltDependencies:
5+
- esbuild
6+
- svelte-preprocess
7+
- unrs-resolver

pnpm-workspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
packages:
22
- packages/*
3+
- 'tests/*'
34

45
onlyBuiltDependencies:
56
- esbuild

tests/playwright/package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "kubernetes-dashboard-tests-playwright",
3+
"version": "0.12.0-next",
4+
"description": "Kubernetes Dashboard extension Playwright E2E tests",
5+
"scripts": {
6+
"test:e2e:setup": "xvfb-maybe --auto-servernum --server-args='-screen 0 1280x960x24' --",
7+
"test:e2e": "npm run test:e2e:setup playwright test src/"
8+
},
9+
"publisher": "redhat",
10+
"license": "Apache-2.0",
11+
"devDependencies": {
12+
"@playwright/test": "^1.51.1",
13+
"@podman-desktop/tests-playwright": "^1.23.1",
14+
"@types/node": "^22",
15+
"typescript": "^5.9.2",
16+
"xvfb-maybe": "^0.2.1"
17+
},
18+
"type": "module"
19+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**********************************************************************
2+
* Copyright (C) 2024 Red Hat, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
* SPDX-License-Identifier: Apache-2.0
17+
***********************************************************************/
18+
19+
import { defineConfig, devices } from '@playwright/test';
20+
21+
export default defineConfig({
22+
outputDir: './output/',
23+
workers: 1,
24+
25+
reporter: [
26+
['list'],
27+
['junit', { outputFile: './output/junit-results.xml' }],
28+
['json', { outputFile: './output/json-results.json' }],
29+
['html', { open: 'never', outputFolder: './output/html-results/' }],
30+
],
31+
32+
projects: [
33+
{
34+
name: 'chromium',
35+
use: {
36+
...devices['Desktop Chrome'],
37+
},
38+
},
39+
],
40+
});

0 commit comments

Comments
 (0)