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

Select Dialog Fixes #3034

Merged
merged 2 commits into from
Aug 21, 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
24 changes: 4 additions & 20 deletions cypress/e2e/awx/infrastructure/hosts/hosts.cy.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { randomString } from '../../../../../framework/utils/random-string';
import { Inventory } from '../../../../../frontend/awx/interfaces/Inventory';
import { Organization } from '../../../../../frontend/awx/interfaces/Organization';
import { Project } from '../../../../../frontend/awx/interfaces/Project';
import { randomString } from '../../../../../framework/utils/random-string';
import { awxAPI } from '../../../../support/formatApiPathForAwx';
import {
checkHostGroup,
createHostAndCancelJob,
launchHostJob,
} from '../../../../support/hostsfunctions';
import { awxAPI } from '../../../../support/formatApiPathForAwx';

describe('Host Tests', () => {
let organization: Organization;
Expand Down Expand Up @@ -39,15 +39,7 @@ describe('Host Tests', () => {
cy.verifyPageTitle('Create Host');
cy.getByDataCy('name').type(hostName);
cy.getByDataCy('description').type('This is the description');
cy.getByDataCy('inventory').click();
cy.contains('button', 'Browse').click();
cy.intercept('GET', awxAPI`/inventories/?*`).as('inventories');
cy.getModal().within(() => {
cy.filterTableBySingleSelect('name', inventory.name);
cy.wait('@inventories');
cy.get(`[data-cy="checkbox-column-cell"] input`).click();
cy.contains('button', 'Confirm').click();
});
cy.singleSelectByDataCy('inventory', inventory.name);
cy.getByDataCy('variables').type('test: true');
cy.clickButton(/^Create host/);
cy.hasDetail(/^Name$/, hostName);
Expand Down Expand Up @@ -93,15 +85,7 @@ describe('Host Tests', () => {
cy.verifyPageTitle('Create Host');
cy.getByDataCy('name').type(hostName);
cy.getByDataCy('description').type('This is the description');
cy.getByDataCy('inventory').click();
cy.contains('button', 'Browse').click();
cy.intercept('GET', awxAPI`/inventories/?*`).as('inventories');
cy.getModal().within(() => {
cy.filterTableBySingleSelect('name', inventory.name);
cy.wait('@inventories');
cy.get(`[data-cy="checkbox-column-cell"] input`).click();
cy.contains('button', 'Confirm').click();
});
cy.singleSelectByDataCy('inventory', inventory.name);
cy.getByDataCy('variables').type('test: true');
cy.clickButton(/^Create host/);
cy.hasDetail(/^Name$/, hostName);
Expand Down
15 changes: 1 addition & 14 deletions cypress/e2e/awx/inventories/inventories.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,20 +179,7 @@ describe('Inventories Tests', () => {
cy.getByDataCy('create-smart-inventory').click();
cy.getByDataCy('name').type(name);
cy.getByDataCy('description').type('description');
cy.getByDataCy('organization').click();
cy.contains('button', 'Browse').click();
cy.get(`[role="dialog"]`).within(() => {
cy.get(`[aria-label="Simple table"] tr`);
cy.contains('button', 'Cancel');
cy.contains('button', 'Confirm');
cy.get('#filter');
});
cy.get(`[role="dialog"]`).within(() => {
cy.filterTableByMultiSelect('name', [org.name]);
cy.get(`[aria-label="Simple table"] tr`).should('have.length', 2);
cy.get(`input[type="radio"]`).click();
cy.contains('button', 'Confirm').click();
});
cy.singleSelectByDataCy('organization', org.name);
cy.getByDataCy('host-filter').type('name=host1');
cy.getByDataCy('Submit').click();
cy.getByDataCy('name').should('have.text', name);
Expand Down
8 changes: 1 addition & 7 deletions cypress/e2e/awx/inventory-host/inventoryHostRegular.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,7 @@ describe('Inventory Host Tab Tests for regular inventory', () => {
cy.verifyPageTitle('Create Host');
cy.getByDataCy('name').type(hostName);
cy.getByDataCy('description').type('This is the description');
cy.getByDataCy('inventory').click();
cy.contains('button', 'Browse').click();
cy.getModal().within(() => {
cy.filterTableBySingleSelect('name', inventory.name);
cy.get(`[data-cy="checkbox-column-cell"] input`).click();
cy.contains('button', 'Confirm').click();
});
cy.singleSelectByDataCy('inventory', inventory.name);
cy.getByDataCy('variables').type('test: true');
cy.clickButton(/^Create host/);
cy.hasDetail(/^Name$/, hostName);
Expand Down
19 changes: 1 addition & 18 deletions cypress/e2e/awx/notifiers/notifiersSharedFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,24 +90,7 @@ export function testDelete(name: string, options?: { details?: boolean }) {
}

export function selectOrganization(orgName: string) {
cy.get(`[data-cy="organization"]`).click();
cy.contains('button', 'Browse').click();

// sync dialog
cy.intercept('GET', awxAPI`/organizations/*`).as('orgList');
cy.get(`[role="dialog"]`).within(() => {
cy.contains('button', 'Confirm');
cy.contains('button', 'Cancel');
cy.wait('@orgList');
cy.get(`[aria-label="Simple table"]`);
});

cy.filterTableByMultiSelect('name', [orgName]);
cy.get(`[aria-label="Simple table"] tr`).should('have.length', 2);

cy.contains(`[aria-label="Simple table"]`, orgName);
cy.get(`[aria-label="Select row 0"]`).click();
cy.contains('button', 'Confirm').click();
cy.singleSelectByDataCy('organization', orgName);
}

function fillBasicData(notificationName: string, type: string) {
Expand Down
8 changes: 1 addition & 7 deletions cypress/support/hostsfunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ export function createAndCheckHost(host_type: string, inventory: string) {
cy.getByDataCy('description').type('This is the description');

if (host_type === 'stand_alone_host') {
cy.getByDataCy('inventory').click();
cy.contains('button', 'Browse').click();
cy.getModal().within(() => {
cy.filterTableBySingleSelect('name', inventory);
cy.get(`[data-cy="checkbox-column-cell"] input`).click();
cy.contains('button', 'Confirm').click();
});
cy.singleSelectByDataCy('inventory', inventory);
}

// after creation - verify data is currect
Expand Down
Loading