Skip to content

Commit

Permalink
updates to cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tiyiprh committed Jun 19, 2024
1 parent 696d607 commit 8951bc2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/awx/administration/credentialTypes.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,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;
});
Expand Down Expand Up @@ -241,7 +241,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', `api/v2/credential_types/${credType1.id}/`).as('editCredType');
Expand Down
10 changes: 5 additions & 5 deletions cypress/e2e/awx/resources/credentials.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('Credentials', () => {
cy.contains('Vault Password').should('be.visible');
cy.get('[data-cy="vault-password"]').contains('Encrypted');
cy.get('[data-cy="edit-credential"]').click();
cy.verifyPageTitle('Edit Credential');
cy.verifyPageTitle(`Edit ${credentialName}`);
cy.get('[data-cy="vault-id"]').should('have.attr', 'disabled');
cy.get('[data-cy="vault-password"]').should('be.visible');
cy.get('[data-cy="vault-password"]').then(($input) => {
Expand Down Expand Up @@ -157,7 +157,7 @@ describe('Credentials', () => {
cy.contains('Password').should('be.visible');
cy.get('[data-cy="password"]').contains('Prompt on launch');
cy.get('[data-cy="edit-credential"]').click();
cy.verifyPageTitle('Edit Credential');
cy.verifyPageTitle(`Edit ${credentialName}`);
cy.get('[data-cy="ask_password"]').uncheck();
cy.get('[data-cy="password"]').type('password');
cy.clickButton(/^Save credential$/);
Expand Down Expand Up @@ -220,7 +220,7 @@ describe('Credentials', () => {
cy.contains('Organization').should('be.visible');
cy.contains(organization.name);
cy.get('[data-cy="edit-credential"]').click();
cy.verifyPageTitle('Edit Credential');
cy.verifyPageTitle(`Edit ${credentialName}`);
const ModifiedCredentialName = credentialName + ' - edited';
cy.get('[data-cy="name"]').type(ModifiedCredentialName);
cy.get('[data-cy="username"]').should('be.visible');
Expand Down Expand Up @@ -261,7 +261,7 @@ describe('Credentials', () => {
cy.get(`[data-cy="row-id-${credential.id}"]`).within(() => {
cy.get('[data-cy="edit-credential"]').click();
});
cy.verifyPageTitle('Edit Credential');
cy.verifyPageTitle(`Edit ${credentialName}`);
cy.get('[data-cy="name"]').clear().type(`${credential.name} - edited`);
cy.clickButton(/^Save credential$/);
cy.clearAllFilters();
Expand Down Expand Up @@ -365,7 +365,7 @@ describe('Credentials', () => {
disableFilter: true,
});
cy.clickButton(/^Edit credential$/);
cy.verifyPageTitle('Edit Credential');
cy.verifyPageTitle(`Edit ${credentialName}`);
cy.get('[data-cy="name"]')
.clear()
.type(credential.name + '-edited');
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/awx/resources/executionEnvironments.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ describe('Execution Environments: Edit and Bulk delete', () => {
cy.clickTableRowLink('name', executionEnvironment.name, { disableFilter: true });
cy.verifyPageTitle(executionEnvironment.name);
cy.getByDataCy('edit-execution-environment').click();
cy.verifyPageTitle('Edit Execution Environment');
cy.verifyPageTitle(`Edit ${executionEnvironment.name}`);
cy.url().then((currentUrl) => {
expect(
currentUrl.includes(
Expand Down Expand Up @@ -248,7 +248,7 @@ describe('Execution Environments: Edit and Bulk delete', () => {
inKebab: false,
disableFilter: true,
});
cy.verifyPageTitle('Edit Execution Environment');
cy.verifyPageTitle(`Edit ${executionEnvironment.name}`);
cy.url().then((currentUrl) => {
expect(
currentUrl.includes(
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/awx-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,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;
});
Expand Down

0 comments on commit 8951bc2

Please sign in to comment.