The web UI for chpl
Git, Node.js, and Yarn are required to install and test this project.
Clone the repository using git:
See installation instructions here: nodejs but be aware that the required version of Node is 14.x
The project uses Yarn 2+. Installation instructions for Yarn 2+ are not easily found, but some information can be found at: yarn 1 and yarn 2+. The basic steps are to install yarn 1 globally, then run yarn install
in the project directory. Yarn 1 can be installed globally with npm: npm install -g yarn
yarn install
yarn build
: Build deployable artifactsyarn html-lint
: Run HTML Linter with rules that should all passyarn html-lint:verbose
: Run HTML Linter with rules that don't play well with AngularJS, so some errors are expected, but this can find some errors that need to be fixedyarn start
: Run a local dev server at: http://localhost:3000/ with automatic reloadingyarn start:dev
: Run a local dev server at: http://localhost:3000/ with automatic reloading, but connecting to the DEV environment for datayarn start:prod
: Run a local dev server at: http://localhost:3000/ with automatic reloading, but using the production settings for js minification / packaging / etc.yarn start:all
: Runyarn start
,yarn test:auto
andyarn test:react:auto
all at once, in the same terminalyarn profile
: Generate a webpack statistics output fileyarn test
: Run the Jest-based unit tests once (tests based on the React components)yarn test:auto
: Run the Jest-based unit tests continuously (tests based on the React components), re-running the tests on any file changelint
: Run ESLint against all JavaScript files in the projectlint:fix
: Run ESLint against all JavaScript files in the project and fix any errors that ESLint can fix automatically. Especially useful when run asyarn lint:fix src/app/path/to/file.js[x]
to automatically apply fixes against a single fileyarn e2e
: Run the end to end integration tests, as well as e2e lintingyarn e2e:lint
: Run code and syntax rulesyarn e2e:clean
: Clear out old E2E artifacts
Usable on yarn build
and yarn start
, these parameters control configuration of some properties
--env.NODE_ENV=production
or--env.NODE_ENV=development
to indicate whether to build for development or production environments. Defaults todevelopment
if not provided
On most Yarn commands the CSS Linter, JS Linter and HTML Linters will run. Webpack may fail to compile if any of the linters report issues, depending on the severity of the issue.
E2E tests can be run with the yarn wdio
command
By default, E2E tests will be executed against http://localhost:3000/.
The tests can be also be executed using different environments. The other URLs for other environments need to be configured in e2e/config/urls.js
file and URLs must have the correct format. There is a e2e/config/urlsEXAMPLE.js
that describes the necessary entries and formatting.
Copy e2e/config/urlsEXAMPLE.js
to the file e2e/config/urls.js
and set the urls for each environments in the file
To specify the environment to run the tests against, pass ENV variable with 'dev', 'qa' ,'stage' options. For example:
ENV=dev yarn wdio
ENV=qa yarn wdio
ENV=stage yarn wdio
When debugging, taking screenshots can be useful. The command await browser.saveScreenshot('path/to/file.png')
will save a screenshot to a location relative to the project root
To run just a single test, a command like yarn wdio --spec api-documentation
would run tests against all *.test.js
files that have api-documentation
somewhere in the *
. See https://webdriver.io/docs/organizingsuites/ for more examples of targeting files
Some of these items will need to be recreated, but at this time this is all OBE
Copy e2e/config/credentialsEXAMPLE.js
to the file e2e/config/credentials.js
and set the passwords for the users in the file to be valid users
If a single spec file should be tested, instead of all of them:
yarn e2e --spec path/to/file.spec.js
To change the loglevel:
yarn e2e --l info
To run a suite of tests:
yarn e2e --suite suite-name
.
For example, yarn e2e --suite components
will execute only the tests on the components. See wdio.conf.js
for a list of the suites