Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Selenium tests updated
Browse files Browse the repository at this point in the history
- Fix test_client_disabling
- Get environment variables in own method
- Make chromedriver path an environment variable and check for it
- Remove empty lines
- Add excplicit wait in job cancel test
- Fix test_client_disabling by going back to dashboard before disabling a client
- Test if available localizations are in place

Signed-off-by: Frank Bergkemper <frank.bergkemper@bareos.com>
  • Loading branch information
[Aron Schueler] authored and fbergkemper committed Apr 20, 2018
1 parent e9c1649 commit 0acd6cd
Show file tree
Hide file tree
Showing 2 changed files with 264 additions and 167 deletions.
17 changes: 13 additions & 4 deletions tests/selenium/README.md
Expand Up @@ -6,13 +6,14 @@ This test checks the Bareos WebUI by using seleniums webdriver.

* Python >= 2.7
* Selenium >= 3.4.0
* chromedriver or geckodriver
* chromedriver for Chrome/Chromium testing, geckodriver for Firefox testing.

## Setting up the test

To run the test you must set certain environment variables:

* `BAREOS_BROWSER`: The test takes either 'firefox' or 'chrome', default: `firefox`

* `BAREOS_BASE_URL`: The base url of the bareos-webui, default: `http://127.0.0.1/bareos-webui/`.
* `BAREOS_USERNAME`: Login user name, default: `admin`
* `BAREOS_PASSWORD`: Login password, default: `secret`
Expand All @@ -21,9 +22,13 @@ To run the test you must set certain environment variables:
* `BAREOS_LOG_PATH`: Directory to create selenium log files. The default path is the current directory.
* `BAREOS_DELAY`: Delay between action is seconds. Useful for debugging. Default is `0.0`

### Optional:

* `BAREOS_CHROMEDRIVER_PATH`: Set the path to your chromedriver here.

## Running the test

`
```
BAREOS_BASE_URL=http://127.0.0.1/bareos-webui/
BAREOS_USERNAME=admin
BAREOS_PASSWORD=linuxlinux
Expand All @@ -32,6 +37,10 @@ BAREOS_RESTOREFILE=/etc/passwd
BAREOS_LOG_PATH=/tmp/selenium-logs/
BAREOS_DELAY=1
python webui-selenium-test.py -v
`
```

After setting the environment variables you can run the test. Use `-v`option of our test to show the progress and results of each test.

## Debugging

If you meet all the requirements and set the environment variables you can run the test with `python webui-selenium-test.py`.
After the test fails you will see an exception that was thrown. If this does not help you, take a look inside the generated log file, located in the same path as your `webui-selenium-test.py` file.

0 comments on commit 0acd6cd

Please sign in to comment.