READ ME added
Co-authored-by: Yamuna Adhikari <adhikariamuna4444@gmail.com>
This commit is contained in:
parent
7b4123cb78
commit
475893f4de
33
.travis.yml
33
.travis.yml
@ -8,36 +8,13 @@ dist: xenial
|
|||||||
#dist: bionic
|
#dist: bionic
|
||||||
sudo: required
|
sudo: required
|
||||||
|
|
||||||
matrix:
|
language: php
|
||||||
include:
|
|
||||||
- language: php
|
|
||||||
php:
|
|
||||||
- '5.6'
|
|
||||||
- '7.0'
|
|
||||||
- '7.1'
|
|
||||||
- '7.2'
|
|
||||||
- '7.3'
|
|
||||||
- '7.4'
|
|
||||||
- nightly
|
|
||||||
|
|
||||||
- language: node_js
|
|
||||||
node_js:
|
|
||||||
- '12.14.0'
|
|
||||||
before_install:
|
|
||||||
- docker run -d -p 4444:4444 -p 5900:5900 -v /dev/shm:/dev/shm --name selenium selenium/standalone-chrome-debug
|
|
||||||
install:
|
|
||||||
- npm install
|
|
||||||
script: yarn test:e2e test/acceptance/features
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- LAUNCH_URL=http://127.0.0.1/$TRAVIS_BUILD_DIR/htdocs
|
|
||||||
|
|
||||||
# Start on every boot
|
# Start on every boot
|
||||||
services:
|
services:
|
||||||
- memcached
|
- memcached
|
||||||
- mysql
|
- mysql
|
||||||
- postgresql
|
- postgresql
|
||||||
- docker
|
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
# Force postgresql to 9.4 (the oldest availablable on xenial)
|
# Force postgresql to 9.4 (the oldest availablable on xenial)
|
||||||
@ -55,6 +32,14 @@ addons:
|
|||||||
# We need pgloader for import mysql database into pgsql
|
# We need pgloader for import mysql database into pgsql
|
||||||
- pgloader
|
- pgloader
|
||||||
|
|
||||||
|
php:
|
||||||
|
- '5.6'
|
||||||
|
- '7.0'
|
||||||
|
- '7.1'
|
||||||
|
- '7.2'
|
||||||
|
- '7.3'
|
||||||
|
- '7.4'
|
||||||
|
- nightly
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
|
|||||||
56
test/README.md
Normal file
56
test/README.md
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
#Run End-to-End Tests
|
||||||
|
|
||||||
|
###Run Selenium
|
||||||
|
|
||||||
|
Selenium has been used for automating the browser.
|
||||||
|
|
||||||
|
We can run selenium by two ways:
|
||||||
|
|
||||||
|
* Usually, for running tests using selenium we download `selenium standalone server JAR file` and `chrome driver` and start selenium server with a command which usually looks like:
|
||||||
|
|
||||||
|
`java -jar selenium-server-standalone-<selenium version>.jar -port <port-no>`
|
||||||
|
|
||||||
|
* Run selenium in docker with
|
||||||
|
|
||||||
|
`docker run -d -p 4444:4444 -p 5900:5900 -v /dev/shm:/dev/shm selenium/standalone-chrome-debug`
|
||||||
|
|
||||||
|
OR
|
||||||
|
|
||||||
|
`docker run -d --network="host" -v /dev/shm:/dev/shm selenium/standalone-chrome-debug`
|
||||||
|
|
||||||
|
OR
|
||||||
|
|
||||||
|
`docker run -d --network host -v /dev/shm:/dev/shm selenium/standalone-chrome-debug`
|
||||||
|
|
||||||
|
###Run the acceptance tests
|
||||||
|
|
||||||
|
* In `nightwatch.conf.js` file inside the root directory of the project and inside the configuration file following environment variable has been specified. We can change the default values according to our local configuration.
|
||||||
|
|
||||||
|
```
|
||||||
|
const admin_username = process.env.ADMIN_USERNAME || 'dolibarr';
|
||||||
|
|
||||||
|
const admin_password = process.env.ADMIN_PASSWORD || 'password';
|
||||||
|
|
||||||
|
const launch_url = process.env.LAUNCH_URL || 'http://localhost/dolibarr/htdocs/';
|
||||||
|
```
|
||||||
|
* You can run test using following commands
|
||||||
|
|
||||||
|
`yarn run test:e2e test/acceptance/features/<feature_file>`
|
||||||
|
|
||||||
|
For example: `yarn run test:e2e test/acceptance/features/addUsers.feature`
|
||||||
|
|
||||||
|
OR
|
||||||
|
|
||||||
|
`LAUNCH_URL='<launch_url>' ADMIN_USERNAME='<admin_username>' ADMIN_PASSWORD='<admin_password>' yarn run test:e2e test/acceptance/features/`
|
||||||
|
|
||||||
|
The full script to run the acceptance tests is specified in `scripts` object of `package.json` file inside the project's root directory as :
|
||||||
|
|
||||||
|
`"test:e2e": "node_modules/cucumber/bin/cucumber-js --require test/acceptance/index.js --require test/acceptance/stepDefinitions -f node_modules/cucumber-pretty"`
|
||||||
|
|
||||||
|
After you run the above command you can see the test running. For that :
|
||||||
|
|
||||||
|
* open `Remmina` (Remmina is a Remote Desktop Client and comes installed with Ubuntu)
|
||||||
|
|
||||||
|
* choose `VNC` and enter `localhost` on the address bar
|
||||||
|
|
||||||
|
* enter `secret` as the password
|
||||||
Loading…
Reference in New Issue
Block a user