Skip to content

feat(e2e): Migrate P2P Preheat and Distribution tests (P2P_Preheat.robot) to Playwright#22631

Open
amaydixit11 wants to merge 14 commits intogoharbor:mainfrom
amaydixit11:p2p-preheat-migration
Open

feat(e2e): Migrate P2P Preheat and Distribution tests (P2P_Preheat.robot) to Playwright#22631
amaydixit11 wants to merge 14 commits intogoharbor:mainfrom
amaydixit11:p2p-preheat-migration

Conversation

@amaydixit11
Copy link
Copy Markdown

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

  • Added a new Playwright E2E test file: p2p-preheat.spec.ts
    • Distribution CRUD flow
    • P2P Preheat Policy CRUD flow
    • P2P Preheat Manual flow
  • Added cleanup steps for distributions, policies, and projects to ensure tests are self-contained
  • New helper logic for image pushing and environment interactions needed by manual preheat validation.
  • Integration with the existing Playwright configuration and GitHub Actions workflow.

Issue being fixed

Fixes #22134

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

@amaydixit11 amaydixit11 requested a review from a team as a code owner December 10, 2025 05:38
g-yunjh and others added 12 commits December 10, 2025 11:21
…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>
@amaydixit11 amaydixit11 force-pushed the p2p-preheat-migration branch from 99a8189 to d917463 Compare December 10, 2025 05:57
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.53%. Comparing base (c8c11b4) to head (d917463).
⚠️ Report is 604 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
unittests 46.53% <ø> (+1.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 178 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/portal/e2e/p2p-preheat.spec.ts Outdated
* 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

This logs sensitive data returned by
an access to HARBOR_PASSWORD
as clear text.
Comment thread src/portal/e2e/p2p-preheat.spec.ts Outdated
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

This logs sensitive data returned by
an access to HARBOR_PASSWORD
as clear text.
Signed-off-by: Amay Dixit <amaydixit11@gmail.com>
Signed-off-by: Amay Dixit <amaydixit11@gmail.com>
@amaydixit11
Copy link
Copy Markdown
Author

@bupd kindly review this PR and let me know if there's something missing or is something needs to be changed

@github-actions
Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the Stale label Feb 15, 2026
@amaydixit11
Copy link
Copy Markdown
Author

please /label never-stale

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml workflow 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.

Comment on lines +65 to +81
- 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
Comment on lines +3 to +9
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';
Comment on lines +43 to +45
runCommand(`docker pull ${sourceImage}`);
runCommand(`docker login -u ${user} -p ${pwd} ${ip}`);
runCommand(`docker tag ${sourceImage} ${targetImage}`);
Comment thread .github/workflows/CI.yml
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
Comment thread .github/workflows/CI.yml
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
Comment thread .github/workflows/CI.yml
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
Comment on lines +82 to +85
- name: Run Playwright tests
run: |
cd src/github.com/goharbor/harbor/src/portal
npx playwright test
@bupd
Copy link
Copy Markdown
Member

bupd commented May 5, 2026

@amaydixit11 Please resolve conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate Internal Pipeline to Github Actions

8 participants