Skip to content

feat(e2e): adding playwright and migrate landing page e2e tests - #51129

Merged
raisedadead merged 26 commits into
freeCodeCamp:e2e-testfrom
teamoio:e2e-revamp-with-playwright
Aug 10, 2023
Merged

raisedadead merged 26 commits into
freeCodeCamp:e2e-testfrom
teamoio:e2e-revamp-with-playwright

Conversation

@Ahmadkashif

@Ahmadkashif Ahmadkashif commented Aug 2, 2023 •

Copy link
Copy Markdown
Member

Checklist:

Closes #XXXXX

@Ahmadkashif
Ahmadkashif requested a review from a team August 2, 2023 11:53
@ghost

ghost commented Aug 2, 2023 •

Copy link
Copy Markdown

👀 Review this PR in a CodeSee Review Map

View the CodeSee Map of this change

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@huyenltnguyen huyenltnguyen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey @Ahmadkashif, thank you for the contribution!

Would you mind pointing us to the GitHub issue or discussion regarding the addition of Playwright? Playwright is a great tool but we have been using Cypress for e2e tests, so I would like to understand more about the needs of Playwright and what gap it helps fill.

If we are adding Playwright to the codebase, we probably would need to have some documentation around:

  • How to use Playwright (which command to run, how to configure the setup)
  • How to write tests with Playwright
  • When to use Cypress and when to use Playwright

@naomi-lgbt

Copy link
Copy Markdown
Member

Heya @huyenltnguyen,

We've been discussing this internally. The biggest driver for moving to Playwright is the support for Webkit, which means we can run our E2E tests on Safari.

@hassaanp

hassaanp commented Aug 2, 2023

Copy link
Copy Markdown
Member

Hi @huyenltnguyen,

Maybe I can fill you in here.

Would you mind pointing us to the GitHub issue or discussion regarding the addition of Playwright?

This effort is part of a joint collaboration between FreeCodeCamp and Teamo to help build out a more robust and comprehensive testing suite.
Perhaps @ojeytonwilliams or @ShaunSHamilton can add more context.

Playwright is a great tool but we have been using Cypress for e2e tests, so I would like to understand more about the needs of Playwright and what gap it helps fill.

The general idea here was to validate the utility of Playwright and be able to increase testing across devices and browsers. @raisedadead maybe you want to add more here.

If we are adding Playwright to the codebase, we probably would need to have some documentation around:

  • How to use Playwright (which command to run, how to configure the setup)
  • How to write tests with Playwright

I agree, that should be a part of the README I assume or do you think there is another place we can add this to?

  • When to use Cypress and when to use Playwright

The plan is to slowly pull out Cypress once we have rewritten all the tests.

@naomi-lgbt

Copy link
Copy Markdown
Member

I agree, that should be a part of the README I assume or do you think there is another place we can add this to?

It would go in our contributing docs, most likely. They're found in the same repo, in the /docs directory.

@ojeytonwilliams

Copy link
Copy Markdown
Contributor

I think that about covers it, @hassaanp!

@huyenltnguyen

Copy link
Copy Markdown
Member

Thank you all for the enlightenment! I am, as always, waaay out of the loop 😅

I've read about Playwright but haven't actually had a chance to work with it. Looking forward to the integration of it into the codebase! (I'll keep lurking and hopefully could help contribute something)

@Ahmadkashif

Copy link
Copy Markdown
Member Author

Thank you everybody for the valuable insights.

I'll be adding proper documentation for this integration.

@hassaanp hassaanp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left minor suggestions and some questions.

Comment thread docs/how-to-add-playwright-tests.md Resolved
Comment thread e2e/landing.spec.ts Resolved
Comment thread e2e/landing.spec.ts Resolved
Comment thread e2e/landing.spec.ts Resolved
Comment thread e2e/landing.spec.ts Resolved
Comment thread playwright.config.ts Resolved

@raisedadead raisedadead left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is looking good so far! Thanks, @hassaanp @Ahmadkashif and others from Teamo; you are all doing a great job.

We can improve the docs and the scope of the tests incrementally. This first PR can be about having all the bits and pieces in place.

Two things that should make the PR golden:

  • Add a GitHub actions workflow file similar to what we have for our current setup. It can be merged as it is. Follow-up PRs will be a good test to see it in action.
  • Please set up your development environment. We have recommendations in the contributing guide. That should fix the linting and formatting issues, I see.

Thanks, and keep up the good work!

@raisedadead raisedadead added status: waiting update Is awaiting update, after feedback or request for changes scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. labels Aug 3, 2023
@github-actions github-actions Bot removed the scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. label Aug 4, 2023
@github-actions github-actions Bot added the scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. label Aug 9, 2023
@raisedadead raisedadead added status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. and removed status: waiting update Is awaiting update, after feedback or request for changes labels Aug 10, 2023
@Ahmadkashif

Copy link
Copy Markdown
Member Author

Hi @ojeytonwilliams @raisedadead @hassaanp 👋

I have incorporated all requested changes. Please take a look and let me know about any further improvements.

@raisedadead raisedadead left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Adjusting to test this on the main repo

paths-ignore:
- 'docs/**'
branches:
- 'main'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- 'main'
- 'main'
- 'e2e-**'

- 'docs/**'
branches:
- 'main'
- 'next-**'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- 'next-**'
- 'next-**'
- 'e2e-**'

@raisedadead
raisedadead changed the base branch from main to e2e-test August 10, 2023 16:26
@raisedadead
raisedadead merged commit b7406b7 into freeCodeCamp:e2e-test Aug 10, 2023
@raisedadead

Copy link
Copy Markdown
Member

Thanks for your hard work @Ahmadkashif - this looks great to me.

I am sure we have some nit-picks, but I have merged the PR to a dedicated branch on the fCC proper repo to enable running the tests in GitHub actions as a sanity check.

Please continue the discussion in #51216 - I will likely land it today/tomorrow.

@Ahmadkashif

Copy link
Copy Markdown
Member Author

sounds good.
Thanks @raisedadead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants