The client for "libero reviewer".
Requirements
The project contains a Makefile which uses Docker for development.
-
make setup -
Run client options:
Test: mock everything with reviewer-mocksmake start_test
Dev: run against local reviewer-submission and continuum-adaptor, only mock continuum
# start local instances of submission and adaptor cd ../reviewer-submission ; make setup ; make start_dev cd ../continuum-adaptor ; make setup ; make start cd ../reviewer-client make start_dev
CI: lint, test and browsertest akin to pipeline
make run_ci
CI-localhost: same as CI but exposed on localhost
make build_prod make start_ci_localhost
-
Run tests:
make lint: lint codemake test: unittestsmake test_browser: locally executed browsertests, use withstart_test,start_devorstart_ci_localhostmake test_browser_containerized: use withbuild_prod ; start_cimake test_browser_saucelabs: browsertests run against saucelabs, use withstart_test,start_devorstart_ci_localhost
To use saucelabs you need an account and have to set SAUCE_USERNAME and SAUCE_ACCESS_KEY env vars.
make stopto teardown
Browsertests will be run against SauceLabs for a variety of browsers but we also create a container that runs them against Chrome. Having containerized browsertests lets us run them easily in the umbrella repo or as part of a helm release.
SauceLabs kindly grants us test capacity as part of their OpenSauce program.
- enable saucelabs on a PR by adding
[run-saucelabs]to your PR description- can't disable per commit because github doesn't expose the commit message in its context
- saucelabs job will always be run on commit/merge to master
- browsers to run are set in
.github/workflows/ci.yml - all test results are publically available
- testcafe prints link to saucelabs test result to stdout
- to allow browsertest containerization we need to inject a
BASE_URLfrom an environment variable
Make sure to include something like this for all browsertests:
import { DashboardPage, FilesPage, LoginPage, AuthorDetailsPage, DetailsPage, NavigationPane } from '../page-objects';
import { BASE_URL } from '../../test-utils/baseUrl';
fixture`Getting Started`.page`${BASE_URL}`;
test('assert nav bar', async() => {
...The compose files use liberoadmin/reviewer-mocks:latest.
- make sure you have the current image with:
docker pull liberoadmin/reviewer-mocks:latest
- when changing mocks locally, tag it accordingly:
cd ../reviewer-mocks make build docker tag \ libero/reviewer-mocks:local \ liberoadmin/reviewer-mocks:latest
