frontend: e2e: Add e2e tests for CreateResourceForm - #5291
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: vyncent-t The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
8c31878 to
ff767ed
Compare
ff767ed to
b5dbf45
Compare
b5dbf45 to
11386bb
Compare
902e051 to
ffb0521
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vyncent-t The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
687ef78 to
a13437f
Compare
f86de43 to
4470464
Compare
There was a problem hiding this comment.
Pull request overview
Adds Playwright coverage for creating Pods through CreateResourceForm.
Changes:
- Adds a Pod creation form page object.
- Tests required-field validation and Pod creation.
- Two reliability issues were identified: an unscoped combobox locator and stale Pod reuse.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
e2e-tests/tests/createResourceFormPage.ts |
Adds form locators and interaction helpers. |
e2e-tests/tests/createResourceForm.spec.ts |
Adds validation and creation scenarios. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| return this.page | ||
| .getByRole('combobox', { name: 'Namespace' }) | ||
| .or(this.page.getByRole('combobox').first()) | ||
| .first(); |
| // Unique name per retry so a leftover from a failed prior attempt doesn't | ||
| // turn the Apply click into a duplicate-create no-op. | ||
| const name = `e2e-form-pod-${testInfo.retry}`; |
illume
left a comment
There was a problem hiding this comment.
Please see copilot review comments?
Summary
Adds a Playwright e2e test for the new data-driven
CreateResourceForm, exercising the Pod resource type end-to-end via the form (no YAML typing). The test covers two flows: validation of the Apply button state as required fields are filled, and a happy-path pod creation that verifies the new pod appears in the list afterward.Changes
e2e-tests/tests/createResourceFormPage.tsCreate Podbutton and switches to the Form tabaria-labellocators for the fields exposed byCreateResourceForm/ContainerTextField:Name,Namespace,Container name,Container image,Apply,ClosefillMetadata,fillFirstContainer,addContainer,clickApply,closeCreateDialog,waitForAppliedToasta11y()helper using@axe-core/playwright, matching other page objectse2e-tests/tests/createResourceForm.spec.ts(test.describe('CreateResourceForm – Pod'))testcluster and short-circuits when pod permissions are missing (same pattern asnamespaces.spec.tsandpodsPage.spec.ts)Apply stays disabled until required fields are filled— asserts the Apply button stays disabled at each intermediate state (nothing filled, metadata only, container name only) and only becomes enabled once the container image is filled toocreates a pod via the form— opens the form, fills metadata and the seeded first container, clicks Apply, closes the activity via theX, waits for theApplied …toast, navigates back to the pods list, and confirms the new pod link is visible; uses a per-retry unique name so retries don't collide with leftoversSteps to Test
cd e2e-tests && npm installHEADLAMP_TEST_URL=<url> HEADLAMP_TEST_TOKEN=<token> npx playwright test tests/createResourceForm.spec.tsNotes for the Reviewer
fillFirstContainerfills the seeded row rather than adding a new one.testInfo.retryso a leftover pod from a failed prior attempt doesn't turn the Apply click into a duplicate-create no-op.Namespacecombobox lookup falls back to the first combobox in the form because the underlying MUI Autocomplete label association isn't always picked up by role/name.