End to end testing for OpenBoxes
- NPM 6.14.6
- Node 14+
npm run install
npx playwright install
Environment variables facilitate the configuration of our testing project by allowing us to set appropriate configuration settings. A sample file can be located in the root directory of the project under the title .env.example. To configure this project effectively, it is imperative to create a .env file and declare all necessary variables within it.
APP_BASE_URL
base URL of the running openboxes environment
CI [optional]
true
or false
flag indicating whether tests are running in Continuous Integration.
USER_MAIN_USERNAME
USER_MAIN_PASSWORD
login credentials of the test user that will be used for most of the tests
LOCATION_MAIN
locationId
of the default location that will be used in most of the tests
LOCATION_NO_MANAGE_INVENOTRY_DEPOT
locationId
of the location with no manage inventory activity code
For more information on available flags when running tests in playwright reffer to the documentation.
npm run test
To add a flag to the npm script, do the following eg. npm run test -- --headed
To check if there are any linter errors that require attention run the following command
npm run lint
If you wish to handle these errors automatically run
npm run lint-fix
To format your code run the following command
npm run format