Skip to content

Commit

Permalink
UITEST-77 bump major to remove nightmare (#101)
Browse files Browse the repository at this point in the history
With the formal deprecation of nightmare end-to-end tests in platform
core, we can finally purge nightmare from other parts of our
infrastructure as well. Good riddance.

Refs UITEST-77
  • Loading branch information
zburke committed Feb 24, 2021
1 parent e00e9b6 commit 34ecc30
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 1,923 deletions.
62 changes: 1 addition & 61 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ toolkit instead.

* [TL;DR](#tldr-i-just-want-to-run-some-tests)
* [Stripes Component Interactors](doc/interactors.md)
* [About Folio UI Tests](#about-folio-ui-tests)
* [Prerequisites](#prerequisites)
* [Nightmare debug options](#nightmare-debug-options)
* [Choose the source of UI module tests to run](#choose-the-source-of-ui-module-tests-to-run)
* [Writing tests](#writing-tests)

Expand All @@ -37,69 +35,12 @@ yarn test-int
This will start stripes at http://localhost:3000, run the platform's tests, and
quit stripes.

## About Folio UI Tests

The tests are using the [NightmareJS](http://www.nightmarejs.org), a browser
automation library that allows you to script events like `type` and `click`,
and [Mocha](https://mochajs.org) for the tests itself.

The test suite is invoked by the [stripes-cli](https://github.com/folio-org/stripes-cli/)
command [`test nightmare`](https://github.com/folio-org/stripes-cli/blob/master/doc/commands.md#test-nightmare-command).
Customize its behavior by editing the `stripes.config.js` file (or passing an
alternative config file altogether) or by specifying options such as `--run
<some app>` (to select tests other than those in the current directory),
`--okapi <some URL>` (to set a backend other than http://localhost:9130), and
`--show` to show Nightmare's Electron browser and dev-tools while the tests are
running.

To run tests from multiple apps, separate them with a forward slash:
```
yarn test-int --run checkout/users/inventory
```
To run tests from the platform and from one or more apps, include the special
app `WD` (think of tests in the "working directory"):
```
yarn test-int --run WD/checkout/users/inventory
```
To run selected tests from an app or platform, rather than ever test included in
the `test/ui-testing/test.js` file, append it to the app with a colon:
```
yarn test-int --run WD:loan-renewal/users:patron-group
```

Refer to the [`stripes-cli test nightmare`](https://github.com/folio-org/stripes-cli/blob/master/doc/commands.md#test-nightmare-command)
documentation for additional details and options.


## Prerequisites

* [Node.js](https://nodejs.org/) with an [active LTS version](https://github.com/nodejs/Release#release-schedule)
* [Yarn](https://yarnpkg.com/) JavaScript package manager

[Running nightmare on AWS](https://gist.github.com/dimkir/f4afde77366ff041b66d2252b45a13db#attempt-to-run-nightmare)
may require additional supporting libraries. Nightmare uses Electron under the
hood and may not install it by default. To immediately find out if you need to
install dependencies, execute:

```
cd node_modules/nightmare/node_modules/electron/dist
ldd electron | grep 'not found'
```


## Nightmare debug options

```
DEBUG=nightmare yarn stripes test nightmare stripes.config.js
DEBUG=nightmare* yarn stripes test nightmare stripes.config.js
DEBUG=nightmare:actions* yarn stripes test nightmare stripes.config.js
DEBUG=nightmare:*,electron:* yarn stripes test nightmare stripes.config.js
```

`nightmare:actions*` logs each browser-driving action as it happens, so it's
easier to see what's happened when something goes wrong.


## Choose the source of UI module tests to run

When building the platform, there are three potential sources for an
Expand All @@ -120,8 +61,7 @@ application module and its tests:
This is the default source for `platform-core#master`.

* A local checkout of a module, brought into the platform by building it in
a [workspace](https://github.com/folio-org/stripes-cli/blob/master/doc/user-guide.md)
or with a [stripes-cli alias](https://github.com/folio-org/stripes-cli/blob/master/doc/user-guide.md#aliases).
a [workspace](https://github.com/folio-org/stripes-cli/blob/master/doc/user-guide.md).

Change a platform's source for its modules with the `npm config` command:
```
Expand Down
47 changes: 0 additions & 47 deletions folio-ui.config.js

This file was deleted.

Loading

0 comments on commit 34ecc30

Please sign in to comment.