Skip to content

Commit

Permalink
Update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Dec 16, 2020
1 parent e4c853b commit ec8fd13
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion nightwatch.conf.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"devDependencies": {
"cucumber": "^6.0.5",
"nightwatch": "^1.4.3",
"nightwatch": "^1.5.1",
"nightwatch-api": "^3.0.1"
},
"scripts": {
Expand Down
32 changes: 21 additions & 11 deletions test/acceptance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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`

Expand All @@ -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
```

Expand All @@ -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 :

Expand Down

0 comments on commit ec8fd13

Please sign in to comment.