diff --git a/README.md b/README.md index e923170..923e276 100644 --- a/README.md +++ b/README.md @@ -51,3 +51,20 @@ Pre-setup Github Actions (for Allure report generation) - Select this branch with "/(root)" -> Save Github Actions is ready for deploying Allure report after test phase execution + +### Selenium Grid 4 + +For running tests inside Selenium Grid, should be run docker-compose file for Apple Silicon (M1 - M3) in the project root before + +To set up and tear down Selenium Grid use the following commands + +```bash +docker-compose up -d +docker-compose down +``` + +To run tests + +```bash +SELENIUM_REMOTE_URL=http://localhost:4444 ./gradlew clean cucumber -Dparallel=true +``` diff --git a/build.gradle b/build.gradle index 6212d10..c6d1e32 100644 --- a/build.gradle +++ b/build.gradle @@ -64,6 +64,7 @@ dependencies { tasks.register('initPlaywright', JavaExec) { classpath = sourceSets.main.runtimeClasspath mainClass = "com.microsoft.playwright.CLI" + args 'install' } test { diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..cbd15f5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,46 @@ +# To execute this docker-compose yml file use `docker-compose -f docker-compose.yml up` +# Add the `-d` flag at the end for detached execution +# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose.yml down` +# For scaling nodes use `--scale chrome=4` +version: "3" +services: + chrome: + image: seleniarm/node-chromium:latest + shm_size: 2gb + depends_on: + - selenium-hub + environment: + - SE_EVENT_BUS_HOST=selenium-hub + - SE_EVENT_BUS_PUBLISH_PORT=4442 + - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 + - SE_NODE_MAX_INSTANCES=1 + - SE_NODE_MAX_SESSIONS=4 + - SE_NODE_SESSION_TIMEOUT=180 + - SE_VNC_NO_PASSWORD=1 + - SE_NODE_GRID_URL=http://localhost:4444 + + firefox: + image: seleniarm/node-firefox:latest + shm_size: 2gb + depends_on: + - selenium-hub + environment: + - SE_EVENT_BUS_HOST=selenium-hub + - SE_EVENT_BUS_PUBLISH_PORT=4442 + - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 + - SE_NODE_MAX_INSTANCES=1 + - SE_NODE_MAX_SESSIONS=1 + - SE_NODE_SESSION_TIMEOUT=180 + - SE_VNC_NO_PASSWORD=1 + - SE_NODE_GRID_URL=http://localhost:4444 + + selenium-hub: + image: seleniarm/hub:latest + container_name: selenium-hub + environment: + - GRID_TIMEOUT=30 + - GRID_BROWSER_TIMEOUT=600 + ports: + - "4442:4442" + - "4443:4443" + - "4444:4444" \ No newline at end of file