Skip to content

Commit 2ff8fca

Browse files
[Scout] Failing test tags a11y checks
1 parent ae93a37 commit 2ff8fca

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

x-pack/platform/plugins/shared/saved_objects_tagging/test/scout/ui/fixtures/page_objects/tag_assign_flyout.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ export class TagAssignFlyout {
2626
}
2727

2828
async waitForResultsLoaded() {
29-
await this.resultList.waitFor({ state: 'visible' });
30-
await this.page.waitForFunction(
31-
() => document.querySelectorAll('[data-is-loading="true"]').length === 0
32-
);
29+
await this.resultList.locator('.euiLoadingSpinner').waitFor({ state: 'hidden' });
30+
// EUI icons are briefly role="img" with no alt text while loading — wait for them to settle.
31+
await this.resultList.locator('[data-is-loading="true"]').waitFor({ state: 'hidden' });
3332
}
3433
}

x-pack/platform/plugins/shared/saved_objects_tagging/test/scout/ui/fixtures/page_objects/tags_table.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ export class TagsTable {
100100
return this.bulkActionsButton.isVisible();
101101
}
102102

103-
// portal: action rendered in EUI portal (collapsed menu); inline: rendered on the row.
104-
async clickRowAction(tagName: string, action: string, location: 'portal' | 'inline' = 'inline') {
103+
// assign/delete live in the EUI portal after the `...` menu is opened; edit
104+
// (isPrimary) is always inline on the row.
105+
async clickRowAction(tagName: string, action: string, location: 'portal' | 'inline') {
105106
const testSubj = `tagsTableAction-${action}`;
106107
const actionLocator =
107108
location === 'portal'
@@ -112,6 +113,9 @@ export class TagsTable {
112113
await actionLocator.click();
113114
}
114115

116+
// The `...` button appears slightly after the table-is-ready signal fires
117+
// (the edit/assign/delete actions are non-primary and collapse when >2 exist),
118+
// so waitFor is used instead of an instant isVisible check.
115119
async clickCollapsedRowAction(tagName: string, action: string) {
116120
const row = this.rowByName(tagName);
117121
const collapseBtn = row.locator('[data-test-subj="euiCollapsedItemActionsButton"]');

x-pack/platform/plugins/shared/saved_objects_tagging/test/scout/ui/tests/tags_a11y.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ test.describe('Tags management — accessibility', { tag: tags.stateful.classic
5656
});
5757

5858
await test.step('edit tag panel', async () => {
59-
await tagsTable.clickRowAction('a11yTag', 'edit');
59+
await tagsTable.clickRowAction('a11yTag', 'edit', 'inline');
6060
await tagModal.form.waitFor({ state: 'visible' });
6161
const { violations } = await page.checkA11y({ include: A11Y_SELECTORS });
6262
expect(violations).toStrictEqual([]);

0 commit comments

Comments
 (0)