Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add qwik add command for Nightwatch. #6426

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

garg3133
Copy link

Overview

Add an integration for Nightwatch, an e2e testing framework that allows users to run their tests against real browsers.

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests / types / typos

Description

Add a starter for Nightwatch integration.

Use cases and why

    1. Allows users to write and run e2e tests against real browsers on both desktop and mobile platforms.
    1. 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

@garg3133 garg3133 requested review from a team as code owners May 30, 2024 14:45
Copy link

netlify bot commented May 30, 2024

👷 Deploy request for qwik-insights pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 4c07d18

@garg3133 garg3133 force-pushed the add-nightwatch-integration branch from 710a8ac to fd64ad8 Compare May 30, 2024 14:46
@garg3133 garg3133 force-pushed the add-nightwatch-integration branch from fd64ad8 to b44ba43 Compare May 30, 2024 14:48
@garg3133
Copy link
Author

garg3133 commented May 30, 2024

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:

image

(the above screenshot is from the Playwright integration)

How can we fix this?

@gioboa
Copy link
Member

gioboa commented Jun 22, 2024

Hi @garg3133 Thanks for this PR, can you add few test examples pls?
eg. signals, input etc. etc.

@garg3133
Copy link
Author

Ohh didn't realize I forgot to push the example file. Thanks!

@garg3133
Copy link
Author

@gioboa I've added the example test.

@gioboa
Copy link
Member

gioboa commented Jun 24, 2024

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 chalk@4.1.2/node_modules/chalk/source/index.js?                                              

 ELIFECYCLE  Command failed with exit code 10.

Am I missing something?

@garg3133
Copy link
Author

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.

@gioboa
Copy link
Member

gioboa commented Jun 25, 2024

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.

@garg3133
Copy link
Author

So, here are the steps I followed:

  • Create a new Qwik project using pnpm create qwik.
  • Change the version for qwik and qwik-city in package.json to the file: paths as mentioned above.
  • Run pnpm install
  • Run pnpm qwik add nightwatch
  • Run pnpm test.e2e.

And the test runs perfectly fine for me.

@gioboa
Copy link
Member

gioboa commented Jun 25, 2024

I see, thanks. @thejackshelton are you able to run it? Maybe my local environment is not perfectly configured.

@shairez
Copy link
Contributor

shairez commented Jul 9, 2024

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! 🙏

@shairez shairez added the STATUS-2: blocked by another PR This PR is currently blocked by a different PR / Task label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-2: blocked by another PR This PR is currently blocked by a different PR / Task
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

3 participants