|
@@ -2,14 +2,21 @@
|
|
|
|
|
|
### Run Selenium
|
|
### 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`.
|
|
[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`.
|
|
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:
|
|
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`
|
|
`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.
|
|
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:
|
|
* 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`
|
|
`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:
|
|
* 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
|
|
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
|
|
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>';`
|
|
`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 :
|
|
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 :
|
|
|
|
|