feat(e2e): Migrate P2P Preheat and Distribution tests (P2P_Preheat.robot) to Playwright#22631
feat(e2e): Migrate P2P Preheat and Distribution tests (P2P_Preheat.robot) to Playwright#22631amaydixit11 wants to merge 14 commits intogoharbor:mainfrom
Conversation
…or#22617) - Fix broken placeholder syntax in 'SCAN_BY' value - Update various UI strings for better readability - Translate previously untranslated keys (MANDATORY, OVERRIDE, etc.) Signed-off-by: g-yunjh <yunjh1126@naver.com> Signed-off-by: Amay Dixit <amaydixit11@gmail.com>
Signed-off-by: stonezdj <stone.zhang@broadcom.com> Signed-off-by: Amay Dixit <amaydixit11@gmail.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Amay Dixit <amaydixit11@gmail.com>
Signed-off-by: Amay Dixit <amaydixit11@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com> Signed-off-by: Amay Dixit <amaydixit11@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com> Signed-off-by: Amay Dixit <amaydixit11@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com> Signed-off-by: Amay Dixit <amaydixit11@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com> fix: playwright github action Signed-off-by: bupd <bupdprasanth@gmail.com> fix: playwright github action Signed-off-by: bupd <bupdprasanth@gmail.com> fix: rename login logout test Signed-off-by: bupd <bupdprasanth@gmail.com> fix: playwright testing Signed-off-by: bupd <bupdprasanth@gmail.com> feat: correct test Signed-off-by: bupd <bupdprasanth@gmail.com> Signed-off-by: Amay Dixit <amaydixit11@gmail.com>
…heat policies. Signed-off-by: Amay Dixit <amaydixit11@gmail.com>
Signed-off-by: Amay Dixit <amaydixit11@gmail.com>
Signed-off-by: Amay Dixit <amaydixit11@gmail.com>
Signed-off-by: Amay Dixit <amaydixit11@gmail.com>
99a8189 to
d917463
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22631 +/- ##
==========================================
+ Coverage 45.36% 46.53% +1.16%
==========================================
Files 244 252 +8
Lines 13333 14273 +940
Branches 2719 2931 +212
==========================================
+ Hits 6049 6642 +593
- Misses 6983 7273 +290
- Partials 301 358 +57
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
| * Executes a shell command and returns the output. | ||
| */ | ||
| function runCommand(command: string): string { | ||
| console.log(`\n$ ${command}`); |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High test
| console.log('✅ Command output:\n', output.trim()); | ||
| return output.trim(); | ||
| } catch (error: any) { | ||
| console.error(`❌ Command failed: ${command}`); |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High test
Signed-off-by: Amay Dixit <amaydixit11@gmail.com>
Signed-off-by: Amay Dixit <amaydixit11@gmail.com>
|
@bupd kindly review this PR and let me know if there's something missing or is something needs to be changed |
|
This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days. |
|
please /label |
There was a problem hiding this comment.
Pull request overview
Migrates part of the legacy Robot P2P preheat coverage into Playwright under src/portal, and wires a new GitHub Actions workflow to run the browser-based E2E suite against a Harbor instance started in CI.
Changes:
- Added Playwright configuration, dependencies, and new E2E specs for login/logout and P2P preheat/distribution flows.
- Added a dedicated
playwright.ymlworkflow to install Harbor, install Playwright browsers, and execute the new tests. - Updated a few CI workflow artifact/upload paths and translated remaining Korean UI strings that were still in English.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
src/portal/src/i18n/lang/ko-kr-lang.json |
Fills in missing Korean translations for several UI strings. |
src/portal/playwright.config.ts |
Adds Playwright runner configuration for the portal E2E suite. |
src/portal/package.json |
Adds @playwright/test as a dev dependency. |
src/portal/package-lock.json |
Locks Playwright packages and transitive dependencies. |
src/portal/e2e/p2p-preheat.spec.ts |
Implements Playwright coverage for distribution CRUD and P2P preheat flows. |
src/portal/e2e/login-logout.spec.ts |
Adds a basic Playwright login/logout smoke test. |
src/portal/.gitignore |
Ignores Playwright outputs under src/portal. |
.github/workflows/playwright.yml |
Adds a new PR workflow to stand up Harbor and run Playwright tests. |
.github/workflows/CI.yml |
Adjusts artifact upload behavior and some checkout/upload paths in existing CI jobs. |
Files not reviewed (1)
- src/portal/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: before_install | ||
| run: | | ||
| set -x | ||
| cd src/github.com/goharbor/harbor | ||
| curl -L https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose | ||
| chmod +x docker-compose | ||
| sudo mv docker-compose /usr/local/bin | ||
| - name: Start Harbor for E2E | ||
| run: | | ||
| cd src/github.com/goharbor/harbor | ||
| docker system prune -a -f | ||
| bash ./tests/showtime.sh ./tests/ci/api_common_install.sh $IP DB | ||
| - name: Install Playwright dependencies | ||
| run: | | ||
| cd src/github.com/goharbor/harbor/src/portal | ||
| npm ci | ||
| npx playwright install --with-deps |
| test('login and logout', async ({ page }) => { | ||
| // login | ||
| await page.goto('/'); | ||
| await page.getByRole('textbox', { name: 'Username' }).click(); | ||
| await page.getByRole('textbox', { name: 'Username' }).fill('admin'); | ||
| await page.getByRole('textbox', { name: 'Password' }).click(); | ||
| await page.getByRole('textbox', { name: 'Password' }).fill('Harbor12345'); |
| const LOCAL_REGISTRY_NAMESPACE: string = process.env.LOCAL_REGISTRY_NAMESPACE || 'harbor-ci'; | ||
| const ip: string = process.env.IP || 'localhost'; | ||
| const user: string = process.env.HARBOR_ADMIN || 'admin'; | ||
| const pwd: string = process.env.HARBOR_PASSWORD || 'Harbor12345'; |
| runCommand(`docker pull ${sourceImage}`); | ||
| runCommand(`docker login -u ${user} -p ${pwd} ${ip}`); | ||
| runCommand(`docker tag ${sourceImage} ${targetImage}`); |
| with: | ||
| name: db-api-harbor-logs.tar.gz | ||
| path: /home/runner/work/harbor/harbor/src/github.com/goharbor/harbor/integration_logs.tar.gz | ||
| path: /home/ubuntu/_work/harbor/harbor/src/github.com/goharbor/harbor/integration_logs.tar.gz |
| with: | ||
| name: proxy-api-harbor-logs.tar.gz | ||
| path: /home/runner/work/harbor/harbor/src/github.com/goharbor/harbor/integration_logs.tar.gz | ||
| path: /home/ubuntu/_work/harbor/harbor/src/github.com/goharbor/harbor/integration_logs.tar.gz |
| with: | ||
| name: ldap-api-harbor-logs.tar.gz | ||
| path: /home/runner/work/harbor/harbor/src/github.com/goharbor/harbor/integration_logs.tar.gz | ||
| path: /home/ubuntu/_work/harbor/harbor/src/github.com/goharbor/harbor/integration_logs.tar.gz |
| - name: Run Playwright tests | ||
| run: | | ||
| cd src/github.com/goharbor/harbor/src/portal | ||
| npx playwright test |
|
@amaydixit11 Please resolve conflicts |
Comprehensive Summary of your change
This PR introduces a full Playwright-based implementation of the P2P_Preheat.robot test suite and related flows.
This PR builds upon the existing PR for playwright setup #22462
Changes Made
Issue being fixed
Fixes #22134
Please indicate you've done the following: