workspace.json
file, located in the root of the repository.NextJS
apps. In effort to optimize this process we have created an e2e-ci.js
script in the scripts/
directory. It starts by creating a production build of the app under testing, before starting the Cypress tests. Following is a documentation of the configuration needed to enable the e2e-ci
task.API_MOCKS
environment variable is set in the next.config.js
libs/share/webpack
which we use to make sure the API_MOCKS
environment variable is set, along with other common plugins and settings.webpack.config.js
should look like this:devServerTarget
for the production
config of the e2e
task for the corresponding e2e
project.baseUrl
of our app is (as we are running it manually). That is done by adding baseUrl
to the options
key of the e2e
task.web
project:e2e-ci
taske2e-ci
task to the architect
property of the corrensponding e2e
project.e2e-ci.js
script requires few parameters:-n
- Required. The name of the e2e project. The script uses this name to find the name of the target app (by stripping of the -e2e
ending).-d
- Required. Sets the output directory for the production build.-s
- Boolean to indicate if to use --skip-nx-cache
-t
- Only for React. Sets the app type to react
.-b
- Optional for React. If the app is deployed to a sub-directory, that is the base
in index.html
this option is needed to set that path.-h
parameter for the script:e2e
taske2e-ci
task40_e2e.sh
.