Skip to content

Commit bcdf28e

Browse files
author
Pedro Abreu
committed
upgrade playwright to 1.55
Resolves: MTV-3470 Signed-off-by: Pedro Abreu <[email protected]>
1 parent f1ce102 commit bcdf28e

File tree

4 files changed

+118
-17
lines changed

4 files changed

+118
-17
lines changed

testing/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"license": "ISC",
1515
"description": "",
1616
"devDependencies": {
17-
"playwright": "1.54.2",
18-
"@playwright/test": "1.54.2",
17+
"playwright": "1.55.0",
18+
"@playwright/test": "1.55.0",
1919
"@types/node": "^20.0.0",
2020
"typescript": "^5.8.2"
2121
},

testing/playwright.config.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,23 @@ export default defineConfig({
66
globalSetup: './playwright/global.setup.ts',
77
globalTeardown: './playwright/global.teardown.ts',
88
testDir: './playwright/e2e',
9-
timeout: process.env.JENKINS ? 120_000 : 60_000,
9+
timeout: process.env.JENKINS ? 15 * 60_000 : 60_000,
1010
fullyParallel: true,
11+
workers: 3,
1112

1213
retries: process.env.GITHUB_ACTIONS ? 3 : 0,
1314

15+
reporter: [['list'], ['html', { open: 'never' }]],
16+
17+
use: {
18+
actionTimeout: 20_000,
19+
navigationTimeout: 20_000,
20+
},
21+
22+
expect: {
23+
timeout: 20_000,
24+
},
25+
1426
projects: [
1527
{
1628
name: 'chromium',
@@ -24,6 +36,7 @@ export default defineConfig({
2436
viewport: { width: 1920, height: 1080 },
2537
screenshot: 'only-on-failure',
2638
video: 'retain-on-failure',
39+
trace: 'retain-on-failure',
2740
// Use data-testid to match actual rendered HTML
2841
testIdAttribute: 'data-testid',
2942
ignoreHTTPSErrors: true,

testing/run-tests.sh

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# ==============================================================================
5+
# Script for running Playwright tests in a containerized environment.
6+
#
7+
# This script uses pre-copied test files from the local repository and
8+
# executes Playwright tests based on environment variables.
9+
#
10+
# Required Environment Variables:
11+
# - CLUSTER_NAME: Name of the OpenShift cluster to target.
12+
# - VSPHERE_PROVIDER: vSphere provider to use for testing.
13+
# - TEST_ARGS: (Optional) Arbitrary arguments for the playwright command.
14+
# - CLUSTER_PASSWORD: The password for the OCP cluster.
15+
# - PROVIDERS_JSON: The content of the .providers.json file.
16+
#
17+
# Mounted Volumes:
18+
# - /results: Directory to store test artifacts (reports, results).
19+
#
20+
# ==============================================================================
21+
22+
# --- Configuration and Defaults ---
23+
# Use /results if WORKSPACE is not set (for container environment)
24+
RESULTS_DIR="${WORKSPACE:-/results}"
25+
TEST_ARGS=${TEST_ARGS:-"--grep=@downstream"}
26+
27+
log() {
28+
echo "--- $1 ---"
29+
}
30+
31+
log "Container Image Information"
32+
echo " Version: ${IMAGE_VERSION:-unknown}"
33+
echo " Git Commit: ${IMAGE_GIT_COMMIT:-unknown}"
34+
echo " Build Date: ${IMAGE_BUILD_DATE:-unknown}"
35+
echo ""
36+
37+
cd /test-runner
38+
39+
log "Validating environment and setting up credentials..."
40+
41+
if [ -z "$CLUSTER_NAME" ]; then
42+
echo "ERROR: CLUSTER_NAME environment variable is not set."
43+
exit 1
44+
fi
45+
46+
if [ -z "$PROVIDERS_JSON" ]; then
47+
echo "ERROR: PROVIDERS_JSON environment variable is not set."
48+
exit 1
49+
fi
50+
51+
if [ -z "$CLUSTER_PASSWORD" ]; then
52+
echo "ERROR: CLUSTER_PASSWORD environment variable is not set."
53+
exit 1
54+
fi
55+
56+
log "Validation complete. Using pre-copied test files from /test-runner"
57+
58+
log "Creating .providers.json from environment variable..."
59+
echo "$PROVIDERS_JSON" > .providers.json
60+
61+
export BASE_ADDRESS="https://console-openshift-console.apps.${CLUSTER_NAME}.rhos-psi.cnv-qe.rhood.us"
62+
export CI=true
63+
export JENKINS=true
64+
export NODE_TLS_REJECT_UNAUTHORIZED=0
65+
export CLUSTER_USERNAME="kubeadmin"
66+
export CLUSTER_PASSWORD=${CLUSTER_PASSWORD}
67+
export VSPHERE_PROVIDER=${VSPHERE_PROVIDER}
68+
69+
log "Running Playwright tests..."
70+
echo " Cluster: ${CLUSTER_NAME}"
71+
echo " Base Address: ${BASE_ADDRESS}"
72+
echo " Playwright Args: ${TEST_ARGS}"
73+
74+
75+
set +e
76+
echo "Starting Playwright test execution..."
77+
yarn playwright test \
78+
${TEST_ARGS}
79+
TEST_EXIT_CODE=$?
80+
set -e
81+
82+
log "Tests finished with exit code: $TEST_EXIT_CODE"
83+
84+
mkdir -p "${RESULTS_DIR}"
85+
[ -d "playwright-report" ] && cp -r "playwright-report" "${RESULTS_DIR}/"
86+
[ -d "test-results" ] && cp -r "test-results" "${RESULTS_DIR}/"
87+
88+
exit $TEST_EXIT_CODE

testing/yarn.lock

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# yarn lockfile v1
33

44

5-
"@playwright/test@1.54.2":
6-
version "1.54.2"
7-
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.54.2.tgz#ff0d1e5d8e26f3258ae65364e2d4d10176926b07"
8-
integrity sha512-A+znathYxPf+72riFd1r1ovOLqsIIB0jKIoPjyK2kqEIe30/6jF6BC7QNluHuwUmsD2tv1XZVugN8GqfTMOxsA==
5+
"@playwright/test@1.55.0":
6+
version "1.55.0"
7+
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.55.0.tgz#080fa6d9ee6d749ff523b1c18259572d0268b963"
8+
integrity sha512-04IXzPwHrW69XusN/SIdDdKZBzMfOT9UNT/YiJit/xpy2VuAoB8NHc8Aplb96zsWDddLnbkPL3TsmrS04ZU2xQ==
99
dependencies:
10-
playwright "1.54.2"
10+
playwright "1.55.0"
1111

1212
"@types/node@^20.0.0":
1313
version "20.19.9"
@@ -21,17 +21,17 @@ [email protected]:
2121
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
2222
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
2323

24-
playwright-core@1.54.2:
25-
version "1.54.2"
26-
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.54.2.tgz#73cc5106f19ec6b9371908603d61a7f171ebd8f0"
27-
integrity sha512-n5r4HFbMmWsB4twG7tJLDN9gmBUeSPcsBZiWSE4DnYz9mJMAFqr2ID7+eGC9kpEnxExJ1epttwR59LEWCk8mtA==
24+
playwright-core@1.55.0:
25+
version "1.55.0"
26+
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.55.0.tgz#ec8a9f8ef118afb3e86e0f46f1393e3bea32adf4"
27+
integrity sha512-GvZs4vU3U5ro2nZpeiwyb0zuFaqb9sUiAJuyrWpcGouD8y9/HLgGbNRjIph7zU9D3hnPaisMl9zG9CgFi/biIg==
2828

29-
playwright@1.54.2:
30-
version "1.54.2"
31-
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.54.2.tgz#e2435abb2db3a96a276f8acc3ada1a85b587dff3"
32-
integrity sha512-Hu/BMoA1NAdRUuulyvQC0pEqZ4vQbGfn8f7wPXcnqQmM+zct9UliKxsIkLNmz/ku7LElUNqmaiv1TG/aL5ACsw==
29+
playwright@1.55.0:
30+
version "1.55.0"
31+
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.55.0.tgz#7aca7ac3ffd9e083a8ad8b2514d6f9ba401cc78b"
32+
integrity sha512-sdCWStblvV1YU909Xqx0DhOjPZE4/5lJsIS84IfN9dAZfcl/CIZ5O8l3o0j7hPMjDvqoTF8ZUcc+i/GL5erstA==
3333
dependencies:
34-
playwright-core "1.54.2"
34+
playwright-core "1.55.0"
3535
optionalDependencies:
3636
fsevents "2.3.2"
3737

0 commit comments

Comments
 (0)