Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRESS2-1489 Add Cypress Tests for site-logo step #410

Merged
merged 5 commits into from
Jan 12, 2024

Conversation

avneet-raj
Copy link
Contributor

No description provided.

@avneet-raj avneet-raj self-assigned this Jan 11, 2024
@avneet-raj avneet-raj added the Code Review The PR is in Code Review label Jan 11, 2024
@avneet-raj avneet-raj added this to the AI Onboarding v1.0 milestone Jan 11, 2024
const sampleLogoPath = `vendor/newfold-labs/wp-module-onboarding/tests/cypress/fixtures/image.png`;
const LogoPreviewClass = '.nfd-onboarding-image-uploader--with-text__site_logo__preview';
if(
cy.get('.nfd-onboarding-button--site-gen-next--disabled')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an assertion, will it have a return value true/false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if the element is not visible, it'll return false.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have used this in basic info step also, in earlier onboarding flow.

.scrollIntoView()
.should( 'be.visible' );
} );
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be the else condition? Next is enabled which means Logo is already uploaded.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

.click();
cy.url().should('not.contain', currURL);
cy.go('back');
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click Back meaning you are in site-detail step and cy.go('back') will take us to site-logo again right? Just checking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yess.

} );
});

});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click on next and verify if its going to social media step or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add this.


it( 'Check for the skip button and click', () => {
SkipButtonCheck('sitgen/step/site-logo');
} );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verifying upon skip, url is not current URL is okay.

We need to also check if it is exactly going to next right step or not. Please verify next expected step url too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I commented on the other PR as well. We are not checking the next page URL as in future the order of pages might change and this will lead to failing of tests. Checking the curr URL is sufficient, I guess whether the current URL changes or not.

avneet-raj and others added 2 commits January 12, 2024 15:48
@avneet-raj avneet-raj added Ready to merge The Code Review and QA is done and it can be merged. and removed Code Review The PR is in Code Review labels Jan 12, 2024
@avneet-raj avneet-raj merged commit 814ca25 into enhance/ai-onboarding Jan 12, 2024
@avneet-raj avneet-raj deleted the add-site-logo-step-tests branch January 30, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready to merge The Code Review and QA is done and it can be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants