Skip to content

Commit

Permalink
Merge branch 'main' into remove-unnecessary-upstream-labeling
Browse files Browse the repository at this point in the history
  • Loading branch information
akus062381 authored Aug 27, 2024
2 parents 72bae9e + b7c91db commit fed7262
Show file tree
Hide file tree
Showing 50 changed files with 233 additions and 254 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/awx/access/users/users.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe('Users Tests', () => {

it('deletes a user from the users list toolbar', () => {
cy.selectTableRow(user.username);
cy.clickToolbarKebabAction('delete-selected-users');
cy.clickToolbarKebabAction('delete-users');
cy.get('#confirm').click();
cy.clickButton(/^Delete user/);
cy.contains(/^Success$/);
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/awx/infrastructure/hosts/hosts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('Host Tests', () => {
const hostName = 'E2E Inventory host ' + randomString(4);
cy.navigateTo('awx', 'hosts');
cy.clickButton(/^Create host$/);
cy.verifyPageTitle('Create Host');
cy.verifyPageTitle('Create host');
cy.getByDataCy('name').type(hostName);
cy.getByDataCy('description').type('This is the description');
cy.singleSelectByDataCy('inventory', inventory.name);
Expand All @@ -48,7 +48,7 @@ describe('Host Tests', () => {
cy.navigateTo('awx', 'hosts');
cy.filterTableByMultiSelect('name', [hostName]);
cy.getByDataCy('edit-host').click();
cy.verifyPageTitle('Edit host');
cy.verifyPageTitle(`Edit ${hostName}`);
cy.getByDataCy('description').clear().type('This is the description edited');
cy.getByDataCy('Submit').click();
cy.hasDetail(/^Description$/, 'This is the description edited');
Expand Down Expand Up @@ -82,7 +82,7 @@ describe('Host Tests', () => {
const hostName = 'E2E Inventory host ' + randomString(4);
cy.navigateTo('awx', 'hosts');
cy.clickButton(/^Create host$/);
cy.verifyPageTitle('Create Host');
cy.verifyPageTitle('Create host');
cy.getByDataCy('name').type(hostName);
cy.getByDataCy('description').type('This is the description');
cy.singleSelectByDataCy('inventory', inventory.name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe(`Instance Groups`, () => {
cy.get('[data-cy="max-forks"]').clear();
cy.get('[data-cy="max-forks"]').type('4');
cy.intercept('POST', awxAPI`/instance_groups/`).as('createInstanceGroup');
cy.clickButton(`Create Instance Group`);
cy.clickButton(`Create instance group`);
cy.wait('@createInstanceGroup')
.its('response')
.then((response) => {
Expand Down Expand Up @@ -153,7 +153,7 @@ describe(`Instance Groups`, () => {
cy.filterTableByMultiSelect('name', arrayOfElementText);
cy.get('tbody tr').should('have.length', 5);
cy.getByDataCy('select-all').click();
cy.clickToolbarKebabAction('delete-selected-instance-groups');
cy.clickToolbarKebabAction('delete-instance-groups');
cy.intercept('DELETE', awxAPI`/instance_groups/*/`).as('deleteInstanceGroup');
cy.get('[data-ouia-component-type="PF5/ModalContent"]').within(() => {
cy.get('header').contains(`Permanently delete instance groups`);
Expand Down Expand Up @@ -187,7 +187,7 @@ describe(`Instance Groups`, () => {
cy.filterTableByMultiSelect('name', arrayOfElementText);
cy.get('tbody tr').should('have.length', 2);
cy.get('#select-all').click();
cy.clickToolbarKebabAction('delete-selected-instance-groups');
cy.clickToolbarKebabAction('delete-instance-groups');
cy.intercept('DELETE', awxAPI`/instance_groups/*/`).as('deleteInstanceGroup');
cy.get('[data-ouia-component-type="PF5/ModalContent"]').within(() => {
cy.contains(
Expand Down Expand Up @@ -247,7 +247,7 @@ describe(`Instance Groups`, () => {
cy.get('[data-cy="max-forks"]').clear();
cy.get('[data-cy="max-forks"]').type('4');
cy.intercept('POST', awxAPI`/instance_groups/`).as('createInstanceGroup');
cy.clickButton(`Create Container Group`);
cy.clickButton(`Create container group`);
cy.wait('@createInstanceGroup')
.its('response')
.then((response) => {
Expand Down Expand Up @@ -326,7 +326,7 @@ describe(`Instance Groups`, () => {
cy.filterTableByMultiSelect('name', arrayOfElementText);
cy.get('tbody tr').should('have.length', 5);
cy.getByDataCy('select-all').click();
cy.clickToolbarKebabAction('delete-selected-instance-groups');
cy.clickToolbarKebabAction('delete-instance-groups');
cy.intercept('DELETE', awxAPI`/instance_groups/*/`).as('deleteInstanceGroup');
cy.get('[data-ouia-component-type="PF5/ModalContent"]').within(() => {
cy.get('header').contains(`Permanently delete container groups`);
Expand Down Expand Up @@ -362,7 +362,7 @@ describe(`Instance Groups`, () => {
cy.filterTableByMultiSelect('name', arrayOfElementText);
cy.get('tbody tr').should('have.length', 2);
cy.get('#select-all').click();
cy.clickToolbarKebabAction('delete-selected-instance-groups');
cy.clickToolbarKebabAction('delete-instance-groups');
cy.intercept('DELETE', awxAPI`/instance_groups/*/`).as('deleteInstanceGroup');
cy.get('[data-ouia-component-type="PF5/ModalContent"]').within(() => {
cy.contains(
Expand Down
22 changes: 12 additions & 10 deletions cypress/e2e/awx/infrastructure/instances/instances.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cyLabel(['upstream'], () => {
it('can add a new instance and navigate to the details page', () => {
const instanceHostname = 'E2EInstanceTestAddEdit' + randomString(5);
// Navigate to the create instance page
cy.getByDataCy('add-instance').click();
cy.getByDataCy('create-instance').click();
cy.getByDataCy('page-title').should('contain', 'Create instance');
// Create a new instance
cy.getByDataCy('hostname').type(instanceHostname);
Expand Down Expand Up @@ -60,7 +60,7 @@ cyLabel(['upstream'], () => {
cy.getByDataCy('enabled').check();
cy.getByDataCy('managed_by_policy').check();
cy.getByDataCy('peers_from_control_nodes').check();
cy.clickButton(/^Save$/);
cy.clickButton(/^Save instance$/);
cy.wait('@editedInstance')
.its('response.body')
.then((body: Instance) => {
Expand Down Expand Up @@ -119,7 +119,7 @@ cyLabel(['upstream'], () => {
cy.getByDataCy('edit-instance').click();
cy.getByDataCy('enabled').uncheck();
cy.intercept('PATCH', awxAPI`/instances/*/`).as('editedInstance');
cy.clickButton(/^Save$/);
cy.clickButton(/^Save instance$/);
cy.wait('@editedInstance')
.then((response) => {
expect(response?.response?.statusCode).to.eql(200);
Expand Down Expand Up @@ -340,17 +340,17 @@ cyLabel(['upstream'], () => {
cy.url().then((currentUrl) => {
expect(currentUrl.includes('peers')).to.be.true;
});
cy.getByDataCy('associate-peer').click();
cy.getByDataCy('associate-peers').click();
cy.get('[data-ouia-component-type="PF5/ModalContent"]').within(() => {
cy.get('header').contains('Select Peer Addresses');
cy.get('button').contains('Associate peer(s)').should('have.attr', 'aria-disabled', 'true');
cy.get('header').contains('Select peer addresses');
cy.get('button').contains('Associate peers').should('have.attr', 'aria-disabled', 'true');
cy.filterTableBySingleText(instanceToAssociate.hostname, true);
cy.intercept('GET', awxAPI`/instances/${instanceToAssociate.id.toString()}/`).as(
'instanceA'
);
cy.getByDataCy('checkbox-column-cell').find('input').click();
cy.wait('@instanceA');
cy.get('button').contains('Associate peer(s)').click();
cy.get('button').contains('Associate peers').click();
cy.get('button').contains('Close').click();
});
cy.wait('@associatePeer')
Expand All @@ -375,15 +375,17 @@ cyLabel(['upstream'], () => {
cy.get('tbody tr').should('have.length', 1);
cy.get('[data-cy="checkbox-column-cell"] input').click();
});
cy.clickToolbarKebabAction('disassociate');
cy.clickToolbarKebabAction('disassociate-peers');
cy.intercept('PATCH', awxAPI`/instances/*/`).as('disassociatePeer');
cy.get('[data-ouia-component-type="PF5/ModalContent"]').within(() => {
cy.get('header').contains('Disassociate peers');
cy.get('button').contains('Disassociate peer').should('have.attr', 'aria-disabled', 'true');
cy.get('button')
.contains('Disassociate peers')
.should('have.attr', 'aria-disabled', 'true');
cy.getByDataCy('address-column-cell').should('have.text', instanceToAssociate.hostname);
cy.get('input[id="confirm"]').click();
cy.get('button')
.contains('Disassociate peer')
.contains('Disassociate peers')
.should('have.attr', 'aria-disabled', 'false')
.click();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ describe('Constructed Inventories CRUD Tests', () => {
cy.verifyPageTitle(newInventory.name);
cy.getByDataCy('organization').contains(organization.name);
cy.getByDataCy('edit-inventory').click();
cy.verifyPageTitle('Edit Constructed Inventory');
cy.verifyPageTitle(`Edit ${newInventory.name}`);
cy.getByDataCy('toggle-json').click();
cy.getByDataCy('source-vars').type(
`{"plugin": "constructed","strict": true,"groups": {"is_shutdown": "state | default('running') == 'shutdown'","product_dev": "account_alias == 'product_dev'"}}`,
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/awx/inventories-source/inventorySource.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('Inventory Sources', () => {
credential = cred;
goToSourceList(inventory.name);
cy.clickButton(/^Create source/);
cy.verifyPageTitle('Add new source');
cy.verifyPageTitle('Create source');
cy.getByDataCy('name').type('project source');
cy.selectDropdownOptionByResourceName('source_control_type', 'Sourced from a Project');
cy.selectDropdownOptionByResourceName('project', project.name);
Expand Down Expand Up @@ -125,7 +125,7 @@ describe('Inventory Sources', () => {
goToSourceList(inventory.name);
// Create inventory source
cy.getByDataCy('create-source').click();
cy.verifyPageTitle('Add new source');
cy.verifyPageTitle('Create source');
cy.getByDataCy('name').type('amazon ec2 source');
cy.selectDropdownOptionByResourceName('source_control_type', 'Amazon EC2');
cy.getByDataCy('host-filter').type('/^test$/');
Expand All @@ -136,7 +136,7 @@ describe('Inventory Sources', () => {
cy.getByDataCy('Submit').click();
cy.verifyPageTitle('amazon ec2 source');
cy.clickButton('Edit inventory source');
cy.verifyPageTitle('Edit source');
cy.verifyPageTitle(`Edit amazon ec2 source`);
cy.getByDataCy('name').clear().type('updated amazon ec2 source');
cy.getByDataCy('overwrite_vars').check();
cy.getByDataCy('Submit').click();
Expand All @@ -146,7 +146,7 @@ describe('Inventory Sources', () => {
// Edit inventory source
cy.clickButton('Edit inventory source');
cy.location('pathname').should('match', /\/edit$/);
cy.verifyPageTitle('Edit source');
cy.verifyPageTitle(`Edit updated amazon ec2 source`);
cy.getByDataCy('name').clear().type('new project');
cy.selectDropdownOptionByResourceName('source_control_type', 'Sourced from a Project');
cy.getByDataCy('overwrite_vars').check();
Expand Down
27 changes: 12 additions & 15 deletions cypress/e2e/awx/inventories/inventoryGroup.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('Inventory Groups', () => {
cy.verifyPageTitle(inventory.name);
cy.get(`a[href*="/groups?"]`).click();
cy.clickButton(/^Create group$/);
cy.verifyPageTitle('Create new group');
cy.verifyPageTitle('Create group');
cy.get('[data-cy="name"]').type(newGroupName);
cy.get('[data-cy="description"]').type('This is a description');
cy.dataEditorTypeByDataCy('variables', 'test: true');
Expand Down Expand Up @@ -99,11 +99,8 @@ describe('Inventory Groups', () => {
cy.getByDataCy('name-column-cell').should('contain', host.name);
cy.clickTab(/^Groups$/, true);
cy.filterTableByMultiSelect('name', [group.name]);
cy.clickTableRowAction('name', group.name, 'edit-group', {
inKebab: false,
disableFilter: true,
});
cy.verifyPageTitle('Edit group');
cy.clickTableRowKebabAction(group.name, 'edit-group', false);
cy.verifyPageTitle(`Edit ${group.name}`);
cy.get('[data-cy="name-form-group"]').type('-changed');
cy.get('[data-cy="Submit"]').click();
cy.verifyPageTitle(group.name + '-changed');
Expand Down Expand Up @@ -181,7 +178,7 @@ describe('Inventory Groups', () => {
cy.verifyPageTitle(inventory.name);
cy.get(`a[href*="/groups?"]`).click();
cy.clickButton(/^Create group$/);
cy.verifyPageTitle('Create new group');
cy.verifyPageTitle('Create group');
cy.get('[data-cy="name"]').type(newGroupName);
cy.get('[data-cy="description"]').type('This is a description');
cy.dataEditorTypeByDataCy('variables', 'test: true');
Expand Down Expand Up @@ -229,7 +226,7 @@ describe('Inventory Groups', () => {
cy.verifyPageTitle(group.name);
cy.intercept('PATCH', awxAPI`/groups/*/`).as('editGroup');
cy.get('[data-cy="edit-group"]').click();
cy.verifyPageTitle('Edit group');
cy.verifyPageTitle(`Edit ${group.name}`);
cy.get('[data-cy="name-form-group"]').type('-changed');
cy.get('[data-cy="Submit"]').click();
cy.wait('@editGroup')
Expand Down Expand Up @@ -262,7 +259,7 @@ describe('Inventory Groups', () => {
cy.verifyPageTitle(group.name);
cy.clickTab(/^Related Groups$/, true);
cy.clickButton(/^Create group/);
cy.verifyPageTitle('Create new group');
cy.verifyPageTitle('Create group');
cy.get('[data-cy="name-form-group"]').type(newRelatedGroup);
cy.get('[data-cy="Submit"]').click();
cy.contains(newRelatedGroup);
Expand Down Expand Up @@ -315,7 +312,7 @@ describe('Inventory Groups', () => {
disableFilter: true,
});
cy.intercept('PATCH', awxAPI`/groups/*/`).as('editGroup');
cy.verifyPageTitle('Edit group');
cy.verifyPageTitle(`Edit ${newGroup}`);
cy.get('[data-cy="name-form-group"]').type('-changed');
cy.get('[data-cy="Submit"]').click();
cy.wait('@editGroup')
Expand Down Expand Up @@ -361,7 +358,7 @@ describe('Inventory Groups', () => {
cy.verifyPageTitle(group.name);
cy.clickTab(/^Related Groups$/, true);
cy.clickButton(/^Create group/);
cy.verifyPageTitle('Create new group');
cy.verifyPageTitle('Create group');
cy.get('[data-cy="name-form-group"]').type(newRelatedGroup);
cy.get('[data-cy="Submit"]').click();
cy.contains(newRelatedGroup);
Expand Down Expand Up @@ -423,7 +420,7 @@ describe('Inventory Groups', () => {
cy.clickModalButton(/^Close/);
cy.intercept('POST', awxAPI`/hosts/`).as('createHost');
cy.clickButton(/^Create host$/);
cy.verifyPageTitle('Create Host');
cy.verifyPageTitle('Create host');
cy.getByDataCy('name').type(newHostName);
cy.getByDataCy('description').type('This is the description');
cy.clickButton(/^Create host$/);
Expand All @@ -432,7 +429,7 @@ describe('Inventory Groups', () => {
.then((response) => {
expect(response?.statusCode).to.eql(201);
});
cy.verifyPageTitle('Host Details');
cy.verifyPageTitle(newHostName);
cy.clickTab(/^Back to Hosts$/, true);
cy.filterTableBySingleSelect('name', newHostName);
});
Expand All @@ -447,7 +444,7 @@ describe('Inventory Groups', () => {
disableFilter: true,
});
cy.intercept('PATCH', awxAPI`/hosts/*/`).as('editHost');
cy.verifyPageTitle('Edit host');
cy.verifyPageTitle(`Edit ${thisHost.name}`);
cy.getByDataCy('name').type('-edited');
cy.getByDataCy('description').type('This is the description');
cy.clickButton(/^Save host$/);
Expand All @@ -456,7 +453,7 @@ describe('Inventory Groups', () => {
.then((response) => {
expect(response?.statusCode).to.eql(200);
});
cy.verifyPageTitle('Host Details');
cy.verifyPageTitle(`${thisHost.name}-edited`);
cy.clickTab(/^Back to Hosts$/, true);
cy.filterTableBySingleSelect('name', thisHost.name + '-edited');
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/awx/inventory-host/inventoryHostRegular.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('Inventory Host Tab Tests for regular inventory', () => {
const hostName = 'E2E Inventory host ' + randomString(4);
cy.navigateTo('awx', 'hosts');
cy.clickButton(/^Create host$/);
cy.verifyPageTitle('Create Host');
cy.verifyPageTitle('Create host');
cy.getByDataCy('name').type(hostName);
cy.getByDataCy('description').type('This is the description');
cy.singleSelectByDataCy('inventory', inventory.name);
Expand Down
7 changes: 4 additions & 3 deletions cypress/e2e/awx/workflow-approvals/wfApprovalsList.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,9 @@ describe('Workflow Approvals Tests', () => {
function deleteApprovalFromListToolbar() {
cy.get('tbody').find('tr').should('have.length', 3);
cy.getByDataCy('select-all').click();
cy.clickToolbarKebabAction('delete');

cy.getBy('[data-ouia-component-id="page-toolbar"]').within(() => {
cy.clickKebabAction('actions-dropdown', 'delete-workflow-approvals');
});
cy.getModal().within(() => {
cy.get('[data-ouia-component-id="confirm"]').click();
cy.get('[data-ouia-component-id="submit"]').click();
Expand Down Expand Up @@ -525,7 +526,7 @@ describe('Workflow Approvals Tests', () => {
cy.getByDataCy('status-column-cell').should('contain', 'Approve');
cy.getByDataCy('checkbox-column-cell').click();
});
cy.clickToolbarKebabAction('delete');
cy.clickToolbarKebabAction('delete-workflow-approvals');
cy.getModal().within(() => {
cy.get('[data-cy="alert-toaster"]').should(
'contain',
Expand Down
25 changes: 22 additions & 3 deletions cypress/e2e/hub/execution-environments.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('Execution Environments', () => {
});
});

it('can add and delete a new execution environment', () => {
it('can add, edit, and delete a new execution environment', () => {
cy.createHubRemoteRegistry().then((remoteRegistry) => {
const eeName = `execution_environment_${randomString(3, undefined, { isLowercase: true })}`;
const upstreamName = `upstream_name_${randomString(3, undefined, { isLowercase: true })}`;
Expand Down Expand Up @@ -78,6 +78,25 @@ describe('Execution Environments', () => {
cy.url().should('contain', '/execution-environments/');
cy.filterTableBySingleText(eeName);
cy.get('tbody').find('tr').should('have.length', 1);
// edit ee
cy.get('tbody').within(() => {
cy.getByDataCy('name-column-cell').should('contain', eeName);
cy.get('[data-cy="edit-execution-environment"]').click();
});
cy.get('[data-cy="description"]').click().type('nice new description');
cy.get('[data-cy="upstream-name"]').click().clear().type('pulp/pulp-fixtures/new');
cy.getByDataCy('Submit').click();
cy.url().should('contain', '/execution-environments/');
cy.filterTableBySingleText(eeName);
cy.get('[data-cy="description-column-cell"]').should('contain', 'nice new description');
cy.get('tbody').within(() => {
cy.getByDataCy('name-column-cell').should('contain', eeName);
cy.get('[data-cy="edit-execution-environment"]').click();
});
cy.get('[data-cy="upstream-name"]').click().clear().type(upstreamName);
cy.getByDataCy('Submit').click();
// delete ee
cy.filterTableBySingleText(eeName);
cy.get('tbody').within(() => {
cy.getByDataCy('name-column-cell').should('contain', eeName);
cy.get('[data-cy="actions-dropdown"]').click();
Expand Down Expand Up @@ -199,7 +218,7 @@ describe('Execution Environment Details tab', () => {
cy.get('[data-cy="readme"]').contains('this should not be saved.').should('not.exist');
});

it.skip('should successfully sync execution environment from Docker registry', () => {
it('should successfully sync execution environment from Docker registry', () => {
cy.createHubRemoteRegistry().then((remoteRegistry) => {
cy.createHubExecutionEnvironment({
executionEnvironment: {
Expand Down Expand Up @@ -234,7 +253,7 @@ describe('Execution Environment Activity tab', () => {
});
});

it.skip('should display populated activity tab', () => {
it('should display populated activity tab', () => {
cy.createHubRemoteRegistry().then((remoteRegistry) => {
cy.createHubExecutionEnvironment({
executionEnvironment: {
Expand Down
Loading

0 comments on commit fed7262

Please sign in to comment.