Running tests - alandiaz08/e2e-web-framework GitHub Wiki

Using your own browser

The framework only supports chrome and firefox.

1. Install ChromeDriver and/or FirefoxDriver

The ChromeDriver can be installed from here: ChromeDriver Downloads

The GeckoDriver (FirefoxDriver) can be installed from here: GeckoDriver Releases

You can also install them using brew:

brew install geckodriver
brew cask install chromedriver

2. Install Java 11 SDK

The easiest way to install Java is using brew:

brew tap AdoptOpenJDK/openjdk
brew cask install adoptopenjdk11

3. Execute the tests

Go to the root folder of the e2e-web-tests project and execute the following command

./gradlew clean test

This will execute all the tests of the e2e-web-tests project. By default the tests will be executed using Google Chrome. If you want to execute the tests with Firefox then add the -Dbrowser=firefox option like this:

./gradlew clean test -Dbrowser=firefox

Using a local selenium grid

First of all you need to have Java installed. Please see above to install Java 11 SDK.

1. Install docker

Docker can be installed from this website: https://docs.docker.com/docker-for-mac/install/

2. Start the selenium grid

Go to the root folder of the e2e-web-tests project and execute the following command:

docker-compose up -d

This will start a selenium grid with one chrome node and one firefox node.

To check that the grid is up go to http://127.0.0.1:4444/grid/console and you should see both the chrome and firefox node running.

3. Execute the tests on the selenium grid

To execute the tests on the grid, the gridURL argument need to be passed in the command line:

./gradlew clean test -Dbrowser=chrome -DgridURL=http://127.0.0.1:4444/wd/hub

By default the url of the local selenium grid is: http://127.0.0.1:4444/wd/hub

To execute the tests on the firefox node, use the argument -Dbrowser=firefox when running the tests.

4. Watch the test execution

The test recording, browser logs, selenium logs can be seen in http://127.0.0.1:4444/dashboard/#

5. Stop the selenium grid

To stop the selenium grid execute the following command:

docker-compose stop

Additional examples

For more command line examples please read the page Command line arguments