Skip to content

Commit 692782a

Browse files
committed
test: e2e tests
Signed-off-by: Philippe Martin <[email protected]>
1 parent 13a0f80 commit 692782a

File tree

10 files changed

+315
-4
lines changed

10 files changed

+315
-4
lines changed

.github/workflows/release.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ jobs:
7171
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ steps.TAG_UTIL.outputs.extVersion }}\",#g" packages/extension/package.json
7272
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ steps.TAG_UTIL.outputs.extVersion }}\",#g" packages/rpc/package.json
7373
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ steps.TAG_UTIL.outputs.extVersion }}\",#g" packages/webview/package.json
74+
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ steps.TAG_UTIL.outputs.extVersion }}\",#g" tests/playwright/package.json
7475
sed -i "s#\(ghcr.io/podman-desktop/podman-desktop-extension-kubernetes-dashboard-builder:\)next#\1${{ steps.TAG_UTIL.outputs.extVersion }}#g" build/Containerfile
7576
76-
git add package.json packages/api/package.json packages/channels/package.json packages/extension/package.json packages/rpc/package.json packages/webview/package.json build/Containerfile
77+
git add package.json packages/api/package.json packages/channels/package.json packages/extension/package.json packages/rpc/package.json packages/webview/package.json tests/playwright/package.json build/Containerfile
7778
7879
# commit the changes
7980
git commit -m "chore: 🥁 tagging ${{ steps.TAG_UTIL.outputs.githubTag }} 🥳"
@@ -107,9 +108,10 @@ jobs:
107108
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${bumpedVersion}-next\",#g" packages/extension/package.json
108109
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${bumpedVersion}-next\",#g" packages/rpc/package.json
109110
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${bumpedVersion}-next\",#g" packages/webview/package.json
111+
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${bumpedVersion}-next\",#g" tests/playwright/package.json
110112
# put back next as the version in the Containerfile
111113
sed -i "s|\(ghcr.io/podman-desktop/podman-desktop-extension-kubernetes-dashboard-builder:\)[^ ]*|\1next|" build/Containerfile
112-
git add package.json packages/api/package.json packages/channels/package.json packages/extension/package.json packages/rpc/package.json packages/webview/package.json build/Containerfile
114+
git add package.json packages/api/package.json packages/channels/package.json packages/extension/package.json packages/rpc/package.json packages/webview/package.json tests/playwright/package.json build/Containerfile
113115
114116
git commit -s --amend -m "chore: bump version to ${bumpedVersion}"
115117
git push origin "${bumpedBranchName}"

build/Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ RUN echo "node-linker=hoisted" >> /opt/app-root/extension/.npmrc
5454
RUN eval 'dep_version() { pnpm list -P $1 --json --depth 0 |jq -r ".[0].dependencies.\"$1\".version"; };' && \
5555
ISOMORPHIC_WS_VERSION=$(dep_version "isomorphic-ws") && \
5656
echo adding isomorphic-ws version ${ISOMORPHIC_WS_VERSION} && \
57-
pnpm --dir /opt/app-root/extension add isomorphic-ws@${ISOMORPHIC_WS_VERSION} --prod
57+
pnpm --dir /opt/app-root/extension --workspace-root add isomorphic-ws@${ISOMORPHIC_WS_VERSION} --prod
5858

5959
# Copy the extension to a new image
6060
FROM scratch

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
"test:webview": "vitest run --project webview --passWithNoTests",
2424
"test:channels": "vitest run --project channels --passWithNoTests",
2525
"test": "pnpm run test:extension && pnpm run test:webview && pnpm run test:channels",
26+
"test:e2e": "cd tests/playwright && npm run test:e2e",
27+
"test:e2e:smoke": "cd tests/playwright && npm run test:e2e:smoke",
2628
"typecheck:rpc": "tsc --noEmit --project packages/rpc",
2729
"typecheck:channels": "tsc --noEmit --project packages/channels",
2830
"typecheck:webview": "tsc --noEmit --project packages/webview",

pnpm-lock.yaml

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

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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "kubernetes-dashboard-tests-playwright",
3+
"version": "0.2.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+
"test:e2e:smoke": "npm run test:e2e:setup playwright test src/ --grep @smoke"
9+
},
10+
"publisher": "redhat",
11+
"license": "Apache-2.0",
12+
"devDependencies": {
13+
"@playwright/test": "^1.57.0",
14+
"@podman-desktop/tests-playwright": "^1.23.1",
15+
"@types/node": "^24",
16+
"typescript": "^5.9.3",
17+
"xvfb-maybe": "^0.2.1"
18+
},
19+
"type": "module"
20+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**********************************************************************
2+
* Copyright (C) 2025 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)