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] Add E2E website tests #30128

Merged
merged 22 commits into from Dec 15, 2021
Merged

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Dec 9, 2021

Motivation

Summary

  • add e2e tests in test/e2e-website (mostly test that all the href have correct URL)
  • for running tests in CI: add netlify function deploy-succeeded.js hook to trigger the e2e-website pipeline via CircleCI API (This will test against the deploy preview URL)
  • add a command & README to run e2e-website locally for development

image


@mui-pr-bot
Copy link

mui-pr-bot commented Dec 10, 2021

No bundle size changes

Generated by 🚫 dangerJS against eb38c05

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 13, 2021
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 14, 2021
@siriwatknp siriwatknp marked this pull request as ready for review December 14, 2021 02:22
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 14, 2021
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Please leave in the PR description what is the motivation for adding these tests and how we are going to use them during the migration of the docs

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 14, 2021
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

Happy to see an infra in place to be able to test the website/docs. This will be needed as we grow. I didn't look at the execution to solve this problem in detail, but it seems quite good.

.circleci/config.yml Outdated Show resolved Hide resolved
test/e2e-website/material-docs.spec.ts Outdated Show resolved Hide resolved
console.info(`url:`, payload.deploy_ssl_url);

// for more details > https://circleci.com/docs/2.0/api-developers-guide/#
await fetch(`https://circleci.com/api/v2/project/gh/${repo[1]}/pipeline`, {
Copy link
Member

Choose a reason for hiding this comment

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

A side though, the alternative option would be to:

  1. Run yarn docs:build in CircleCI
  2. Use something to serve in the CirleCI build the .html and .js files in /docs/.next
  3. Run the e2e test against it

Pros:

  • In the same CircleCI workflow

Potential advantage:

  • If we have better CircleCI machines, then yarn docs:build would build faster, but if we upgrade Netlify to a performance build, or migrate to Vercel with better build time, then that could be the opposite

Cons:

  • We build the docs twice (once in Netlify, and once in CircleCI)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think if we can do this, that'd be great:

  1. build the docs
  2. run the e2e-test
  3. deploy to netlify
    all of these steps are in CircleCI

@oliviertassinari oliviertassinari added core Infrastructure work going behind the scene test docs Improvements or additions to the documentation website Impacting the website on none core product pages, e.g. marketing labels Dec 14, 2021
@oliviertassinari oliviertassinari changed the title [docs] Add E2E website tests [test] Add E2E website tests Dec 14, 2021
siriwatknp and others added 3 commits December 15, 2021 08:19
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
@siriwatknp siriwatknp merged commit 11e33a8 into mui:master Dec 15, 2021
22 checks passed
@siriwatknp siriwatknp mentioned this pull request Dec 16, 2021
32 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going behind the scene docs Improvements or additions to the documentation test website Impacting the website on none core product pages, e.g. marketing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants