|
@@ -20,27 +20,12 @@ Please view the README at the root directory of the project.
|
|
|
Included in the docker-compose file is an image containing Firefox Nightly.
|
|
|
[tox][Tox] is our test environment manager and [pytest][pytest] is the test runner.
|
|
|
|
|
|
-To run the tests, execute the command below:
|
|
|
-1. Make sure all of the images are running:
|
|
|
+To run the tests, execute the commands below:
|
|
|
```sh
|
|
|
-docker-compose ps
|
|
|
-```
|
|
|
-If not start them detached:
|
|
|
-```sh
|
|
|
-docker-compose up -d
|
|
|
-```
|
|
|
-2. Start the tests within the docker container
|
|
|
-```sh
|
|
|
-npm run test:integration-docker
|
|
|
+npm run build
|
|
|
+npm run test-integration
|
|
|
```
|
|
|
|
|
|
-If you have [geckodriver][geckodriver] installed you can use these steps:
|
|
|
-```sh
|
|
|
-npm start &
|
|
|
-npm run test:integration
|
|
|
-```
|
|
|
-This will use your local Firefox installation.
|
|
|
-
|
|
|
### Adding a test
|
|
|
|
|
|
The tests are written in Python using a POM, or Page Object Model. The plugin we use for this is called [pypom][pypom]. Please read the documentation there for good examples on how to use the Page Object Model when writing tests.
|
|
@@ -60,21 +45,13 @@ If not start them detached:
|
|
|
docker-compose up -d
|
|
|
```
|
|
|
|
|
|
-2. Copy the port that is forwarded for the ```selenium-firefox``` image:
|
|
|
-```sh
|
|
|
-0.0.0.0:32771->5900/tcp
|
|
|
-```
|
|
|
-Note: Your port may not match what is seen here.
|
|
|
-
|
|
|
-You will want to copy what ever IP address and port is before the ```->5900/tcp```.
|
|
|
-
|
|
|
-3. Open your favorite VNC viewer and type in, or paste that address.
|
|
|
-4. The password is ```secret```.
|
|
|
-5. The viewer should open a window with a Ubuntu logo. If that happens you are connected to the ```selenium-firefox``` image and if you start the test, you should see a Firefox window open and the tests running.
|
|
|
+2. Open your favorite VNC viewer and type in `localhost:5900`.
|
|
|
+3. The password is ```secret```.
|
|
|
+4. The viewer should open a window with a Ubuntu logo. If that happens you are connected to the ```selenium-firefox``` image and if you start the test, you should see a Firefox window open and the tests running.
|
|
|
|
|
|
### Debugging a failure
|
|
|
|
|
|
-Whether a test passes or fails will result in a HTML report being created. This report will have detailed information of the test run and if a test does fail, it will provide geckodriver logs, terminal logs, as well as a screenshot of the browser when the test failed. We use a pytest plugin called [pytest-html][pytest-html] to create this report. The report can be found within the root directory of the project and is named ```send-test.html```. It should be viewed within a browser.
|
|
|
+Whether a test passes or fails will result in a HTML report being created. This report will have detailed information of the test run and if a test does fail, it will provide geckodriver logs, terminal logs, as well as a screenshot of the browser when the test failed. We use a pytest plugin called [pytest-html][pytest-html] to create this report. The report can be found at ```coverage/send-test.html```. It should be viewed within a browser.
|
|
|
|
|
|
[flake8]: http://flake8.pycqa.org/en/latest/
|
|
|
[git-clone]: https://help.github.com/articles/cloning-a-repository/
|