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

Remove nightwatch tests #822

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,49 +214,6 @@ php ./core/scripts/db-tools.php dump-database-d8-mysql | gzip > thunder.sql.gz
export thunderDumpFile=/path/to/thunder.sql.gz
```

### How to run the NightwatchJS performance tests <Badge type="danger" text="Not reviewed" vertical="bottom" />

1. You need to install [Yarn](https://yarnpkg.com). Please check the installation documentation for it.
2. You have to install `thunder/thunder_performance_measurement` package. To do that, execute the following command in
your project root directory: `composer require thunder/thunder_performance_measurement:dev-master --dev` and enable
the module by executing: `drush en thunder_performance_measurement` in your `docroot` directory.
3. You need to install [Elastic APM Node.js Agent](https://www.npmjs.com/package/elastic-apm-node) in Drupal Core node
packages. To do that go to your `docroot/core` directory and execute the following
command: `yarn add elastic-apm-node --dev`
4. You have to adjust your `.env` file inside `docroot/core` directory. You can copy the `.env.example` to `.env` and
edit it accordingly. Thunder tests require the following environment variables: `DRUPAL_TEST_BASE_URL`
, `THUNDER_BRANCH`, `THUNDER_SITE_HOSTNAME` and `THUNDER_APM_URL`. The `THUNDER_BRANCH` is the branch name where
tests are executing, for example, `8.x-4.x`. The `THUNDER_SITE_HOSTNAME` is the hostname where tests are executing,
for example, `thunder.dev`. The `THUNDER_APM_URL` is URL to Elastic APM Server, for example, `http://localhost:8200`.
5. After that, you can run NightwatchJS tests by executing the following command inside `docroot/core`
directory: `yarn test:nightwatch <path to JS Test file>`. Here is an
example: `yarn test:nightwatch ../profiles/contrib/thunder/tests/src/Nightwatch/Tests/CreateMostUsedContent.js`

#### If you have a problem with outdated chromedriver

Drupal core does not update javascript dependencies so fast and chromedriver may be outdated and unable to work with
chrome installed on the system. You can provide chrome that can be used by chromedriver inside a docker container. You
can do it with the following command:

```bash
docker run --name selenium_chrome -d -P -p 6000:5900 -p 4444:4444 --shm-size 256m --add-host="thunder.dd:172.16.123.1" selenium/standalone-chrome-debug:3.141.59-selenium
```

You have to find what is correct docker image tag for the chrome version you need. To do that you have to take a look
at [selenium docker releases](https://github.com/SeleniumHQ/docker-selenium/releases). This workflow is similar to PHP
JavaScript tests and for additional information, you can take a look at **How to run the tests** section.

After you have running chrome in docker, you have also to change environment variables in `.env` file. The following
environment variable should be set:

```bash
DRUPAL_TEST_WEBDRIVER_PORT=4444
DRUPAL_TEST_WEBDRIVER_PATH_PREFIX=/wd/hub
DRUPAL_TEST_CHROMEDRIVER_AUTOSTART=false
```

You can copy/paste this section to the bottom of your `.env` file.

## Documentation

To help with the documentation, please run:
Expand Down
45 changes: 0 additions & 45 deletions tests/src/Nightwatch/.eslintrc.json

This file was deleted.

134 changes: 0 additions & 134 deletions tests/src/Nightwatch/Commands/autoFillField.js

This file was deleted.

27 changes: 0 additions & 27 deletions tests/src/Nightwatch/Commands/autoFillFields.js

This file was deleted.

32 changes: 0 additions & 32 deletions tests/src/Nightwatch/Commands/fillCKEditor.js

This file was deleted.

66 changes: 0 additions & 66 deletions tests/src/Nightwatch/Commands/fillEntityBrowser.js

This file was deleted.

Loading
Loading