Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable kebab dropdown keyboard accessibility #2535

Merged
merged 1 commit into from
Jul 24, 2024
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
4 changes: 3 additions & 1 deletion cypress/e2e/awx/access/users.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ describe('Users Delete Actions', () => {

it('deletes a user from the users list row item', () => {
cy.navigateTo('awx', 'users');
cy.clickTableRowKebabAction(user.username, 'delete-user');
cy.clickTableRowAction('username', user.username, 'delete-user', {
inKebab: true,
});
cy.get('#confirm').click();
cy.clickButton(/^Delete user/);
cy.contains(/^Success$/);
Expand Down
10 changes: 8 additions & 2 deletions cypress/e2e/awx/administration/credentialTypes.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ describe('Credential Types', () => {
});
cy.navigateTo('awx', 'credential-types');
cy.filterTableByMultiSelect('name', [editedCredentialTypeName]);
cy.clickTableRowKebabAction(`${editedCredentialTypeName}`, 'delete-credential-type', false);
cy.clickTableRowAction('name', editedCredentialTypeName, 'delete-credential-type', {
disableFilter: true,
inKebab: true,
});
cy.get('#confirm').click();
cy.intercept('DELETE', awxAPI`/credential_types/${credType1.id.toString()}/`).as(
'deleteCredType'
Expand Down Expand Up @@ -285,7 +288,10 @@ describe('Credential Types', () => {
it('can delete a credential type from the list row action', () => {
cy.navigateTo('awx', 'credential-types');
cy.filterTableByMultiSelect('name', [credType1.name]);
cy.clickTableRowKebabAction(credType1.name, 'delete-credential-type', false);
cy.clickTableRowAction('name', credType1.name, 'delete-credential-type', {
disableFilter: true,
inKebab: true,
});
cy.get('#confirm').click();
cy.clickButton(/^Delete credential type/);
cy.contains(/^Success$/);
Expand Down
14 changes: 10 additions & 4 deletions cypress/e2e/awx/administration/instanceGroups.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe(`Instance Groups`, () => {
cy.navigateTo('awx', 'instance-groups');
cy.verifyPageTitle('Instance Groups');
cy.clickButton(/^Create group$/);
cy.clickLink(`Create instance group`);
cy.clickButton(`Create instance group`);
cy.get('[data-cy="name"]').type(name);
cy.get('[data-cy="policy-instance-minimum"]').clear();
cy.get('[data-cy="policy-instance-minimum"]').type('1');
Expand Down Expand Up @@ -100,7 +100,10 @@ describe(`Instance Groups`, () => {
cy.navigateTo('awx', 'instance-groups');
cy.verifyPageTitle('Instance Groups');
cy.filterTableBySingleSelect('name', instanceGroup.name);
cy.clickTableRowKebabAction(instanceGroup.name, `edit-instance-group`, false);
cy.clickTableRowAction('name', instanceGroup.name, `edit-instance-group`, {
inKebab: false,
disableFilter: true,
});
cy.get('[data-cy="name"]').clear();
cy.get('[data-cy="name"]').type(`${instanceGroup.name}- edited`);
cy.get('[data-cy="policy-instance-minimum"]').clear();
Expand Down Expand Up @@ -237,7 +240,7 @@ describe(`Instance Groups`, () => {
cy.navigateTo('awx', 'instance-groups');
cy.verifyPageTitle('Instance Groups');
cy.clickButton(/^Create group$/);
cy.clickLink(`Create container group`);
cy.clickButton(/^Create container group$/);
cy.get('[data-cy="name"]').type(name);
cy.get('[data-cy="max-concurrent-jobs"]').clear();
cy.get('[data-cy="max-concurrent-jobs"]').type('3');
Expand Down Expand Up @@ -1008,7 +1011,10 @@ describe(`Instance Groups`, () => {
cy.clickTab(/^Jobs$/, true);
cy.filterTableBySingleSelect('name', job_template.name);
cy.intercept('DELETE', awxAPI`/jobs/*/`).as('deleted');
cy.clickTableRowKebabAction(job_template.name, 'delete-job', false);
cy.clickTableRowAction('name', job_template.name, 'delete-job', {
inKebab: true,
disableFilter: true,
});
cy.clickModalConfirmCheckbox();
cy.clickModalButton('Delete job');
cy.assertModalSuccess();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/awx/administration/topology-view.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('Topology view', () => {
});
cy.url().should('include', '/infrastructure/instances/');
cy.getByDataCy('page-title').contains(node);
cy.clickKebabAction('actions-dropdown', 'remove-instance');
cy.clickPageAction('remove-instance');
cy.clickModalConfirmCheckbox();
cy.clickButton('Remove instance');
cy.navigateTo('awx', 'topology-view');
Expand Down
15 changes: 5 additions & 10 deletions cypress/e2e/awx/administration/wfApprovalsList.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ describe('Workflow Approvals Tests', () => {
cy.getByDataCy('actions-column-cell').within(() => {
cy.clickKebabAction('actions-dropdown', 'delete-workflow-approval');
});

cy.actionsWFApprovalConfirmModal('delete');
cy.wait('@deleteWFA')
.its('response')
Expand Down Expand Up @@ -456,12 +457,9 @@ describe('Workflow Approvals Tests', () => {
cy.get('tbody').find('tr').should('have.length', 3);
cy.getByDataCy('select-all').click();
cy.getBy('[data-ouia-component-id="page-toolbar"]').within(() => {
cy.getByDataCy('actions-dropdown')
.click()
.then(() => {
cy.getByDataCy('delete').click();
});
cy.getByDataCy('actions-dropdown').click();
});
cy.getByDataCy('delete').click();
cy.getModal().within(() => {
cy.get('[data-ouia-component-id="confirm"]').click();
cy.get('[data-ouia-component-id="submit"]').click();
Expand Down Expand Up @@ -558,12 +556,9 @@ describe('Workflow Approvals Tests', () => {
cy.getByDataCy('checkbox-column-cell').click();
});
cy.get('[data-ouia-component-id="page-toolbar"]').within(() => {
cy.getByDataCy('actions-dropdown')
.click()
.then(() => {
cy.get('[data-cy="delete"]').click();
});
cy.getByDataCy('actions-dropdown').click();
});
cy.get('[data-cy="delete"]').click();
cy.getModal().within(() => {
cy.get('[data-cy="alert-toaster"]').should(
'contain',
Expand Down
5 changes: 4 additions & 1 deletion cypress/e2e/awx/resources/credentials.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ describe('Credentials', () => {
it('can delete machine credential from the list row action', () => {
cy.navigateTo('awx', 'credentials');
cy.filterTableByMultiSelect('name', [credential.name]);
cy.clickTableRowKebabAction(credential.name, 'delete-credential', false);
cy.clickTableRowAction('name', credential.name, 'delete-credential', {
disableFilter: true,
inKebab: true,
});
cy.get('#confirm').click();
cy.intercept('DELETE', awxAPI`/credentials/${credential.id.toString()}/`).as('deleted');
cy.clickButton(/^Delete credential/);
Expand Down
30 changes: 16 additions & 14 deletions cypress/e2e/awx/resources/executionEnvironments.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ describe('Execution Environments', () => {
cy.clickTab(/^Back to Execution Environments$/, true);
cy.verifyPageTitle('Execution Environments');
cy.filterTableBySingleSelect('name', execEnvName);
cy.clickTableRowKebabAction(execEnvName, 'delete-execution-environment', false);
cy.clickTableRowAction('name', execEnvName, 'delete-execution-environment', {
inKebab: true,
disableFilter: true,
});
cy.clickModalConfirmCheckbox();
cy.intercept('DELETE', awxAPI`/execution_environments/*/`).as('deleteEE');
cy.clickModalButton('Delete execution environments');
Expand Down Expand Up @@ -130,7 +133,10 @@ describe('Execution Environments', () => {
cy.verifyPageTitle(awxOrganization.name);
cy.clickTab(/^Execution Environments$/, true);
cy.filterTableBySingleSelect('name', execEnvName);
cy.clickTableRowKebabAction(execEnvName, 'delete-execution-environment', false);
cy.clickTableRowAction('name', execEnvName, 'delete-execution-environment', {
inKebab: true,
disableFilter: true,
});
cy.clickModalConfirmCheckbox();
cy.intercept('DELETE', awxAPI`/execution_environments/*/`).as('deleteEE');
cy.clickModalButton('Delete execution environments');
Expand Down Expand Up @@ -166,17 +172,10 @@ describe('Execution Environments', () => {
cy.hasDetail('Name', execEnvName);
cy.hasDetail('Image', image);
cy.hasDetail('Organization', awxOrganization.name);
cy.getByDataCy('actions-dropdown')
.click()
.then(() => {
cy.get('[data-cy="delete-execution-environment"]').should(
'have.attr',
'aria-disabled',
'true'
);
cy.logout();
cy.login();
});
cy.getByDataCy('actions-dropdown').click();
cy.get('#delete-execution-environment').should('have.attr', 'aria-disabled', 'true');
cy.logout();
cy.login();
});
});

Expand Down Expand Up @@ -363,7 +362,10 @@ describe('Execution Environments', () => {
cy.getByDataCy('image').should('contain', image);
cy.clickTab(/^Templates$/, true);
cy.filterTableBySingleSelect('name', jtName);
cy.clickTableRowKebabAction(jtName, 'delete-template', false);
cy.clickTableRowAction('name', jtName, 'delete-template', {
inKebab: true,
disableFilter: true,
});
cy.clickModalConfirmCheckbox();
cy.intercept('DELETE', awxAPI`/job_templates/*/`).as('deleteJT');
cy.clickModalButton('Delete template');
Expand Down
14 changes: 10 additions & 4 deletions cypress/e2e/awx/resources/inventories.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('Inventories Tests', () => {
const inventoryName = 'E2E Inventory ' + randomString(4);
cy.navigateTo('awx', 'inventories');
cy.clickButton(/^Create inventory$/);
cy.clickLink(/^Create inventory$/);
cy.get('#create-inventory').click();
//Assert that user is on the form view to create an inventory
cy.get('[data-cy="name"]').type(inventoryName);
cy.singleSelectByDataCy('organization', organization.name);
Expand Down Expand Up @@ -122,15 +122,21 @@ describe('Inventories Tests', () => {
//Refactor this test to match the updated test case and improve the assertions
cy.navigateTo('awx', 'inventories'); //Add assertion to verify the user is on the inventories list view
cy.filterTableBySingleSelect('name', inventory.name);
cy.clickTableRowKebabAction(inventory.name, 'copy-inventory', false);
cy.clickTableRowAction('name', inventory.name, 'copy-inventory', {
disableFilter: true,
inKebab: true,
});
cy.hasAlert(`${inventory.name.toString()} copied`);
//Assert the presence of the original and the copy by performing a search on the list of inventories
});

it('can delete an inventory from the inventory list row item', () => {
cy.navigateTo('awx', 'inventories');
cy.filterTableBySingleSelect('name', inventory.name);
cy.clickTableRowKebabAction(inventory.name, 'delete-inventory', false);
cy.clickTableRowAction('name', inventory.name, 'delete-inventory', {
disableFilter: true,
inKebab: true,
});
//Add assertion to show the presence of the expected inventory
cy.get('#confirm').click();
cy.clickButton(/^Delete inventory/);
Expand Down Expand Up @@ -221,7 +227,7 @@ describe('Inventories Tests', () => {
cy.get(`[aria-label="Simple table"] tr`);
cy.contains('button', 'Cancel');
cy.contains('button', 'Confirm');
cy.get(`[aria-label="Pagination"]`);
cy.get('#filter');
});

cy.get(`[role="dialog"]`).within(() => {
Expand Down
6 changes: 2 additions & 4 deletions cypress/e2e/awx/resources/inventoriesConstructed.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ describe('Constructed Inventories CRUD Tests', () => {
const verbosityValue = generateRandom(0, 2);

cy.navigateTo('awx', 'inventories');
cy.getByDataCy('create-inventory').click();
cy.get('.pf-v5-c-dropdown__menu').within(() => {
cy.get('[data-cy="create-constructed-inventory"]').click();
});
cy.clickButton(/^Create inventory$/);
cy.clickButton(/^Create constructed inventory$/);
cy.getByDataCy('name').type(constInvName);
cy.getByDataCy('description').type(`Description of "${constInvName}" typed by Cypress`);
cy.intercept({
Expand Down
11 changes: 7 additions & 4 deletions cypress/e2e/awx/resources/inventoryGroup.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ describe('Inventory Groups', () => {
cy.getByDataCy('name-column-cell').should('contain', host.name);
cy.clickTab(/^Groups$/, true);
cy.filterTableByMultiSelect('name', [group.name]);
cy.clickTableRowKebabAction(group.name, 'edit-group', false);
cy.clickTableRowAction('name', group.name, 'edit-group', {
inKebab: false,
disableFilter: true,
});
cy.verifyPageTitle('Edit group');
cy.get('[data-cy="name-form-group"]').type('-changed');
cy.get('[data-cy="Submit"]').click();
Expand All @@ -119,7 +122,7 @@ describe('Inventory Groups', () => {
cy.clickTableRowLink('name', inventory.name, { disableFilter: true });
cy.verifyPageTitle(inventory.name);
cy.clickTab(/^Groups$/, true);
cy.clickKebabAction('actions-dropdown', 'run-command');
cy.clickButton(/^Run Command$/);

runCommand({
selections: 'all',
Expand Down Expand Up @@ -365,7 +368,7 @@ describe('Inventory Groups', () => {
cy.filterTableBySingleSelect('name', newRelatedGroup);
cy.selectTableRow(newRelatedGroup, false);
cy.intercept('POST', awxAPI`/groups/*/children/`).as('disassociateGroup');
cy.clickToolbarKebabAction('run-command');
cy.clickButton(/^Run Command$/);

runCommand({
selections: newRelatedGroup,
Expand Down Expand Up @@ -463,7 +466,7 @@ describe('Inventory Groups', () => {
cy.clickTableRowLink('name', thisInventory.name, { disableFilter: true });
cy.verifyPageTitle(thisInventory.name);
cy.clickTab(/^Hosts$/, true);
cy.clickKebabAction('actions-dropdown', 'run-command');
cy.clickButton(/^Run Command$/);

runCommand({
selections: 'all',
Expand Down
5 changes: 4 additions & 1 deletion cypress/e2e/awx/resources/inventorySource.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,10 @@ describe.skip('Inventory Sources', () => {
}).then((schedule1: Schedule) => {
goToSourceDetails(inventory.name, inventorySource.name);
cy.clickTab('Schedules', true);
cy.clickTableRowKebabAction(scheduleName, 'delete-schedule', false);
cy.clickTableRowAction('name', scheduleName, 'delete-schedule', {
inKebab: true,
disableFilter: true,
});
cy.intercept('DELETE', awxAPI`/schedules/${schedule1.id.toString()}/`).as('deleteSchedule');
cy.clickModalConfirmCheckbox();
cy.clickButton('Delete schedule');
Expand Down
15 changes: 5 additions & 10 deletions cypress/e2e/awx/resources/jobTemplates.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ describe.skip('Job Templates Tests', function () {
});
cy.get('[data-ouia-component-type="PF5/ModalContent"]').within(() => {
cy.filterTableBySingleSelect('name', executionEnvironmentName);
cy.get('[data-ouia-component-id="simple-table"] tbody').within(() => {
cy.get('[data-cy="checkbox-column-cell"] input').click();
});
cy.selectTableRowByCheckbox('name', executionEnvironmentName, { disableFilter: true });
cy.clickButton(/^Confirm/);
});
cy.clickButton(/^Next/);
Expand Down Expand Up @@ -546,9 +544,9 @@ describe.skip('Job Templates Tests', function () {
cy.intercept('POST', awxAPI`/job_templates/${jobTemplate.id.toString()}/copy/`).as(
'copyTemplate'
);
cy.getByDataCy('actions-column-cell').within(() => {
cy.getByDataCy('actions-dropdown').click();
cy.getByDataCy('copy-template').click();
cy.clickTableRowAction('name', jobTemplate.name, 'copy-template', {
inKebab: true,
disableFilter: true,
});
cy.wait('@copyTemplate')
.its('response.body.name')
Expand Down Expand Up @@ -630,10 +628,7 @@ describe.skip('Job Templates Tests', function () {
it('can delete a job template from the list line item', function () {
cy.navigateTo('awx', 'templates');
cy.filterTableBySingleSelect('name', jobTemplate.name);
cy.getByDataCy('actions-column-cell').within(() => {
cy.getByDataCy('actions-dropdown').click();
cy.getByDataCy('delete-template').click();
});
cy.clickTableRowKebabAction(jobTemplate.name, 'delete-template');
cy.clickModalConfirmCheckbox();
cy.intercept('DELETE', awxAPI`/job_templates/${jobTemplate.id.toString()}/`).as('deleteJT');
cy.clickModalButton('Delete template');
Expand Down
5 changes: 4 additions & 1 deletion cypress/e2e/awx/resources/projects/project-details.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ describe('Projects', () => {

it('can delete a schedule from the schedules list row', () => {
cy.filterTableBySingleSelect('name', schedule.name);
cy.clickTableRowKebabAction(schedule.name, 'delete-schedule', false);
cy.clickTableRowAction('name', schedule.name, 'delete-schedule', {
disableFilter: true,
inKebab: true,
});
cy.getModal().then(() => {
cy.get('#confirm').click();
cy.intercept('DELETE', awxAPI`/schedules/${schedule.id.toString()}/`).as('deleted');
Expand Down
6 changes: 4 additions & 2 deletions cypress/e2e/awx/resources/sharedTemplateSurvey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ export class ReusableTemplateSurveyTestSuite {
cy.contains(question.question_name);
cy.contains(question.default);
cy.contains('text');
cy.getByDataCy('actions-dropdown').click();
cy.contains('Delete question').click();
});
cy.clickTableRowAction('name', question.question_name, 'delete-question', {
inKebab: true,
disableFilter: true,
});
cy.clickModalConfirmCheckbox();
cy.intercept(
Expand Down
10 changes: 4 additions & 6 deletions cypress/e2e/awx/views/jobs.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,18 @@ describe('Jobs', () => {
it('can render the toolbar and row actions', () => {
cy.navigateTo('awx', 'jobs');
cy.get('.pf-v5-c-toolbar__group button.toggle-kebab').click();
cy.get('.pf-v5-c-dropdown__menu').within(() => {
cy.contains(/^Delete jobs$/).should('exist');
cy.contains(/^Cancel jobs$/).should('exist');
});
cy.contains(/^Delete jobs$/).should('exist');
cy.contains(/^Cancel jobs$/).should('exist');
cy.filterTableByMultiSelect('id', [job.id ? job.id.toString() : '']);
const jobName = job.name ? job.name : '';
cy.contains('td', jobName)
.parent()
.within(() => {
// Relaunch job
cy.get('#relaunch-job').should('exist');
cy.get('.pf-v5-c-dropdown__toggle').click();
cy.contains('.pf-v5-c-dropdown__menu-item', /^Delete job$/).should('exist');
cy.getByDataCy('actions-dropdown').click();
});
cy.contains('#delete-job', /^Delete job$/).should('exist');
cy.clearAllFilters();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('EDA Decision Environment List', () => {
cy.setTableView('table');
cy.filterTableByTextFilter('name', edaDE.name, { disableFilterSelection: true });
cy.setTableView('card');
cy.clickListCardKebabAction(edaDE.id, edaDE.name, 'delete-decision-environment');
cy.clickListCardKebabAction(edaDE.id, 'delete-decision-environment');
cy.get('#confirm').click();
cy.clickButton(/^Delete decision environment/);
cy.contains(/^Success$/);
Expand Down
Loading
Loading