Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 31 additions & 2 deletions workspaces/adoption-insights/e2e-tests/insights.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ test('Rest of the panels have no data', async () => {
];
for (const title of titles) {
const panel = getPanel(page, title);
await expect(panel).toContainText(translations.common.noResults);
await expect(panel).toContainText(translations.common.noResults, {
timeout: 15000,
});
}
});

Expand Down Expand Up @@ -226,6 +228,20 @@ test.describe(() => {
]);

await verifyTableEntries(panel, 1, 'example-website');
await page.keyboard.press('Escape');
const componentRow = page.getByText('example-website');
await componentRow.scrollIntoViewIfNeeded();
await componentRow.hover();
const componentTooltip = page.getByRole('tooltip');
await expect(componentTooltip).toBeVisible();
const text = (await componentTooltip.textContent()) ?? '';
expect(
text
.split('|')
.map(s => s.trim())
.filter(Boolean),
).toHaveLength(2);
await page.keyboard.press('Escape');
});

test('Visited TechDoc shows up in top TechDocs', async () => {
Expand Down Expand Up @@ -270,7 +286,20 @@ test.describe(() => {

await panel.scrollIntoViewIfNeeded();
await verifyTableEntries(panel, 1, 'Example Node.js Template');

await page.keyboard.press('Escape');
const templateRow = page.getByText('Example Node.js Template');
await templateRow.scrollIntoViewIfNeeded();
await templateRow.hover();
const templateTooltip = page.getByRole('tooltip');
await expect(templateTooltip).toBeVisible();
const text = (await templateTooltip.textContent()) ?? '';
expect(
text
.split('|')
.map(s => s.trim())
.filter(Boolean),
).toHaveLength(3);
await page.keyboard.press('Escape');
await runAccessibilityTests(page, testInfo);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@ export async function runAccessibilityTests(
.withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'])
.analyze();

// Known violations filtered until fixed in UI; track in https://issues.redhat.com/browse/RHDHBUGS-2216
const filteredViolations = accessibilityScanResults.violations.filter(
v => !['aria-input-field-name', 'button-name'].includes(v.id),
v =>
![
'aria-input-field-name',
'button-name',
'color-contrast', // MUI Tooltip default styling
'svg-img-alt', // Recharts pie segments
].includes(v.id),
);

await testInfo.attach(attachName, {
Expand Down
2 changes: 1 addition & 1 deletion workspaces/adoption-insights/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"test:e2e:legacy": "APP_MODE=legacy playwright test",
"test:e2e:nfs": "APP_MODE=nfs playwright test",
"test:e2e:all": "yarn test:e2e:legacy && yarn test:e2e:nfs",
"playwright": "bash -c 'if [[ $1 == install ]]; then npx playwright \"$@\"; else yarn test:e2e:all; fi' _",
"playwright": "bash -c 'if [[ $@ == test ]]; then yarn test:e2e:all; else npx playwright \"$@\"; fi' _",
"fix": "backstage-cli repo fix",
"lint": "backstage-cli repo lint --since origin/main",
"lint:all": "backstage-cli repo lint",
Expand Down