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

feat: setup interaction testing #1895

Merged
merged 102 commits into from
Jan 10, 2024
Merged

Conversation

kamleshchandnani
Copy link
Collaborator

@kamleshchandnani kamleshchandnani commented Dec 20, 2023

This PR does the following things:

  1. Setup Interaction testing with Playwright
  2. Incorporates carousel fixes from chore: move carousel onchange to scroll event #1854
  3. Interaction tests for Carousel
  4. Run Interaction tests on CI via Run Interaction Test label or trigger it manually from the actions tab
  5. Run interaction tests across Chromium, Firefox and Webkit based browsers

Comment on lines +34 to +41
iPhone6: {
name: 'iPhone 6',
styles: {
height: '667px',
width: '375px',
},
type: 'mobile',
},
Copy link
Member

Choose a reason for hiding this comment

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

Does the MINIMAL_VIEWPORTS doesn't have any mobile viewport by default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

they have weird viewports like iPhone-5 or smaller so i added standard one

await expect(onChange).toBeCalledWith(0);
getByText(/Single Flow To Collect And Disburse Payments/)?.scrollIntoView({ behavior: 'smooth' });
await sleep(1000);
await expect(onChange).toBeCalledWith(3);
Copy link
Member

Choose a reason for hiding this comment

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

Actually we should also do this, after all the toBeCalledWith are done we should do another check for.

onChange.toBeCalledTimes(3);

This will ensure that onChange hasn't been called twice or more than it needs to be.

This we can add in all the tests.


TestAutoPlay.play = async ({ canvasElement }) => {
const { getByRole } = within(canvasElement);
await sleep(8000);
Copy link
Member

Choose a reason for hiding this comment

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

Before this we should do onChange.not.toHaveBeenCalled()

anuraghazra
anuraghazra previously approved these changes Dec 26, 2023
Copy link
Member

@anuraghazra anuraghazra left a comment

Choose a reason for hiding this comment

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

LGTM

@kamleshchandnani kamleshchandnani merged commit d5f290b into master Jan 10, 2024
14 checks passed
@kamleshchandnani kamleshchandnani deleted the setup-interaction-test branch January 10, 2024 06:16
anuraghazra added a commit that referenced this pull request Apr 9, 2024
Co-authored-by: Chaitanya Deorukhkar <deorukhkarchaitanya@gmail.com>
Co-authored-by: Nitin Kumar <nitin.kumar@razorpay.com>
Co-authored-by: Nitin Kumar <snitin315@gmail.com>
Co-authored-by: anuraghazra <anurag.hazra@razorpay.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants