From 616891aa5e42e02cba93373a8e65026bc89cd0d5 Mon Sep 17 00:00:00 2001 From: Tina Yip Date: Thu, 22 Aug 2024 13:39:39 -0400 Subject: [PATCH 1/2] rebase and requested change --- .../credential-types/credentialTypes.cy.ts | 8 ++++---- .../e2e/awx/access/credentials/credentials.cy.ts | 10 +++++----- cypress/support/awx-commands.ts | 2 +- .../credential-types/CredentialTypeForm.cy.tsx | 2 +- .../credential-types/CredentialTypeForm.tsx | 16 ++++++++++++---- .../awx/access/credentials/CredentialForm.tsx | 16 ++++++++++++---- 6 files changed, 35 insertions(+), 19 deletions(-) diff --git a/cypress/e2e/awx/access/credential-types/credentialTypes.cy.ts b/cypress/e2e/awx/access/credential-types/credentialTypes.cy.ts index 2bf847fbe3..dd5633d8b9 100644 --- a/cypress/e2e/awx/access/credential-types/credentialTypes.cy.ts +++ b/cypress/e2e/awx/access/credential-types/credentialTypes.cy.ts @@ -106,7 +106,7 @@ describe('Credential Types', () => { cy.navigateTo('awx', 'credential-types'); cy.filterTableByMultiSelect('name', [credType1.name]); cy.getByDataCy('edit-credential-type').click(); - cy.verifyPageTitle('Edit Credential Type'); + cy.verifyPageTitle(`Edit ${credType1.name}`); cy.url().should('contain', `/credential-types/${credType1.id}/edit`); cy.getBy('[class*="view-lines monaco-mouse-cursor-text"]') .eq(0) @@ -137,7 +137,7 @@ describe('Credential Types', () => { it('can create a new credential type with no configs', () => { cy.createAndDeleteCustomAWXCredentialTypeUI(customCredentialTypeName); - cy.verifyPageTitle('Credential Types'); + cy.verifyPageTitle('Create Types'); }); it('creates a custom credential type with input and injector configurations in JSON format in the Monaco editor', () => { @@ -198,7 +198,7 @@ describe('Credential Types', () => { const editedCredentialTypeName = (credType1.name ?? '') + ' edited'; cy.filterTableByMultiSelect('name', [credType1.name]); cy.clickTableRowPinnedAction(credType1.name, 'edit-credential-type', false); - cy.verifyPageTitle('Edit Credential Type'); + cy.verifyPageTitle(`Edit ${credType1.name}`); cy.url().then((currentUrl) => { expect(currentUrl.includes('edit')).to.be.true; }); @@ -244,7 +244,7 @@ describe('Credential Types', () => { cy.filterTableByMultiSelect('name', [credType1.name]); cy.clickTableRowLink('name', credType1.name, { disableFilter: true }); cy.clickButton('Edit credential type'); - cy.verifyPageTitle('Edit Credential Type'); + cy.verifyPageTitle(`Edit ${credType1.name}`); cy.get('[data-cy="name"]').clear().type(editedCredentialTypeName); cy.get('[data-cy="description"]').clear().type('this is a new description after editing'); cy.intercept('PATCH', awxAPI`/credential_types/${credType1.id.toString()}/`).as( diff --git a/cypress/e2e/awx/access/credentials/credentials.cy.ts b/cypress/e2e/awx/access/credentials/credentials.cy.ts index 6b18535fa2..60cfc45fb4 100644 --- a/cypress/e2e/awx/access/credentials/credentials.cy.ts +++ b/cypress/e2e/awx/access/credentials/credentials.cy.ts @@ -50,7 +50,7 @@ describe('Credentials', () => { cy.get(`[data-cy="row-id-${credential.id}"]`).within(() => { cy.getByDataCy('edit-credential').click(); }); - cy.verifyPageTitle('Edit Credential'); + cy.verifyPageTitle(`Edit ${credential.name}`); cy.getByDataCy('name').clear().type(`${credential.name} - edited`); cy.clickButton(/^Save credential$/); cy.clearAllFilters(); @@ -173,7 +173,7 @@ describe('Credentials', () => { disableFilter: true, }); cy.clickButton(/^Edit credential$/); - cy.verifyPageTitle('Edit Credential'); + cy.verifyPageTitle(`Edit ${credential.name}`); cy.getByDataCy('name') .clear() .type(credential.name + '-edited'); @@ -415,7 +415,7 @@ describe('Credentials: Credential Types Tests', () => { cy.contains('Vault Password').should('be.visible'); cy.getByDataCy('vault-password').contains('Encrypted'); cy.getByDataCy('edit-credential').click(); - cy.verifyPageTitle('Edit Credential'); + cy.verifyPageTitle(`Edit ${credentialName}`); cy.get('[data-cy="vault-password"]').then(($pwd) => { cy.wrap($pwd).should('have.value', 'ENCRYPTED'); }); @@ -463,7 +463,7 @@ describe('Credentials: Credential Types Tests', () => { cy.getByDataCy('label-description').contains('Description'); cy.getByDataCy('description').contains('description'); cy.getByDataCy('edit-credential').click(); - cy.verifyPageTitle('Edit Credential'); + cy.verifyPageTitle(`Edit ${credentialName}`); const ModifiedCredentialName = credentialName + ' - edited'; cy.getByDataCy('name').type(ModifiedCredentialName); cy.get('input[data-cy="username"]').then(($username) => { @@ -521,7 +521,7 @@ describe('Credentials: Credential Types Tests', () => { cy.contains('Password').should('be.visible'); cy.getByDataCy('password').contains('Prompt on launch'); cy.getByDataCy('edit-credential').click(); - cy.verifyPageTitle('Edit Credential'); + cy.verifyPageTitle(`Edit ${credentialName}`); cy.getByDataCy('ask_password').uncheck(); cy.getByDataCy('password').type('password'); cy.clickButton(/^Save credential$/); diff --git a/cypress/support/awx-commands.ts b/cypress/support/awx-commands.ts index 3351254e80..b8663a6427 100644 --- a/cypress/support/awx-commands.ts +++ b/cypress/support/awx-commands.ts @@ -285,7 +285,7 @@ Cypress.Commands.add( const credentialTypeDesc = 'This is a custom credential type that is not managed'; cy.navigateTo('awx', 'credential-types'); cy.clickLink(/^Create credential type$/); - cy.verifyPageTitle('Create Credential Type'); + cy.verifyPageTitle('Create credential type'); cy.url().then((currentUrl) => { expect(currentUrl.includes('/credential-types/create')).to.be.true; }); diff --git a/frontend/awx/access/credential-types/CredentialTypeForm.cy.tsx b/frontend/awx/access/credential-types/CredentialTypeForm.cy.tsx index 5c512d8cde..2d6d1ad0f3 100644 --- a/frontend/awx/access/credential-types/CredentialTypeForm.cy.tsx +++ b/frontend/awx/access/credential-types/CredentialTypeForm.cy.tsx @@ -60,7 +60,7 @@ describe('CredentialTypeForm.cy.ts', () => { it('should preload the form with current values', () => { cy.mount(); - cy.verifyPageTitle('Edit Credential Type'); + cy.verifyPageTitle('Edit Mock Credential Type'); cy.get('[data-cy="name"]').should('have.value', 'Mock Credential Type'); cy.get('[data-cy="description"]').should('have.value', 'mock credential type description'); cy.dataEditorShouldContain('[data-cy="inputs"]', credentialType.inputs); diff --git a/frontend/awx/access/credential-types/CredentialTypeForm.tsx b/frontend/awx/access/credential-types/CredentialTypeForm.tsx index 9461e73bc0..3afe12772f 100644 --- a/frontend/awx/access/credential-types/CredentialTypeForm.tsx +++ b/frontend/awx/access/credential-types/CredentialTypeForm.tsx @@ -38,10 +38,10 @@ export function CreateCredentialType() { return ( @@ -79,10 +79,18 @@ export function EditCredentialType() { return ( {hasCredentialType && ( diff --git a/frontend/awx/access/credentials/CredentialForm.tsx b/frontend/awx/access/credentials/CredentialForm.tsx index b0002c1cee..e80a9d5726 100644 --- a/frontend/awx/access/credentials/CredentialForm.tsx +++ b/frontend/awx/access/credentials/CredentialForm.tsx @@ -170,10 +170,10 @@ export function CreateCredential() { return ( Date: Thu, 22 Aug 2024 14:40:10 -0400 Subject: [PATCH 2/2] update fix --- cypress/e2e/awx/access/credential-types/credentialTypes.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/awx/access/credential-types/credentialTypes.cy.ts b/cypress/e2e/awx/access/credential-types/credentialTypes.cy.ts index dd5633d8b9..9043e92bc7 100644 --- a/cypress/e2e/awx/access/credential-types/credentialTypes.cy.ts +++ b/cypress/e2e/awx/access/credential-types/credentialTypes.cy.ts @@ -137,7 +137,7 @@ describe('Credential Types', () => { it('can create a new credential type with no configs', () => { cy.createAndDeleteCustomAWXCredentialTypeUI(customCredentialTypeName); - cy.verifyPageTitle('Create Types'); + cy.verifyPageTitle('Credential Types'); }); it('creates a custom credential type with input and injector configurations in JSON format in the Monaco editor', () => {