Open erezrokah opened 4 years ago
👋 Hello I maintain an open source library that generates Playwright code. I would be happy to submit PRs setting up e2e tests for netlify-cms, if you are cool with them using Playwright?
Hi @jperl, this sounds very cool. We already have a very extensive cypress setup.
I don't think we would like to have two different types of testing frameworks so first we would need to replace all existing tests.
Most of our tests use mocked recorded data and mock the browser fetch API, so most of our challenges were around that and not how to select items from the dom.
Also, I was trying to figure out how the parallel testing works (we use Cypress parallel
flag which load balances our tests and also provides a dashboard). Looks like https://github.com/qawolf/playwright-ci/blob/dd83f2d1a0bfa136c46f21a0f2c67b735439e8cb/static/github.hbs will run the tests on a single machine.
I probably missed some requirements, but please let me know what you think. As for the tests in this issue, most of them are about having "dirty" repos to test the CMS so the challenge there is not necessarily working with the dom, but finding a consistent way of generating the "dirty" status.
Thanks for the response :slightly_smiling_face:
I see you already have an extensive setup, so it probably would be too much work to port all of the existing tests. Re parallel testing: This can be done by using a GitHub Action matrix, where each job targets a subset of the tests.
I understand if you prefer to use Cypress for your tests, if you change your mind let me know!
This can be done by using a GitHub Action matrix, where each job targets a subset of the tests.
Thanks, we use a GitHub actions matrix, but Cypress takes care of splitting the tests between machines: https://github.com/netlify/netlify-cms/blob/8b0248bdc3f55dca451121d089b3274c8e72c09d/package.json#L28.
Context https://github.com/netlify/netlify-cms/issues/3332, https://github.com/netlify/netlify-cms/issues/3372 and https://github.com/netlify/netlify-cms/pull/3411
We've had several cases in the past when having out of dirty repos/out of sync forks will cause issues for editorial workflow and open authoring.
Editorial Workflow Examples
Open Authoring Examples
Example scenario:
Review
.Another example for https://github.com/netlify/netlify-cms/issues/3372:
Another scenario (https://github.com/netlify/netlify-cms/issues/3506):
In Review
.Repeat scenario for both merge commits, squash commits and rebase commits.
We should also test when the sync should fail (e.g. unresolved conflicts).