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

test(table-of-contents): add e2e-storybook test coverage #7673

Merged

Conversation

andy-blum
Copy link
Member

@andy-blum andy-blum commented Nov 16, 2021

Related Ticket(s)

Closes: #7444 #7445 #7446

Description

  • Adds new e2e-storybook test for table-of-contents web components component
  • Adds new e2e-storybook test for table-of-contents react component
  • Adds new cypress-local.json config & yarn commands to make test writing & debugging easier

Changelog

New

  • Adds new command yarn test:e2e-storybook:dev that opens the Cypress client on a currently-running storybook instance to ease test writing & debugging
  • Adds e2e-storybook test coverage for table of contents component

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Nov 16, 2021

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Nov 16, 2021

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Nov 16, 2021

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Nov 16, 2021

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Nov 16, 2021

Deploy preview created for package "Web Components (Codesandbox Examples)":
https://webcomponents-codesandbox.s3-web.us-east.cloud-object-storage.appdomain.cloud/deploy-previews/7673/index.html

Built with commit: dcfa294573ffe718b6d2d7ddfed8f38c9f64feaf

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Nov 16, 2021

Deploy preview created for package "React (Codesandbox Examples)":
https://react-codesandbox.s3-web.us-east.cloud-object-storage.appdomain.cloud/deploy-previews/7673/index.html

Built with commit: dcfa294573ffe718b6d2d7ddfed8f38c9f64feaf

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Nov 17, 2021

@andy-blum andy-blum marked this pull request as ready for review November 17, 2021 03:03
@andy-blum andy-blum requested a review from a team as a code owner November 17, 2021 03:03
@andy-blum andy-blum changed the title Tests/table of contents test(table-of-contents): add e2e-storybook test coverage Nov 17, 2021
@andy-blum
Copy link
Member Author

@jeffchew #7444 has the react package tag on it, but there's already a TOC test in the react packages e2e-storybook directory.

Does it need touched?

@ariellalgilmore
Copy link
Member

@jeffchew #7444 has the react package tag on it, but there's already a TOC test in the react packages e2e-storybook directory.

Does it need touched?

@andy-blum yeah we should be updating tests for react as well.

Copy link
Member

@ariellalgilmore ariellalgilmore left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you @andy-blum

@jeffchew jeffchew added the Ready to merge Label for the pull requests that are ready to merge label Nov 19, 2021
/**
* Cycle through carbon themes and take a screenshot
*/
Cypress.Commands.add('carbonScreenshot', (screenshotOpts = {}) => {
Copy link
Member

Choose a reason for hiding this comment

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

Awesomeee!!! just small name change

Suggested change
Cypress.Commands.add('carbonScreenshot', (screenshotOpts = {}) => {
Cypress.Commands.add('carbonThemesScreenshot', (screenshotOpts = {}) => {

Copy link
Member Author

Choose a reason for hiding this comment

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

@jeffchew I just removed the ready to merge label for this

@andy-blum andy-blum removed the Ready to merge Label for the pull requests that are ready to merge label Nov 19, 2021
Copy link
Member

@jeffchew jeffchew left a comment

Choose a reason for hiding this comment

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

LGTM!

@jeffchew
Copy link
Member

Going to re-run the e2e tests for web components, looks like the table of contents tests failed.

@jeffchew
Copy link
Member

@andy-blum the tests appear to almost be done but seeing some weird error:

image

@andy-blum
Copy link
Member Author

Curious if that's from the Percy snapshot command. Do you know where that's defined?

'should remain visible on page throughout scroll',
_tests.mobile.checkStickyNav
);
it('should render correctly in all themes', _tests.all.screenshotThemes);
Copy link
Member

Choose a reason for hiding this comment

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

@andy-blum I think this is the issue, didn't you rename the method to carbonThemesScreenshot?

Copy link
Member

Choose a reason for hiding this comment

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

talked to @andy-blum on slack and the method is calling carbonThemesScreenshot above, but i think it might be the width causing the error https://github.com/carbon-design-system/carbon-for-ibm-dotcom/pull/7673/files#diff-a42d6ed5ec53b43667f81c546bfc457893f5157db7a2bddd00eef414126fc929R35

Copy link
Member Author

Choose a reason for hiding this comment

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

fix pushed up. 🤞

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like the react e2e-storybook tests are failing now 😞

Copy link
Member

Choose a reason for hiding this comment

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

re-ran and it passed!!! Looks like this one is good to go :D

@ariellalgilmore ariellalgilmore added the Ready to merge Label for the pull requests that are ready to merge label Nov 23, 2021
@kodiakhq kodiakhq bot merged commit 4c0da7d into carbon-design-system:master Nov 24, 2021
@andy-blum andy-blum deleted the tests/table-of-contents branch November 24, 2021 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready to merge Label for the pull requests that are ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Test Scenario]: Table of contents - DDS consulting
4 participants