Skip to content

Commit

Permalink
fix: fix failing tests (#1607)
Browse files Browse the repository at this point in the history
* fix: fix failing tests

* fix: more fixes
  • Loading branch information
deepessh authored Jul 25, 2024
1 parent 142cd28 commit c84a757
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions cypress/e2e/get-credentials.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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');
}

Expand Down Expand Up @@ -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');
Expand All @@ -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();
Expand All @@ -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');
Expand All @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions example/src/pages/credential/GetCredentialApiKey.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const GetCredentialApiKey = () => {

<GetCredential.UnknownError helpLink="https://some_help_link" helpLinkText="Get Help" className="unKnownError" />

<GetCredential.Card title="Your credential is ready to use" paragraph="Check the downloads section of your browser for the ZIP file, or find it where you save downloads on your machine." className="card_developer_console">
<GetCredential.Card title="Your credential is ready to use" paragraph="Check the downloads section of your browser for the ZIP file, or find it where you save downloads on your machine." className="card_developer_console" nextStepsLabel="Next steps" nextStepsHref="/credentials/nextsteps">

<GetCredential.Card.Side>
<div style="display : flex ; gap : 16px ; flex-direction : column;">
Expand All @@ -67,7 +67,7 @@ const GetCredentialApiKey = () => {

</GetCredential.Card>

<GetCredential.Return title="Previously created projects" paragraph="Select a project and access your existing credentials for Firefly - Firefly and Creative Cloud Automation." className="card_developer_console">
<GetCredential.Return title="Previously created projects" paragraph="Select a project and access your existing credentials for Firefly - Firefly and Creative Cloud Automation." className="card_developer_console" nextStepsLabel="Next steps" nextStepsHref="/credentials/nextsteps">

<GetCredential.Return.Side>
<GetCredential.Return.Side.Custom>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ const Organization = () => {
<span className="spectrum-Button-label">Cancel</span>
</button>

<button className="spectrum-Button spectrum-Button--fill spectrum-Button--accent spectrum-Button--sizeM" onClick={() => {
<button data-cy="submit-change-organization" className="spectrum-Button spectrum-Button--fill spectrum-Button--accent spectrum-Button--sizeM" onClick={() => {
close();
switchOrganization(allOrganizations[selectedIndex]);
}}>
<span className="spectrum-Button-label" data-cy="submit-change-organization">Change organization</span>
<span className="spectrum-Button-label">Change organization</span>
</button>

</div>
Expand Down

0 comments on commit c84a757

Please sign in to comment.