Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
d61c940
Add x2Ansible e2e tests and fix playwright config
hardengl Mar 3, 2026
858d890
Remove requestUserCredentials from template for guest auth compatibility
hardengl Mar 3, 2026
c90bb38
Restore requestUserCredentials for GitHub OAuth token flow
hardengl Mar 3, 2026
0e69b63
feat(x2a): add pipeline phases E2E test covering all 4 phases
hardengl Mar 12, 2026
75aed28
fix(x2a): fix API dispose-before-json bug, harden guest login, tolera…
hardengl Mar 12, 2026
c3e674b
fix(x2a): strict init assertion — varchar limit is fixed
hardengl Mar 12, 2026
68357e1
fix(x2a): fix login timeout and missing dismissGitHubLoginDialog
hardengl Mar 12, 2026
2c5e3a7
debug: log GITHUB_TOKEN availability in triggerInit
hardengl Mar 13, 2026
9e471c7
fix(e2e): use domcontentloaded instead of load for login
hardengl Mar 13, 2026
b83a360
fix(e2e): use text-based locator for phase status verification
hardengl Mar 13, 2026
a73ee5d
fix(x2a): patch project secret to disable AAP SSL before publish
hardengl Mar 13, 2026
fd935c9
revert: remove oc patch workaround from test code
hardengl Mar 13, 2026
36176f2
Merge remote-tracking branch 'upstream/main' into feature/x2ansible-e…
hardengl Mar 13, 2026
0a8a563
test(x2a): add FLPATH-4215 source dir resolution e2e test
hardengl May 21, 2026
d05d709
test(x2a): add FLPATH-4211 edit project e2e tests
hardengl May 21, 2026
855a09c
test(x2a): add FLPATH-4211 UI tests for Edit Project dialog
hardengl May 21, 2026
fb02601
fix: resolve Playwright strict mode and locator issues in E2E tests
hardengl May 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion workspaces/x2a/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
"clean": "backstage-cli repo clean",
"test": "backstage-cli repo test",
"test:all": "yarn openapi-generate && yarn prettier:check && yarn lint:all && backstage-cli repo test --coverage",
"test:e2e": "echo Skipping until we have tests: playwright test",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui",
"test:e2e:headed": "playwright test --headed",
"test:e2e:debug": "playwright test --debug",
"fix": "backstage-cli repo fix",
"lint": "backstage-cli repo lint --since origin/main",
"lint:all": "backstage-cli repo lint",
Expand Down
24 changes: 12 additions & 12 deletions workspaces/x2a/packages/app/e2e-tests/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
*/

import { test, expect } from '@playwright/test';
import { performGuestLogin } from './fixtures/auth';

// To be implemented later
test('noop test', async () => {
expect(true).toBe(true);
});
const devMode = !process.env.PLAYWRIGHT_URL;

/*
test('App should render the welcome page', async ({ page }) => {
await page.goto('/');

const enterButton = page.getByRole('button', { name: 'Enter' });
await expect(enterButton).toBeVisible();
await enterButton.click();
await performGuestLogin(page);

await expect(page.getByText('My Company Catalog')).toBeVisible();
if (devMode) {
await expect(
page.getByRole('heading', { name: 'Red Hat Catalog' }),
).toBeVisible({ timeout: 10000 });
} else {
await expect(
page.getByRole('heading', { name: 'Welcome back!' }),
).toBeVisible({ timeout: 10000 });
}
});
*/
128 changes: 128 additions & 0 deletions workspaces/x2a/packages/app/e2e-tests/conversion-flow.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/*
* Copyright Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { test, expect } from '@playwright/test';
import { X2AnsiblePage } from './pages/X2AnsiblePage';

test.describe('X2Ansible - Conversion Flow @live', () => {
let x2aPage: X2AnsiblePage;

test.beforeEach(async ({ page }) => {
x2aPage = new X2AnsiblePage(page);
});

test.describe('Navigation and Page Load', () => {
test('should navigate to X2A page and display Conversion Hub', async () => {
await x2aPage.navigateToX2AByUrl();
await x2aPage.verifyConversionHubPage();
});

test('should navigate to X2A page via sidebar', async () => {
await x2aPage.navigateFromSidebar();
await x2aPage.verifyConversionHubPage();
});

test('should display Start first conversion button', async () => {
await x2aPage.navigateToX2AByUrl();
await x2aPage.verifyConversionHubPage();

const startFirst = x2aPage.page.getByRole('button', {
name: /start first conversion/i,
});
const newProject = x2aPage.page.getByRole('button', {
name: /new project/i,
});
await expect(startFirst.or(newProject).first()).toBeVisible({
timeout: 10000,
});
});
});

test.describe('Template Scaffolder', () => {
test('should load the scaffolder template when starting a conversion', async () => {
await x2aPage.navigateToX2AByUrl();
await x2aPage.clickStartFirstConversion();

Check warning on line 57 in workspaces/x2a/packages/app/e2e-tests/conversion-flow.test.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

The signature '(): Promise<void>' of 'x2aPage.clickStartFirstConversion' is deprecated.

See more on https://sonarcloud.io/project/issues?id=redhat-developer_rhdh-plugins&issues=AZ5KtIuF4e8379IGY9YN&open=AZ5KtIuF4e8379IGY9YN&pullRequest=3203
await x2aPage.verifyTemplateFormLoaded();
});

test('should display all required form fields in step 1', async () => {
await x2aPage.navigateToX2AByUrl();
await x2aPage.clickStartFirstConversion();

Check warning on line 63 in workspaces/x2a/packages/app/e2e-tests/conversion-flow.test.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

The signature '(): Promise<void>' of 'x2aPage.clickStartFirstConversion' is deprecated.

See more on https://sonarcloud.io/project/issues?id=redhat-developer_rhdh-plugins&issues=AZ5KtIuF4e8379IGY9YO&open=AZ5KtIuF4e8379IGY9YO&pullRequest=3203
await x2aPage.verifyTemplateFormLoaded();

await expect(x2aPage.page.getByLabel('Name')).toBeVisible();
await expect(x2aPage.page.getByLabel('Description')).toBeVisible();
await expect(x2aPage.page.getByLabel('Abbreviation')).toBeVisible();
await expect(x2aPage.page.getByLabel('Owned by group')).toBeVisible();
});

test('should have Next button on step 1', async () => {
await x2aPage.navigateToX2AByUrl();
await x2aPage.clickStartFirstConversion();

Check warning on line 74 in workspaces/x2a/packages/app/e2e-tests/conversion-flow.test.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

The signature '(): Promise<void>' of 'x2aPage.clickStartFirstConversion' is deprecated.

See more on https://sonarcloud.io/project/issues?id=redhat-developer_rhdh-plugins&issues=AZ5KtIuF4e8379IGY9YP&open=AZ5KtIuF4e8379IGY9YP&pullRequest=3203
await x2aPage.verifyTemplateFormLoaded();

await expect(
x2aPage.page.getByRole('button', { name: 'Next' }),
).toBeVisible();
});
});

test.describe('Happy Path - Full Conversion Wizard', () => {
test('should complete the full conversion wizard', async () => {
test.setTimeout(180000);

await x2aPage.navigateToX2AByUrl();
await x2aPage.verifyConversionHubPage();
await x2aPage.clickStartFirstConversion();

Check warning on line 89 in workspaces/x2a/packages/app/e2e-tests/conversion-flow.test.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

The signature '(): Promise<void>' of 'x2aPage.clickStartFirstConversion' is deprecated.

See more on https://sonarcloud.io/project/issues?id=redhat-developer_rhdh-plugins&issues=AZ5KtIuF4e8379IGY9YQ&open=AZ5KtIuF4e8379IGY9YQ&pullRequest=3203
await x2aPage.verifyTemplateFormLoaded();

// Step 1: Job name and description
await x2aPage.fillProjectName('chef-examples-e2e-test');
await x2aPage.fillDescription(
'E2E test conversion of Chef examples repo',
);
await x2aPage.fillAbbreviation('x2a');
await x2aPage.fillOwnedByGroup('guests');

await x2aPage.clickNext();

// Step 2: Source and target repositories
await x2aPage.verifyRepositoryStepVisible();
await x2aPage.dismissGitHubLoginDialog();

await x2aPage.fillSourceRepoOwner('chef');
await x2aPage.fillSourceRepoName('chef-examples');

await x2aPage.clickNext();

// Step 3: Conversion parameters (optional prompt)
await x2aPage.dismissGitHubLoginDialog();
await x2aPage.verifyConversionParamsVisible();
await x2aPage.clickNext();

// Step 4: Review
await x2aPage.verifyReviewStepVisible();

await expect(
x2aPage.page.getByText('chef-examples-e2e-test'),
).toBeVisible();

await x2aPage.clickCreate();

await x2aPage.verifyTaskSubmitted();
});
});
});
Loading
Loading