From c84a757103138aca16a1096613b31ffc4f01be1d Mon Sep 17 00:00:00 2001 From: Deepesh Chaudhary Date: Thu, 25 Jul 2024 13:01:24 -0700 Subject: [PATCH] fix: fix failing tests (#1607) * fix: fix failing tests * fix: more fixes --- cypress/e2e/get-credentials.cy.js | 18 +++++++++--------- .../pages/credential/GetCredentialApiKey.js | 4 ++-- .../components/GetCredential/Organization.js | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cypress/e2e/get-credentials.cy.js b/cypress/e2e/get-credentials.cy.js index bba3c3c63f..bc95759237 100644 --- a/cypress/e2e/get-credentials.cy.js +++ b/cypress/e2e/get-credentials.cy.js @@ -13,7 +13,7 @@ function init(route) { } function checkRequestAccessEdgeCase() { - cy.get('button[data-cy="accessDetails-edgeCase-btn"]').should('be.visible').should('be.enabled'); + cy.get('a[data-cy="accessDetails-edgeCase-btn"]').should('be.visible'); }; function getIframeBody() { @@ -68,13 +68,13 @@ function checkAPIKey() { } function checkOAuthS2S() { - cy.get('button[data-cy="generate-token"]').should('be.visible').should('be.enabled'); + cy.get('div[data-cy="generate-token"]').should('be.visible'); // cy.get('button[data-cy="copy-token"]').should('exist'); cy.get('[data-cy="credentialName-link"]').should('exist'); - cy.get('button[data-cy="ClientId-copyIcon"]').should('exist'); - cy.get('button[data-cy="retrieve-client-secret"]').should('be.visible').should('be.enabled'); + cy.get('[data-cy="ClientId-copyIcon"]').should('exist'); + cy.get('[data-cy="retrieve-client-secret"]').should('be.visible'); // cy.get('button[data-cy="copy-client-secret"]').should('exist'); - cy.get('button[data-cy="Scopes-copyIcon"]').should('exist'); + cy.get('[data-cy="Scopes-copyIcon"]').should('exist'); cy.contains('openid, AdobeID, read_organizations, firefly_api, ff_apis').should('exist'); } @@ -103,7 +103,7 @@ function addCredential(credentialType) { cy.get('[data-cy="add-allowed-origins"]').type('localhost:9000').should('have.value', 'localhost:9000'); cy.get('[data-cy="download-checkBox"]').check().should('be.checked'); cy.get('[data-cy="select-download-language"]').click(); - cy.get('ul li').contains('JavaScript').click(); + cy.get('ul p').contains('JavaScript').click(); } cy.get('[data-cy="terms-condition-link"]').should('be.visible'); cy.get('[data-cy="update-terms-condition"]').check().should('be.checked'); @@ -124,7 +124,7 @@ function waitForLoader() { } function selectOrganization(orgName) { - cy.get('button[data-cy="change-organization-btn"]').should('be.visible').should('be.enabled').click(); + cy.get('span[data-cy="change-organization-btn"]').should('be.visible').click(); cy.get('button[data-cy="organization-picker"]').should('be.visible').should('be.enabled').click(); cy.contains(orgName).should('exist').click(); cy.get('button[data-cy="submit-change-organization"]').should('be.visible').should('be.enabled').click(); @@ -138,7 +138,7 @@ function returnToForm() { } describe('Get Credentials Test', () => { - it('API Key page loads', () => { + it('API Key credential', () => { init('/getCredential/'); checkReturnFlow(API_KEY); selectOrganization('AdobeIOTestingOrg'); @@ -148,7 +148,7 @@ describe('Get Credentials Test', () => { addCredential(API_KEY); }); - it('OAuth s2s page loads', () => { + it('OAuth S2S credential', () => { init('/get-credential-oauth/'); checkRequestAccessEdgeCase(); selectOrganization('Romans entp org'); diff --git a/example/src/pages/credential/GetCredentialApiKey.js b/example/src/pages/credential/GetCredentialApiKey.js index 8b670a3ea9..c967a41b77 100644 --- a/example/src/pages/credential/GetCredentialApiKey.js +++ b/example/src/pages/credential/GetCredentialApiKey.js @@ -41,7 +41,7 @@ const GetCredentialApiKey = () => { - +
@@ -67,7 +67,7 @@ const GetCredentialApiKey = () => { - + diff --git a/packages/gatsby-theme-aio/src/components/GetCredential/Organization.js b/packages/gatsby-theme-aio/src/components/GetCredential/Organization.js index 0908e3b87b..6daa86f5c0 100644 --- a/packages/gatsby-theme-aio/src/components/GetCredential/Organization.js +++ b/packages/gatsby-theme-aio/src/components/GetCredential/Organization.js @@ -196,11 +196,11 @@ const Organization = () => { Cancel -