qwik
qwik copied to clipboard
feat: Add qwik add command for Nightwatch.
Overview
Add an integration for Nightwatch, an e2e testing framework that allows users to run their tests against real browsers.
What is it?
- [x] Feature / enhancement
- [ ] Bug
- [ ] Docs / tests / types / typos
Description
Add a starter for Nightwatch integration.
Use cases and why
-
- Allows users to write and run e2e tests against real browsers on both desktop and mobile platforms.
-
- Serves as an alternative to Playwright for e2e testing.
Checklist:
- [ ] My code follows the developer guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] Added new tests to cover the fix / functionality
/cc: @AutomatedTester
Deploy request for qwik-insights rejected.
| Name | Link |
|---|---|
| Latest commit | 4c07d1894a3146db5cf951d8107df78c6dad8187 |
One question I had for the maintainers here, whenever we add an integration to the Qwik project that comes with a bunch of .ts files, all the TypeScript files show the following error:
(the above screenshot is from the Playwright integration)
How can we fix this?
Hi @garg3133 Thanks for this PR, can you add few test examples pls? eg. signals, input etc. etc.
Ohh didn't realize I forgot to push the example file. Thanks!
@gioboa I've added the example test.
Thanks @garg3133
I tried the integration and I have this error with pnpm test.e2e
> nightwatch ./test
│ cannot read external global file using "nightwatch/globals.js"
│ Cannot find package 'chalk' imported from <my-folder>/nightwatch/globals.js
│ Did you mean to import [email protected]/node_modules/chalk/source/index.js?
ELIFECYCLE Command failed with exit code 10.
Am I missing something?
This is strange because chalk is a dependency of nightwatch, so if you've installed nightwatch you should have chalk as well.
How can I test this integration locally myself? How I've created this PR is by creating a new Qwik project using pnpm create qwik, adding the required files and dependencies for Nightwatch in it (and making sure it runs) and then copying the added files to this repository.
you can build the Qwik core with pnpm build.core and then in a new project you can use these dependencies
"@builder.io/qwik": "file:<your-path-here>/qwik/packages/qwik/dist",
"@builder.io/qwik-city": "file:<your-path-here>/qwik/packages/qwik-city/lib",
Install the new deps and then you can run pnpm qwik add to run the Qwik CLI.
The CLI is a small part of Qwik package but I usually build and link everything to avoid clashes.
So, here are the steps I followed:
- Create a new Qwik project using
pnpm create qwik. - Change the version for
qwikandqwik-cityin package.json to thefile:paths as mentioned above. - Run
pnpm install - Run
pnpm qwik add nightwatch - Run
pnpm test.e2e.
And the test runs perfectly fine for me.
I see, thanks. @thejackshelton are you able to run it? Maybe my local environment is not perfectly configured.
Thanks a lot @garg3133 !
We're planning to move integrations into community plugins under the "QwikCommunity" org so we could share the maintenance work with community plugin maintainers.
It's first pending that we'll implement this QwikDev/qwik-evolution#20 and after that it'll be easy to make sure this will be created as a plugin.
So I'm keeping this PR opened until we'll implement the plugin system
Thanks again! 🙏