Skip to content

Commit 09711b9

Browse files
fix e2e
1 parent 33910a0 commit 09711b9

9 files changed

Lines changed: 92 additions & 11 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# German (DE) - Ports: Frontend 3004, Backend 7011
2+
app:
3+
baseUrl: http://localhost:3004
4+
5+
backend:
6+
baseUrl: http://localhost:7011
7+
listen:
8+
port: 7011
9+
cors:
10+
origin: http://localhost:3004
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# English (EN) - Ports: Frontend 3000, Backend 7007
2+
app:
3+
baseUrl: http://localhost:3000
4+
5+
backend:
6+
baseUrl: http://localhost:7007
7+
listen:
8+
port: 7007
9+
cors:
10+
origin: http://localhost:3000
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Spanish (ES) - Ports: Frontend 3005, Backend 7012
2+
app:
3+
baseUrl: http://localhost:3005
4+
5+
backend:
6+
baseUrl: http://localhost:7012
7+
listen:
8+
port: 7012
9+
cors:
10+
origin: http://localhost:3005
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# French (FR) - Ports: Frontend 3001, Backend 7008
2+
app:
3+
baseUrl: http://localhost:3001
4+
5+
backend:
6+
baseUrl: http://localhost:7008
7+
listen:
8+
port: 7008
9+
cors:
10+
origin: http://localhost:3001
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Italian (IT) - Ports: Frontend 3002, Backend 7009
2+
app:
3+
baseUrl: http://localhost:3002
4+
5+
backend:
6+
baseUrl: http://localhost:7009
7+
listen:
8+
port: 7009
9+
cors:
10+
origin: http://localhost:3002
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Japanese (JA) - Ports: Frontend 3003, Backend 7010
2+
app:
3+
baseUrl: http://localhost:3003
4+
5+
backend:
6+
baseUrl: http://localhost:7010
7+
listen:
8+
port: 7010
9+
cors:
10+
origin: http://localhost:3003

workspaces/scorecard/packages/app-legacy/e2e-tests/pages/CatalogPage.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,14 @@ export class CatalogPage {
7070
if (baseLocale === 'en') return;
7171

7272
const displayName = getLocaleDisplayName(locale);
73-
await this.page.goto('/settings');
73+
const settingsLink = this.page.getByRole('link', { name: 'Settings' });
74+
await settingsLink.waitFor({ state: 'visible', timeout: 10000 });
75+
await settingsLink.click();
7476
await expect(
7577
this.page.getByRole('button', { name: 'English' }),
7678
).toBeVisible({ timeout: 10000 });
7779
await this.page.getByRole('button', { name: 'English' }).click();
7880
await this.page.getByRole('option', { name: displayName }).click();
79-
await this.page.goto('/');
81+
await this.page.locator('a').filter({ hasText: 'Home' }).click();
8082
}
8183
}

workspaces/scorecard/playwright.config.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,18 @@
1616

1717
import { defineConfig } from '@playwright/test';
1818

19-
const LOCALES = ['en', 'fr', 'it', 'ja', 'de', 'es'] as const;
19+
// APP_MODE: 'legacy' (app-legacy) or 'nfs' (app with new frontend system)
2020
const appMode = process.env.APP_MODE || 'legacy';
2121
const startCommand = appMode === 'legacy' ? 'yarn start:legacy' : 'yarn start';
2222

23+
// Config paths (absolute to work from any cwd)
24+
const baseConfig = `${__dirname}/app-config.yaml`;
25+
const testConfigDir = `${__dirname}/e2e-tests/test_yamls`;
26+
27+
const LOCALES = ['en', 'fr', 'it', 'ja', 'de', 'es'] as const;
28+
const FRONTEND_PORT_BASE = 3000;
29+
const BACKEND_PORT_BASE = 7007;
30+
2331
export default defineConfig({
2432
timeout: 2 * 60 * 1000,
2533

@@ -29,15 +37,19 @@ export default defineConfig({
2937

3038
webServer: process.env.PLAYWRIGHT_URL
3139
? []
32-
: {
33-
command: startCommand,
34-
port: 3000,
35-
reuseExistingServer: true,
40+
: LOCALES.map((locale, i) => ({
41+
command: `${startCommand} --config ${baseConfig} --config ${testConfigDir}/app-config-e2e-${locale}.yaml`,
42+
url: `http://localhost:${
43+
BACKEND_PORT_BASE + i
44+
}/.backstage/health/v1/readiness`,
45+
timeout: 120000,
46+
reuseExistingServer: false,
47+
cwd: __dirname,
3648
env: {
3749
JIRA_URL: 'https://issues.redhat.com',
3850
JIRA_TOKEN: 'my-jira-token',
3951
},
40-
},
52+
})),
4153

4254
retries: process.env.CI ? 2 : 0,
4355

@@ -49,19 +61,19 @@ export default defineConfig({
4961
baseURL: process.env.PLAYWRIGHT_URL ?? 'http://localhost:3000',
5062
screenshot: 'only-on-failure',
5163
trace: 'on-first-retry',
52-
/* Default Playwright navigation timeout is 0 (no limit); cap to avoid hangs. */
5364
navigationTimeout: 60_000,
5465
actionTimeout: 30_000,
5566
},
5667

5768
outputDir: `node_modules/.cache/e2e-test-results-${appMode}`,
5869

59-
projects: LOCALES.map(locale => ({
70+
projects: LOCALES.map((locale, i) => ({
6071
name: locale,
6172
testDir: 'packages/app-legacy/e2e-tests',
6273
use: {
6374
channel: 'chrome' as const,
6475
locale,
76+
baseURL: `http://localhost:${FRONTEND_PORT_BASE + i}`,
6577
},
6678
})),
6779
});

workspaces/scorecard/plugins/scorecard/src/components/ScorecardHomepageSection/ResponsivePieChart.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
Legend,
2323
Tooltip,
2424
PieLabelRenderProps,
25+
type TooltipProps,
2526
} from 'recharts';
2627
import type { PieData } from '../types';
2728

@@ -134,7 +135,13 @@ export const ResponsivePieChart = ({
134135
/>
135136
) : null}
136137

137-
{isTooltipEnabled && <Tooltip content={tooltipContent as never} />}
138+
<Tooltip
139+
content={
140+
(isTooltipEnabled
141+
? tooltipContent
142+
: () => null) as TooltipProps['content']
143+
}
144+
/>
138145
</PieChart>
139146
</ResponsiveContainer>
140147
);

0 commit comments

Comments
 (0)