Grumpy is simple blog engine with minimal functionality.
Tests is written on Java using jUnit and Selenide as the wrapper on Selenium WebDriver. They run in parallel in different browsers using Selenoid as implementation of Selenium hub. As status page is used Selenoid UI as user interface for Selenoid. For reports is used the Allure.
docker-compose -f .stack/docker/docker-compose.yml up -d --build --force-recreate
After building you have:
http://localhost:8080
- The apphttp://localhost:8181
- Selenoid UI
Pull specific browser images:
docker pull selenoid/vnc:chrome_65.0
docker pull selenoid/vnc:firefox_58.0
docker pull selenoid/vnc:opera_51.0
Execute all tests:
mvn clean test
Only end-to-end tests:
mvn clean test -Pe2e
Or only acceptance tests:
mvn clean test -Pacceptance
Serve the report:
allure serve
Or generate and open it:
allure generate
allure open
In order to add and work with some specific browser you need:
- Make sure that this version of the browser is in the list.
- Pull the image with this browser. For example:
docker pull selenoid/vnc:chrome_63.0
- Add this browser to Selenoid's config file called browsers.json:
"chrome": {
"default": "65.0",
"versions": {
"65.0": {
"image": "selenoid/vnc:chrome_65.0",
"port": "4444"
},
"63.0": {
"image": "selenoid/vnc:chrome_63.0",
"port": "4444"
}
}
}
- Rebuild the application.
- And finally add it to test configs:
public static LinkedList<String[]> getEnvironments() {
LinkedList<String[]> env = new LinkedList<String[]>();
env.add(new String[]{"chrome", "65.0", properties.getProperty("grid.url"), Platform.LINUX.toString()});
env.add(new String[]{"firefox", "58.0", properties.getProperty("grid.url"), Platform.LINUX.toString()});
env.add(new String[]{"opera", "51.0", properties.getProperty("grid.url"), Platform.LINUX.toString()});
// new browser here
env.add(new String[]{"chrome", "63.0", properties.getProperty("grid.url"), Platform.LINUX.toString()});
return env;
}
config.properties:
app.url=http://172.17.0.2:8080
grid.url=http://localhost:4444/wd/hub
retries.times=1
test.threads=4
files.path=src/test/resources/files/
retries.times
- The number of retries of tests that failed.test.threads
- The number of threads to use when running tests in parallel.files.path
- Path to the directory which contains data set for tests.