-
Notifications
You must be signed in to change notification settings - Fork 158
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
test(carousel): add testing for carousel default, with images, with videos, with media #8538
test(carousel): add testing for carousel default, with images, with videos, with media #8538
Conversation
Deploy preview created for package Built with commit: 43864be73df5efe1add6512a25f2f432510bd753 |
Deploy preview created for package Built with commit: 43864be73df5efe1add6512a25f2f432510bd753 |
Deploy preview created for package Built with commit: 43864be73df5efe1add6512a25f2f432510bd753 |
Deploy preview created for package Built with commit: 43864be73df5efe1add6512a25f2f432510bd753 |
Deploy preview created for package Built with commit: 43864be73df5efe1add6512a25f2f432510bd753 |
Looks like it's just a formatting error remaining. |
Deploy preview created for package Built with commit: 43864be73df5efe1add6512a25f2f432510bd753 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a solid foundation here. Mainly just opinions and nitpicks in the comments. Let me know if you have questions/need more info!
* @param default - Path to default variant | ||
* @param withImages - path to variant with images | ||
* @param withCta - path to variant with videos | ||
* @param withCta - path to variant with both images and videos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work documenting the code, but lets make sure the @param names match the keys in the object
*/ | ||
const _paths = { | ||
default: '/iframe.html?id=components-carousel--default', | ||
withImages: 'iframe.html?id=components-carousel--cards-with-images', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests passed, so this might just be nitpicky, but can we make sure the paths all follow the same pattern (either start with leading slash or dont)
packages/web-components/tests/e2e-storybook/cypress/integration/carousel/carousel.e2e.js
Show resolved
Hide resolved
packages/web-components/tests/e2e-storybook/cypress/integration/carousel/carousel.e2e.js
Show resolved
Hide resolved
const insetValue = after.getPropertyValue('inset'); | ||
|
||
expect(positionValue).to.eq('absolute'); | ||
if (Cypress.browser.name !== 'firefox') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we excluding firefox here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned above, this code is a copy of very similar code elsewhere. Looking at the git history, it seems that was added in this PR: #7807 It seemed prudent to keep it in, though if it's now unneeded I can remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this for now until someone tells you to add it back in.
packages/web-components/tests/e2e-storybook/cypress/integration/carousel/carousel.e2e.js
Show resolved
Hide resolved
|
||
cy.get(_selectors.buttonPrevious).click(); | ||
|
||
cy.takeSnapshots(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think you ought to be able to chain the takeSnapshots into these and only need to call on cy
once.
Not Nit: Does the scroll happen instantly or is it using smoothScroll behavior? If the scroll takes time, we might want to throw a .wait(1000)
in here to make sure the page has time to scroll before we take snapshots
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good points. I chained them and added a wait.
packages/web-components/tests/e2e-storybook/cypress/integration/carousel/carousel.e2e.js
Show resolved
Hide resolved
Deploy preview created for package Built with commit: 43864be73df5efe1add6512a25f2f432510bd753 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mwanberg This is looking great! I left a few notes for your consideration. Mostly little nitpicks and clean ups, and a couple suggestions that should make the tests more robust.
packages/web-components/tests/e2e-storybook/cypress/integration/carousel/carousel.e2e.js
Outdated
Show resolved
Hide resolved
packages/web-components/tests/e2e-storybook/cypress/integration/carousel/carousel.e2e.js
Outdated
Show resolved
Hide resolved
packages/web-components/tests/e2e-storybook/cypress/integration/carousel/carousel.e2e.js
Outdated
Show resolved
Hide resolved
packages/web-components/tests/e2e-storybook/cypress/integration/carousel/carousel.e2e.js
Outdated
Show resolved
Hide resolved
packages/web-components/tests/e2e-storybook/cypress/integration/carousel/carousel.e2e.js
Show resolved
Hide resolved
packages/web-components/tests/e2e-storybook/cypress/integration/carousel/carousel.e2e.js
Outdated
Show resolved
Hide resolved
packages/web-components/tests/e2e-storybook/cypress/integration/carousel/carousel.e2e.js
Outdated
Show resolved
Hide resolved
packages/web-components/tests/e2e-storybook/cypress/integration/carousel/carousel.e2e.js
Outdated
Show resolved
Hide resolved
packages/web-components/tests/e2e-storybook/cypress/integration/carousel/carousel.e2e.js
Outdated
Show resolved
Hide resolved
@mwanberg Can you take a look at the feedback that @andy-blum and @jkaeser have given? |
d448f1a
to
a49b343
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mwanberg! Just one small fix and it looks like it's good to go!
packages/web-components/tests/e2e-storybook/cypress/integration/carousel/carousel.e2e.js
Outdated
Show resolved
Hide resolved
Co-authored-by: kennylam <[email protected]>
Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks @mwanberg!
Related Ticket(s)
[Test Scenario]: Carousel - (Default, with images, with videos, with Media)
Description
The original requirements can be found in the ticket. I erred a little on the verbose side, and gave each variant a full suite of tests applicable to its unique content. If I should pare back and if any are redundant, let me know.
Test scenario steps
Note: Accessibility and theme compliance tests were applied to all.
Carousel - Default
Next
andPrevious
buttons move the carouselCarousel - With Images
Next
andPrevious
buttons move the carouselCarousel - With Videoes
Next
andPrevious
buttons move the carouselCarousel - With a mixture of images and videos (New SB Variant)
Next
andPrevious
buttons move the carouselChangelog
New