From ec8fd130f4e7d0ce0d8bff990e5de3176c1283c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 16 Dec 2020 17:33:40 +0100 Subject: [PATCH] Update doc --- nightwatch.conf.js | 2 +- package.json | 2 +- test/acceptance/README.md | 32 +++++++++++++++++++++----------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/nightwatch.conf.js b/nightwatch.conf.js index e72febea91863..38178aadf9238 100644 --- a/nightwatch.conf.js +++ b/nightwatch.conf.js @@ -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 diff --git a/package.json b/package.json index 56f8ced1d4bd7..02c9b2abcb9b7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "devDependencies": { "cucumber": "^6.0.5", - "nightwatch": "^1.4.3", + "nightwatch": "^1.5.1", "nightwatch-api": "^3.0.1" }, "scripts": { diff --git a/test/acceptance/README.md b/test/acceptance/README.md index ada096c0b6953..141370208d0ad 100644 --- a/test/acceptance/README.md +++ b/test/acceptance/README.md @@ -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-.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=''; ADMIN_USERNAME=''; ADMIN_PASSWORD='';` - `yarn run test:e2e test/acceptance/features/` + `yarnpkg run test:e2e test/acceptance/features/` - 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 :