Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
acruzgon committed Jul 16, 2024
1 parent 2eed084 commit 503193c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cypress/support/hostsfunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function createAndCheckHost(host_type: string, inventory: string) {

// create host
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');

Expand Down Expand Up @@ -61,19 +61,19 @@ export function createHost(host_type: string, inventoryID: number) {
return hostName;
}

function editHost(invenotryName: string, host_type: string, hostName: string, view: string) {
function editHost(inventoryName: string, host_type: string, hostName: string, view: string) {
// function that editing host data from list or details views
// this function cover both inventory host and stand alone host
if (view === 'list') {
navigateToBaseView(host_type, invenotryName);
navigateToBaseView(host_type, inventoryName);
cy.filterTableByMultiSelect('name', [hostName]);
} else {
// for details view
navigateToHost(host_type, hostName, '[data-cy="name-column-cell"] a', invenotryName);
navigateToHost(host_type, hostName, '[data-cy="name-column-cell"] a', inventoryName);
}

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 @@ -161,7 +161,7 @@ export function checkHostGroup(host_type: string, organization: Organization) {
cy.clickLink(/^Groups$/);
//check edit group
cy.getByDataCy('edit-group').click();
cy.verifyPageTitle('Edit group');
cy.verifyPageTitle(`Edit ${group.name}`);
cy.getByDataCy('name-form-group').type('-changed');
cy.getByDataCy('Submit').click();
cy.verifyPageTitle(group.name + '-changed');
Expand Down Expand Up @@ -277,7 +277,7 @@ export function createHostAndCancelJob(
cy.navigateTo('awx', 'inventories');
cy.filterTableByMultiSelect('name', [inventory.name]);
cy.get('[data-cy="name-column-cell"]').contains(inventory.name).click();
cy.get('.pf-v5-c-tabs__item > a').contains('Job templates').click();
cy.get('.pf-v5-c-tabs__item > a').contains('Job Templates').click();
// run a template and wait for redirect to Job output
cy.get('[data-cy="launch-template"]').first().click();
cy.location('pathname').should('match', /\/output$/);
Expand Down Expand Up @@ -323,7 +323,7 @@ export function launchHostJob(
cy.navigateTo('awx', 'inventories');
cy.filterTableByMultiSelect('name', [inventory.name]);
cy.get('[data-cy="name-column-cell"]').contains(inventory.name).click();
cy.contains(`[role='tab']`, 'Job templates').click();
cy.contains(`[role='tab']`, 'Job Templates').click();

// run a template and wait for request
cy.intercept('POST', awxAPI`/job_templates/*/launch`).as('launch');
Expand Down

0 comments on commit 503193c

Please sign in to comment.