Update doc

This commit is contained in:
Laurent Destailleur 2020-12-16 17:33:40 +01:00
parent e4c853b162
commit ec8fd130f4
3 changed files with 23 additions and 13 deletions

View File

@ -1,5 +1,5 @@
const admin_username = process.env.ADMIN_USERNAME || 'admin';
const admin_password = process.env.ADMIN_PASSWORD || 'password';
const admin_password = process.env.ADMIN_PASSWORD || 'admin';
const launch_url = process.env.LAUNCH_URL || 'http://localhost/dolibarr/htdocs/';
module.exports = {
page_objects_path : './test/acceptance/pageObjects/', // jshint ignore:line

View File

@ -1,7 +1,7 @@
{
"devDependencies": {
"cucumber": "^6.0.5",
"nightwatch": "^1.4.3",
"nightwatch": "^1.5.1",
"nightwatch-api": "^3.0.1"
},
"scripts": {

View File

@ -2,14 +2,21 @@
### Run Selenium
Selenium has been used for automating the browser.
Create a working directory
`mkdir selenium; cd selenium;`
Selenium has been used for automating the browser.
[Download](https://www.selenium.dev/downloads/) the `latest stable version` of the `Selenium standalone server JAR file`.
`wget https://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar`
Also [download](https://chromedriver.chromium.org/downloads) the `latest stable version` of `Chrome Driver`.
Once you have downloaded Chrome Driver, you need to unzip it by running the following command:
`wget https://chromedriver.storage.googleapis.com/86.0.4240.22/chromedriver_linux64.zip`
`unzip chromedriver_linux64.zip`
Once you have unzipped it, you need to move the *chromedriver* file (shared library) and place it inside the same folder where you have placed the Selenium standalone server file.
@ -18,10 +25,9 @@ Now we can run selenium by two ways:
* Start selenium server with a command which usually looks like:
`java -jar selenium-server-standalone-<selenium version>.jar -port 4444`
`java -jar selenium-server-standalone-*.jar -port 4444`
* Run selenium in docker with
* Or run selenium in docker with
`docker run -d -p 4444:4444 -p 5900:5900 -v /dev/shm:/dev/shm selenium/standalone-chrome-debug`
@ -34,16 +40,20 @@ Now we can run selenium by two ways:
* Install *yarn*. For example on Ubuntu:
```
apt install yarnpkg
sudo apt install yarnpkg
```
* Install *nodejs* libraries. For example on Ubuntu:
* Install *npm* tools to manage *nodejs* libraries. For example on Ubuntu:
```
apt install npm
npm install cucumber
npm install nightwatch-api
npm install nightwatch
```
* Go into the git local repository of the Dolibarr version to test.
```
cd ~/git/dolibarr
npm install cucumber nightwatch-api nightwatch
npm update
```
@ -61,9 +71,9 @@ Now we can run selenium by two ways:
`LAUNCH_URL='<launch_url>'; ADMIN_USERNAME='<admin_username>'; ADMIN_PASSWORD='<admin_password>';`
`yarn run test:e2e test/acceptance/features/<feature_file>`
`yarnpkg run test:e2e test/acceptance/features/<feature_file>`
For example: `yarn run test:e2e test/acceptance/features/WebUI/addUsers.feature`
For example: `yarnpkg run test:e2e test/acceptance/features/WebUI/addUsers.feature`
Note: The script to run all the acceptance tests is specified in `scripts` object of `package.json` file inside the project's root directory as :