Skip to content

Commit

Permalink
fixing assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
akus062381 committed Aug 27, 2024
1 parent 946d3b9 commit 72bae9e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
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-instance-groups');
cy.clickToolbarKebabAction('delete-selected-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-instance-groups');
cy.clickToolbarKebabAction('delete-selected-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-instance-groups');
cy.clickToolbarKebabAction('delete-selected-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-instance-groups');
cy.clickToolbarKebabAction('delete-selected-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: 10 additions & 12 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('create-instance').click();
cy.getByDataCy('add-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 instance$/);
cy.clickButton(/^Save$/);
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 instance$/);
cy.clickButton(/^Save$/);
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-peers').click();
cy.getByDataCy('associate-peer').click();
cy.get('[data-ouia-component-type="PF5/ModalContent"]').within(() => {
cy.get('header').contains('Select peer addresses');
cy.get('button').contains('Associate peers').should('have.attr', 'aria-disabled', 'true');
cy.get('header').contains('Select Peer Addresses');
cy.get('button').contains('Associate peer(s)').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 peers').click();
cy.get('button').contains('Associate peer(s)').click();
cy.get('button').contains('Close').click();
});
cy.wait('@associatePeer')
Expand All @@ -375,17 +375,15 @@ cyLabel(['upstream'], () => {
cy.get('tbody tr').should('have.length', 1);
cy.get('[data-cy="checkbox-column-cell"] input').click();
});
cy.clickToolbarKebabAction('disassociate-peers');
cy.clickToolbarKebabAction('disassociate');
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 peers')
.should('have.attr', 'aria-disabled', 'true');
cy.get('button').contains('Disassociate peer').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 peers')
.contains('Disassociate peer')
.should('have.attr', 'aria-disabled', 'false')
.click();
});
Expand Down

0 comments on commit 72bae9e

Please sign in to comment.