Skip to content

test(x2a): add FLPATH-4215 source dir resolution e2e test#3203

Open
hardengl wants to merge 16 commits into
redhat-developer:mainfrom
hardengl:feature/x2ansible-e2e-tests
Open

test(x2a): add FLPATH-4215 source dir resolution e2e test#3203
hardengl wants to merge 16 commits into
redhat-developer:mainfrom
hardengl:feature/x2ansible-e2e-tests

Conversation

@hardengl
Copy link
Copy Markdown
Contributor

Summary

  • Adds source-dir-resolution.test.ts to x2a e2e tests
  • Verifies the export agent correctly resolves source_dir='.' when a module lives at the repo root (x2a-convertor#194)
  • Uses chef-examples-metadata repo which has a cookbook at root level (metadata.rb, recipes/, attributes/)
  • Tests init -> analyze -> migrate pipeline for root-level modules, validates via both API and UI

Test plan

  • Run against a deployed x2a backend with GITHUB_TOKEN set
  • Verify init discovers root-level module from chef-examples-metadata
  • Verify analyze and migrate phases succeed for the root-level module

Jira

FLPATH-4215

hardengl and others added 14 commits March 3, 2026 10:34
- Replace noop test with real welcome page test
- Add conversion-flow.test.ts: full wizard happy path through all 4 steps
- Add navigation.test.ts: direct URL, sidebar, browser back/forward, step nav
- Add page object (X2AnsiblePage) and auth fixtures
- Update playwright config: ignoreHTTPSErrors, junit reporter, single worker
- Enable test:e2e scripts in package.json

Made-with: Cursor
The x2a template's RepoUrlPicker fields use requestUserCredentials to
request GitHub OAuth tokens from the logged-in user. This fails when
using guest login since no user OAuth token is available. The scaffolder
will fall back to the integration token configured in app-config instead.

Made-with: Cursor
The x2a backend action requires SRC_USER_OAUTH_TOKEN from ctx.secrets,
which is only populated via the requestUserCredentials mechanism when the
user has an active GitHub OAuth session.

Made-with: Cursor
Add pipeline-phases.test.ts with serial tests for each conversion phase:
- Phase 1: Create project + init via API
- Phase 2: Run Analyze via UI module page
- Phase 3: Run Migrate via UI module page
- Phase 4: Run Publish via UI module page
- Phase 5: Verify all phases show Success

Add module page helper methods to X2AnsiblePage (navigateToModulePage,
runAnalyze, runMigrate, runPublish, waitForPhaseStatus).

Made-with: Cursor
…te init failure

- Fix Response disposed error by calling resp.json() before ctx.dispose()
- Increase guest login nav timeout from 30s to 60s and wait for DOM ready
- Tolerate init state=failed when modules are discovered (FLPATH-3386)

Made-with: Cursor
Remove state=failed tolerance. Init should succeed with the latest image.

Made-with: Cursor
- performLogin: increase Enter button detection timeout from 3s to 15s
  (on slow CI, 3s wasn't enough to detect guest auth, falling into OIDC)
- performLogin: increase nav visibility timeout from 30s to 60s
- performLogin: add .first() and exact match for Sign in button to avoid
  strict mode violations when GitHub OAuth page has multiple elements
- X2AnsiblePage: add missing dismissGitHubLoginDialog method that clicks
  "Reject All" on the GitHub login dialog
- conversion-flow: handle both "Start first conversion" and "New Project"
  button variants depending on whether projects already exist

Made-with: Cursor
performLogin was using waitForLoadState('load') which waits for all resources
including slow external scripts/images. On the deployed RHDH instance, this
never completes within the timeout, causing every navigation test to fail.

Switched to 'domcontentloaded' (matching performGuestLogin which passes) and
simplified the login flow. Also removed debug logging from pipeline-phases.

Made-with: Cursor
The [class*="Chip"] CSS selector doesn't match the actual chip elements on the
deployed RHDH instance. Switch to getByText with case-insensitive regex for
more resilient matching. Add debug logging on failure to capture page state.

Made-with: Cursor
The x2a backend plugin v1.0.1 hardcodes AAP_VERIFY_SSL=true in project
secrets. Patch the secret once in Phase 4 before triggering publish so
the job pod can reach AAP controllers with self-signed certificates.

Made-with: Cursor
AAP SSL verification should be handled at the deployment/config level,
not in test code. The deploy script already sets skipSSLVerification
in the app config and AAP_VERIFY_SSL in the credentials secret.

Made-with: Cursor
Verify that the export agent correctly resolves source_dir='.' when a
module lives at the repo root. Uses chef-examples-metadata as the source
repo which has a cookbook at root level (metadata.rb, recipes/, attributes/).

Tests init -> analyze -> migrate pipeline for the root-level module and
verifies each phase succeeds via both API and UI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

This pull request adds a new top-level directory under workspaces/. Please follow Submitting a Pull Request for a New Workspace in CONTRIBUTING.md.

hardengl and others added 2 commits May 21, 2026 10:18
Verify the PATCH /projects/:projectId endpoint (rhdh-plugins#3130):
- Update name, description, ownedBy individually and together
- 400 on empty body, 404 on non-existent project
- Unchanged fields preserved after partial update
- dirName immutability after name change

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Playwright UI tests that exercise the EditProjectDialog:
- Edit button visible on project details page
- Dialog opens with current field values
- Update name and description via dialog
- Cancel discards changes
- Update button disabled when no changes or name empty

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant