Conversation
- Added Playwright as a development dependency in package.json. - Created a new Playwright configuration file (playwright.config.js). - Implemented a Mocha test runner using Playwright in a new file (mocha-runner.spec.js). - Updated yarn.lock to include Playwright dependencies.
…ore running tests as cchq
There was a problem hiding this comment.
Rather than adding yet another directory at the top level of this repo, can JS build and artifacts (also thinking of webpack) be moved into a common directory? Maybe that's more disruptive than you'd want in this PR? I'd be find with a follow-up PR that consolidates JS build artifacts into a single directory.
Related thougths
- The easiest thing might be to move all JS build artifacts into
webpack, even though they're not all related to webpack. - More disruptive, but probably better organizationally would be to move
webpackandplaywritescripts into a new directory. Name suggestion:js-build
| // Get the full test title (includes parent describe blocks) | ||
| let title = ''; | ||
| if (titleEl) { | ||
| // Remove the duration span from the title |
There was a problem hiding this comment.
This and many others in this file look like AI comments. Are they necessary?
| 'hqwebapp/bootstrap3', | ||
| 'hqwebapp/bootstrap5', | ||
| 'hqwebapp/components', | ||
| 'case_importer', |
There was a problem hiding this comment.
Does this list need to be updated every time a new app is added? How will people who don't know about this file know to do that?
Edit: I see this list existed before, so it's not a new problem. I still don't love it and wish we had some automated way to calculate the list.
| echo "Before running, please confirm: | ||
| grunt is installed via npm or yarn | ||
| playwright is installed (npx playwright install chromium) | ||
| local development server is active\n" | ||
| read -p "Do you want to proceed? (y/n) " proceed |
There was a problem hiding this comment.
Could this check and only echo/prompt for input if playwrite is not found on the path (using which playwrite or something along those lines)?
There was a problem hiding this comment.
Can this file be put in the proposed js-build directory rather than in the repo root?
Product Description
This is a result of my musings with Cursor, grunt and related packages are no longer maintained and we have been keeping them around despite various CVEs.
Grunt was just the test runner, the tests are written using mocha. So swapping the runner should not involve updating testing and just config changes should suffice.
So I decided to create a POC from Cursor to see extent of work that would go into switching it to playwright. The output was promising on my local system and the config switch made it work.
I am opening this PR for tests, this is still WIP and would require further cleanup to make it reviewable.
You are welcome to share your thoughts/ideas on the PR but I might restructure the commits in future.
Feature Flag
Safety Assurance
Safety story
Tests only
Automated test coverage
Labels & Review