spiral-app v0.1.1
Spiral-UI
User interface for Spiral project
Installation and build
npm install
npm run buildStarting the app
npm startto start on a specific port :
PORT=3434 npm startTesting the app
Run unit tests :
npm testTo run integration tests when the development server is running :
npm run it-testTo run integration tests on production build (the development server must be stopped prior runnig this script) :
npm run ciIt builds the app, starts the production server and run integration tests. It should be used prior a production deployment. For a complete continuous integration chain :
npm ci ; npm run ciWriting tests
Our tests use a specific syntax :
const testName: ITtest = browser =>
[
"Your message",
async t => {
const page = await browser.newPage();
await page.goto("Your test url");
/** Write your test logic */
t.end();
}];
export default [login("administrator"), testName]If you want a specific role while performing your tests, you can use login(role: string) available in the test-helpers.ts file by importing it in your test file.
Every tests must be written in a suite() function. They will be called synchronously from first to last element in the suite array.
An example :
import { login, ITtest, forceLanguage } from "../test-helpers";
const test1: ITtest = browser =>
[
"This is a test",
async t => {
const page = await browser.newPage();
await page.goto(
"http://localhost:8080/P11-05/patient/edit?patientCode=00001"
);
t.true(true);
t.end();
}];
export default [login("administrator"), test1]