Repository navigation
Conversation
…s test karma' command with 'stripes test playwright'.
…ripes-cli into karma-to-playwright
…es where test suites can reach them
|
zburke
left a comment
There was a problem hiding this comment.
Thank you, thank you! 👏👏👏 It's such a relief to see this work! I'm impressed you got the Chromium install to work automatically (as evidenced in folio-org/stripes-components#2604), though I think we should follow up with devops and try to get it pre-installed on the CI images.
A few nits:
- Please link this up with STCLI-255.
- Ideally, let's handle all the "remove karma" stuff separately. "Add
browser" is a new feature, but "Removekarma" is a breaking change. I think most of the removal here is just documentation, butlib/commands/test.jslooks like it replaces karma with playwright. - IIUC, all our legacy decorators stuff has been removed, but maybe that work wasn't finished when this work started? It would be nice to clean it up here if possible.
PS: Boy George, FTW!!! 😆
| * [`status` command](#status-command) | ||
| * [`test` command](#test-command) | ||
| * [`test karma` command](#test-karma-command) | ||
| * [`test browser` command](#test-browser-command) |
There was a problem hiding this comment.
Let's separate "add browser" from "remove karma". I know this is just documentation, but still.
| `--bundle` | Create and use a production bundle retaining test hooks | boolean | | ||
| `--cache` | Enable webpack's caching for quicker rebuilds during development. | boolean | default: `false` | ||
| `--coverage, --karma.coverage` | Enable Karma coverage reports | boolean | | ||
| `--cache` | Enable caching of test bundle. Defaults to false. | boolean | |
There was a problem hiding this comment.
Given we are adding --browser with the default value in the Notes column, let's keep that same formatting for this line. Alternatively, if these all default to false, just say so at the top and say "here's a table of on-switches".
| `--stripesConfig` | Stripes config JSON | string | supports stdin | ||
| `--tenant` | Specify a tenant ID | string | | ||
| `--watch` | Watch test files for changes and rerun tests automatically when changes are saved. | boolean | default: `false` | ||
| `--verbose` | Print passing tests as well as failures. | boolean | |
There was a problem hiding this comment.
I don't need to die on this hill, but if it were up to me:
My inclination is to show all results by default. This is how karma and jest work, so I think it's a standard expectation. Even jest --quiet **still shows all test results, but merely suppresses extra logging. If you think it's important to have a "no console output" option, I'd expect this as a --quiet flag to suppress this standard output.
| // opt-in: only the Playwright runner needs this; the (deprecated) Karma flow stays as it was. | ||
| if (options.legacyDecorators) { | ||
| enableLegacyDecorators(config); | ||
| } |
There was a problem hiding this comment.
What?!? Why? I thought these were only present in interactors that imported from @bigtest/..., and those are all gone now.



Karma has long been the browser-based test runner go-to for stripes-*. Unfortunatlely the Karma project ended and it's time to move on.
Playwright is the new kid in town.
To migrate, the command
stripes test karmacan be switched tostripes test browser.This PR implements a harness/shim layer in which tests are executed with browser orchestration handled by
playwright. Previously, this functionality was implemented by a handful of dependencies -karma,karma-browserstack-launcher,karma-chrome-launcher,karma-coverage-istanbul-reporter,karma-firefox-launcher,karma-junit-reporter,karma-mocha,karma-mocha-reporter, and last but most infamouskarma-webpack.playwright-serviceimplements the harness, configures the build for tests, implements the logging output. This allows us to keep our mocha test suites and just swap out the thing(s) that orchestrate the browser and did the reporting.The reporting layer is custom/controllable since mocha and the reporting are running in separate spaces (mocha in the browser, reporter in node) and built-in reporters depend on a shared environment.