From 1cc525f7859cd55d86b528efc2a79811cc3d302f Mon Sep 17 00:00:00 2001 From: Tina Yip Date: Wed, 24 Jul 2024 09:59:10 -0400 Subject: [PATCH 1/7] rebase branch --- .../inventories-source/inventorySource.cy.ts | 4 +-- .../e2e/awx/inventories/inventoryGroup.cy.ts | 29 +++++++++---------- cypress/support/hostsfunctions.ts | 18 ++++++------ .../resources/inventories/InventoryForm.tsx | 25 ++++++++-------- .../InventoryPage/InventoryPage.tsx | 2 +- .../inventoryGroup/InventoryGroupForm.cy.tsx | 2 +- .../inventoryGroup/InventoryGroupForm.tsx | 22 +++++++++----- .../inventoryHostsPage/InventoryHostForm.tsx | 25 ++++++---------- .../inventoryHostsPage/InventoryHostPage.tsx | 2 +- .../sources/InventorySourceForm.cy.tsx | 2 +- .../resources/sources/InventorySourceForm.tsx | 8 ++--- 11 files changed, 69 insertions(+), 70 deletions(-) diff --git a/cypress/e2e/awx/inventories-source/inventorySource.cy.ts b/cypress/e2e/awx/inventories-source/inventorySource.cy.ts index f93dab004f..9834274b9c 100644 --- a/cypress/e2e/awx/inventories-source/inventorySource.cy.ts +++ b/cypress/e2e/awx/inventories-source/inventorySource.cy.ts @@ -124,8 +124,8 @@ describe('Inventory Sources', () => { it('can create an Amazon EC2 Inventory Source and access the Edit form from its details page, ', () => { goToSourceList(inventory.name); // Create inventory source - cy.getByDataCy('create-source').click(); - cy.verifyPageTitle('Add new source'); + cy.getByDataCy('add-source').click(); + cy.verifyPageTitle('Create source'); cy.getByDataCy('name').type('amazon ec2 source'); cy.selectDropdownOptionByResourceName('source_control_type', 'Amazon EC2'); cy.getByDataCy('host-filter').type('/^test$/'); diff --git a/cypress/e2e/awx/inventories/inventoryGroup.cy.ts b/cypress/e2e/awx/inventories/inventoryGroup.cy.ts index ebaef791e0..7b757781b9 100644 --- a/cypress/e2e/awx/inventories/inventoryGroup.cy.ts +++ b/cypress/e2e/awx/inventories/inventoryGroup.cy.ts @@ -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'); @@ -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'); @@ -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'); @@ -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') @@ -261,8 +258,8 @@ describe('Inventory Groups', () => { cy.clickTableRowLink('name', group.name, { disableFilter: true }); cy.verifyPageTitle(group.name); cy.clickTab(/^Related Groups$/, true); - cy.clickButton(/^Create group/); - cy.verifyPageTitle('Create new group'); + cy.clickButton(/^New group/); + cy.verifyPageTitle('Create group'); cy.get('[data-cy="name-form-group"]').type(newRelatedGroup); cy.get('[data-cy="Submit"]').click(); cy.contains(newRelatedGroup); @@ -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') @@ -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); @@ -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$/); @@ -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); }); @@ -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$/); @@ -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'); }); diff --git a/cypress/support/hostsfunctions.ts b/cypress/support/hostsfunctions.ts index 8f11aec1d6..6363d90447 100644 --- a/cypress/support/hostsfunctions.ts +++ b/cypress/support/hostsfunctions.ts @@ -21,12 +21,12 @@ 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'); if (host_type === 'stand_alone_host') { - cy.singleSelectByDataCy('inventory', inventory); + cy.singleSelectByDataCy('[data-cy="inventory-form-group"]', inventory); } // after creation - verify data is currect @@ -55,19 +55,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'); @@ -155,7 +155,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'); @@ -271,7 +271,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$/); @@ -317,7 +317,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'); diff --git a/frontend/awx/resources/inventories/InventoryForm.tsx b/frontend/awx/resources/inventories/InventoryForm.tsx index dd4daa12be..99f5045847 100644 --- a/frontend/awx/resources/inventories/InventoryForm.tsx +++ b/frontend/awx/resources/inventories/InventoryForm.tsx @@ -98,10 +98,10 @@ export function CreateInventory(props: { inventoryKind: '' | 'constructed' | 'sm const getPageUrl = useGetPageUrl(); const title = inventoryKind === '' - ? t('Create Inventory') + ? t('Create inventory') : inventoryKind === 'smart' - ? t('Create Smart Inventory') - : t('Create Constructed Inventory'); + ? t('Create smart inventory') + : t('Create constructed inventory'); const defaultValue = inventoryKind === 'smart' @@ -257,13 +257,6 @@ export function EditInventory() { ); } - const title = - inventory.kind === '' - ? t('Edit Inventory') - : inventory.kind === 'smart' - ? t('Edit Smart Inventory') - : t('Edit Constructed Inventory'); - const defaultValue = inventory.kind === 'smart' ? { ...inventory, instanceGroups: originalInstanceGroups } @@ -282,10 +275,18 @@ export function EditInventory() { return ( diff --git a/frontend/awx/resources/inventories/InventoryPage/InventoryPage.tsx b/frontend/awx/resources/inventories/InventoryPage/InventoryPage.tsx index 98abae390b..8b2552c2d9 100644 --- a/frontend/awx/resources/inventories/InventoryPage/InventoryPage.tsx +++ b/frontend/awx/resources/inventories/InventoryPage/InventoryPage.tsx @@ -139,7 +139,7 @@ export function InventoryPage() { !isSmartInventory && !isConstructedInventory && { label: t('Sources'), page: AwxRoute.InventorySources }, { label: t('Jobs'), page: AwxRoute.InventoryJobs }, - { label: t('Job templates'), page: AwxRoute.InventoryJobTemplates }, + { label: t('Job Templates'), page: AwxRoute.InventoryJobTemplates }, ]} params={params} componentParams={{ inventory }} diff --git a/frontend/awx/resources/inventories/inventoryGroup/InventoryGroupForm.cy.tsx b/frontend/awx/resources/inventories/inventoryGroup/InventoryGroupForm.cy.tsx index 98712a9bc8..cb9812aae1 100644 --- a/frontend/awx/resources/inventories/inventoryGroup/InventoryGroupForm.cy.tsx +++ b/frontend/awx/resources/inventories/inventoryGroup/InventoryGroupForm.cy.tsx @@ -21,7 +21,7 @@ describe('CreateGroup', () => { .its('results') .should('be.an', 'array') .then(() => { - cy.contains('Create new group'); + cy.contains('Create group'); }); }); diff --git a/frontend/awx/resources/inventories/inventoryGroup/InventoryGroupForm.tsx b/frontend/awx/resources/inventories/inventoryGroup/InventoryGroupForm.tsx index 948ef655e8..bbc6afbc43 100644 --- a/frontend/awx/resources/inventories/inventoryGroup/InventoryGroupForm.tsx +++ b/frontend/awx/resources/inventories/inventoryGroup/InventoryGroupForm.tsx @@ -26,7 +26,7 @@ interface GroupFormPageHeaderProps { interface BreadCrumbLink { label: string; - to: string; + to?: string; } type BreadCrumbs = Record; @@ -66,7 +66,7 @@ function GroupFormPageHeader(props: GroupFormPageHeaderProps) { }), }, relatedGroups: { - label: t('Related groups'), + label: t('Related Groups'), to: getPageUrl(AwxRoute.InventoryGroupRelatedGroups, { params: { ...breadcrumbsParams.id, @@ -75,6 +75,8 @@ function GroupFormPageHeader(props: GroupFormPageHeaderProps) { }, }), }, + createGroup: { label: t('Create group') }, + editGroup: { label: t('Edit {{groupName}}', { groupName: props.groupName }) }, }; return ( @@ -97,12 +99,17 @@ export function CreateGroup() { if (error) return ; if (!inventory) return ; - const breadcrumbs: Array = ['inventories', 'inventory', 'groups']; + const breadcrumbs: Array = [ + 'inventories', + 'inventory', + 'groups', + 'createGroup', + ]; return ( ; if (!group) return ; - const breadcrumbs: Array = ['inventories', 'inventory', 'groups', 'group']; + const breadcrumbs: Array = ['inventories', 'inventory', 'groups', 'editGroup']; return ( - + - + submitText={t('Save host')} onSubmit={onSubmit} diff --git a/frontend/awx/resources/inventories/inventoryHostsPage/InventoryHostPage.tsx b/frontend/awx/resources/inventories/inventoryHostsPage/InventoryHostPage.tsx index d9947292b0..dbdd1e7ac7 100644 --- a/frontend/awx/resources/inventories/inventoryHostsPage/InventoryHostPage.tsx +++ b/frontend/awx/resources/inventories/inventoryHostsPage/InventoryHostPage.tsx @@ -52,7 +52,7 @@ export function InventoryHostPage() { return ( { it('renders create new source page', () => { cy.mount(); - cy.contains('Add new source'); + cy.contains('Create source'); }); it('disables save button when name is empty', () => { diff --git a/frontend/awx/resources/sources/InventorySourceForm.tsx b/frontend/awx/resources/sources/InventorySourceForm.tsx index 5d8fc63633..72c0fcfe8b 100644 --- a/frontend/awx/resources/sources/InventorySourceForm.tsx +++ b/frontend/awx/resources/sources/InventorySourceForm.tsx @@ -79,7 +79,7 @@ export function CreateInventorySource() { return ( Date: Thu, 22 Aug 2024 17:16:48 -0400 Subject: [PATCH 2/7] updates to failing tests --- cypress/e2e/awx/infrastructure/hosts/hosts.cy.ts | 4 ++-- .../awx/inventories-constructed/inventoriesConstructed.cy.ts | 2 +- cypress/e2e/awx/inventories-source/inventorySource.cy.ts | 4 ++-- cypress/e2e/awx/inventory-host/inventoryHostRegular.cy.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/awx/infrastructure/hosts/hosts.cy.ts b/cypress/e2e/awx/infrastructure/hosts/hosts.cy.ts index 7387098170..0741c9d64e 100644 --- a/cypress/e2e/awx/infrastructure/hosts/hosts.cy.ts +++ b/cypress/e2e/awx/infrastructure/hosts/hosts.cy.ts @@ -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); @@ -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); diff --git a/cypress/e2e/awx/inventories-constructed/inventoriesConstructed.cy.ts b/cypress/e2e/awx/inventories-constructed/inventoriesConstructed.cy.ts index d508eb93f0..c06099314a 100644 --- a/cypress/e2e/awx/inventories-constructed/inventoriesConstructed.cy.ts +++ b/cypress/e2e/awx/inventories-constructed/inventoriesConstructed.cy.ts @@ -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 ${constructedInv.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'"}}`, diff --git a/cypress/e2e/awx/inventories-source/inventorySource.cy.ts b/cypress/e2e/awx/inventories-source/inventorySource.cy.ts index 9834274b9c..fdbd670418 100644 --- a/cypress/e2e/awx/inventories-source/inventorySource.cy.ts +++ b/cypress/e2e/awx/inventories-source/inventorySource.cy.ts @@ -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); @@ -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 ${inventorySource.name}`); cy.getByDataCy('name').clear().type('new project'); cy.selectDropdownOptionByResourceName('source_control_type', 'Sourced from a Project'); cy.getByDataCy('overwrite_vars').check(); diff --git a/cypress/e2e/awx/inventory-host/inventoryHostRegular.cy.ts b/cypress/e2e/awx/inventory-host/inventoryHostRegular.cy.ts index 40ac0a5d4e..29cca81531 100644 --- a/cypress/e2e/awx/inventory-host/inventoryHostRegular.cy.ts +++ b/cypress/e2e/awx/inventory-host/inventoryHostRegular.cy.ts @@ -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); From 78a49a39996358d22c087a05277760c310460e48 Mon Sep 17 00:00:00 2001 From: Tina Yip Date: Mon, 26 Aug 2024 10:02:47 -0400 Subject: [PATCH 3/7] updates to failing tests --- cypress/e2e/awx/infrastructure/hosts/hosts.cy.ts | 2 +- cypress/e2e/awx/inventories-source/inventorySource.cy.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/awx/infrastructure/hosts/hosts.cy.ts b/cypress/e2e/awx/infrastructure/hosts/hosts.cy.ts index 0741c9d64e..953998cb15 100644 --- a/cypress/e2e/awx/infrastructure/hosts/hosts.cy.ts +++ b/cypress/e2e/awx/infrastructure/hosts/hosts.cy.ts @@ -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'); diff --git a/cypress/e2e/awx/inventories-source/inventorySource.cy.ts b/cypress/e2e/awx/inventories-source/inventorySource.cy.ts index fdbd670418..adc99237aa 100644 --- a/cypress/e2e/awx/inventories-source/inventorySource.cy.ts +++ b/cypress/e2e/awx/inventories-source/inventorySource.cy.ts @@ -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 ${inventorySource.name}`); cy.getByDataCy('name').clear().type('updated amazon ec2 source'); cy.getByDataCy('overwrite_vars').check(); cy.getByDataCy('Submit').click(); From 8e5412486b7cbb5f6d1f28330764c569ff3aec2e Mon Sep 17 00:00:00 2001 From: Tina Yip Date: Mon, 26 Aug 2024 11:36:51 -0400 Subject: [PATCH 4/7] try to fix failing tests --- cypress/e2e/awx/inventories-source/inventorySource.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/awx/inventories-source/inventorySource.cy.ts b/cypress/e2e/awx/inventories-source/inventorySource.cy.ts index adc99237aa..007fb6b00e 100644 --- a/cypress/e2e/awx/inventories-source/inventorySource.cy.ts +++ b/cypress/e2e/awx/inventories-source/inventorySource.cy.ts @@ -124,7 +124,7 @@ describe('Inventory Sources', () => { it('can create an Amazon EC2 Inventory Source and access the Edit form from its details page, ', () => { goToSourceList(inventory.name); // Create inventory source - cy.getByDataCy('add-source').click(); + cy.getByDataCy('create-source').click(); cy.verifyPageTitle('Create source'); cy.getByDataCy('name').type('amazon ec2 source'); cy.selectDropdownOptionByResourceName('source_control_type', 'Amazon EC2'); From bc4a2db63f7f4fc23375bc7ae0d32bf7a33882bf Mon Sep 17 00:00:00 2001 From: Maeve Hoffer Date: Mon, 26 Aug 2024 11:45:01 -0700 Subject: [PATCH 5/7] fix page title in inventoriesConstructed and inventorySource tests --- .../awx/inventories-constructed/inventoriesConstructed.cy.ts | 2 +- cypress/e2e/awx/inventories-source/inventorySource.cy.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/awx/inventories-constructed/inventoriesConstructed.cy.ts b/cypress/e2e/awx/inventories-constructed/inventoriesConstructed.cy.ts index c06099314a..8740d9a599 100644 --- a/cypress/e2e/awx/inventories-constructed/inventoriesConstructed.cy.ts +++ b/cypress/e2e/awx/inventories-constructed/inventoriesConstructed.cy.ts @@ -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 ${constructedInv.name}`); + 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'"}}`, diff --git a/cypress/e2e/awx/inventories-source/inventorySource.cy.ts b/cypress/e2e/awx/inventories-source/inventorySource.cy.ts index 007fb6b00e..77d4ea3a10 100644 --- a/cypress/e2e/awx/inventories-source/inventorySource.cy.ts +++ b/cypress/e2e/awx/inventories-source/inventorySource.cy.ts @@ -136,7 +136,7 @@ describe('Inventory Sources', () => { cy.getByDataCy('Submit').click(); cy.verifyPageTitle('amazon ec2 source'); cy.clickButton('Edit inventory source'); - cy.verifyPageTitle(`Edit ${inventorySource.name}`); + cy.verifyPageTitle(`Edit amazon ec2 source`); cy.getByDataCy('name').clear().type('updated amazon ec2 source'); cy.getByDataCy('overwrite_vars').check(); cy.getByDataCy('Submit').click(); @@ -146,7 +146,7 @@ describe('Inventory Sources', () => { // Edit inventory source cy.clickButton('Edit inventory source'); cy.location('pathname').should('match', /\/edit$/); - cy.verifyPageTitle(`Edit ${inventorySource.name}`); + 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(); From f63814700e4982bdc1558c326fd67b61134fdf30 Mon Sep 17 00:00:00 2001 From: Maeve Hoffer Date: Mon, 26 Aug 2024 15:19:32 -0700 Subject: [PATCH 6/7] fix assertion of button text in inventoryGroup --- cypress/e2e/awx/inventories/inventoryGroup.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/awx/inventories/inventoryGroup.cy.ts b/cypress/e2e/awx/inventories/inventoryGroup.cy.ts index 7b757781b9..c0ff72672e 100644 --- a/cypress/e2e/awx/inventories/inventoryGroup.cy.ts +++ b/cypress/e2e/awx/inventories/inventoryGroup.cy.ts @@ -258,7 +258,7 @@ describe('Inventory Groups', () => { cy.clickTableRowLink('name', group.name, { disableFilter: true }); cy.verifyPageTitle(group.name); cy.clickTab(/^Related Groups$/, true); - cy.clickButton(/^New group/); + cy.clickButton(/^Create group/); cy.verifyPageTitle('Create group'); cy.get('[data-cy="name-form-group"]').type(newRelatedGroup); cy.get('[data-cy="Submit"]').click(); From dba3b24fdb4393180000a6621c42524f5ef7a1c0 Mon Sep 17 00:00:00 2001 From: Tina Yip <98424339+tiyiprh@users.noreply.github.com> Date: Tue, 27 Aug 2024 08:56:34 -0400 Subject: [PATCH 7/7] Update cypress/support/hostsfunctions.ts Co-authored-by: Martin Hradil --- cypress/support/hostsfunctions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/hostsfunctions.ts b/cypress/support/hostsfunctions.ts index 6363d90447..93a51b1d3e 100644 --- a/cypress/support/hostsfunctions.ts +++ b/cypress/support/hostsfunctions.ts @@ -26,7 +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.singleSelectByDataCy('[data-cy="inventory-form-group"]', inventory); + cy.singleSelectByDataCy('inventory-form-group', inventory); } // after creation - verify data is currect