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

Which setup to run Nightwatch tests? #531

Open
MXTcomunica opened this issue Nov 10, 2022 · 3 comments
Open

Which setup to run Nightwatch tests? #531

MXTcomunica opened this issue Nov 10, 2022 · 3 comments

Comments

@MXTcomunica
Copy link

Codebase
Mounted codebase

Describe your issue
Which is the correct setup to allow Nightwatch tests to run?
I'm on Drupal 10, and trying to run Nightwatch inside D4D environment, but without success.
Don't know if useful: Chromedriver has been removed as a JavaScript dependency (https://www.drupal.org/node/3319135).
So, as suggested in point 3 in previous link, I've separately installed Chromedriver in my system (not as npm dependecy, but downloading it from https://sites.google.com/chromium.org/driver/downloads), and its binary is in /usr/bin/chromedriver.

I tried to play with /core/.env Drupal default settings as per Drupal instructions, but then if I run yarn test:nightwatch --env local in the node container I obtain the following error:

ChromeDriver cannot be found in the current project.

  1. You can either install chromedriver from NPM with: npm install chromedriver --save-dev
  2. or download it from https://sites.google.com/chromium.org/driver/downloads, extract the archive and set "webdriver.server_path" config option to point to the binary file.

So I'm trying point 2, but cannot figure out how to do the right settings.

Please help me, a step by step guide would be very appreciated, thank you.

@MXTcomunica
Copy link
Author

No answer yet? Please, Nightwatch is the default DRUPAL CORE way to test JS since 2018 (see: https://www.drupal.org/node/2968570).

How I can run Nightwatch tests in D4D environment?

Please help, thank you!

@MXTcomunica
Copy link
Author

Found this, maybe it's useful, as soon as I have time I'll try to study it:

https://gorannikolovski.com/blog/docker4drupal-and-functional-javascript-tests

@kevinquillen
Copy link

Run it external to the container. Meaning, install it on your host machine. It will work.

But as a personal note, I would advise selecting any other JS testing framework for non-core work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants