forked from prashanth-volvocars/docker-selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding a test to verify the video file is generated (SeleniumHQ#1115)
- Loading branch information
Showing
10 changed files
with
213 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Test video files | ||
|
||
on: | ||
push: | ||
branches: | ||
- trunk | ||
pull_request: | ||
branches: | ||
- trunk | ||
|
||
jobs: | ||
build-and-test: | ||
# Skip job based on the commit message, only works in push to branches for now | ||
if: contains(toJson(github.event.commits), '[skip ci]') == false | ||
name: Test video recorded through Docker Selenium | ||
runs-on: ubuntu-18.04 | ||
strategy: | ||
matrix: | ||
use-random-user: [false, true] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Output Docker info | ||
run: docker info | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Get branch name (only for push to branch) | ||
if: github.event_name == 'push' | ||
run: echo "::set-env name=BRANCH::$(echo ${PUSH_BRANCH##*/})" | ||
env: | ||
PUSH_BRANCH: ${{ github.ref }} | ||
- name: Get target branch name (only for PRs) | ||
if: github.event_name == 'pull_request' | ||
run: echo "::set-env name=BRANCH::$(echo ${TARGET_BRANCH##*/})" | ||
env: | ||
TARGET_BRANCH: ${{ github.head_ref }} | ||
- name: Output branch name | ||
run: echo ${BRANCH} | ||
- name: Sets build date | ||
run: echo ::set-env name=BUILD_DATE::$(date '+%Y%m%d') | ||
- name: Run Docker Compose to record video | ||
run: USE_RANDOM_USER_ID=${USE_RANDOM_USER} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make test_video | ||
env: | ||
USE_RANDOM_USER: ${{ matrix.use-random-user }} | ||
- name: Upload recorded Chrome video | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: chrome_video | ||
path: ./tests/videos/chrome_video.mp4 | ||
- name: Upload recorded Firefox video | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: firefox_video | ||
path: ./tests/videos/firefox_video.mp4 | ||
- name: Upload recorded Opera video | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: opera_video | ||
path: ./tests/videos/opera_video.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
docker-selenium-tests | ||
.env | ||
videos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM python:3.8.6-buster | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# How to run this? | ||
# docker-compose -f docker-compose-v3-test-video.yml up --abort-on-container-exit --build | ||
# To clean up, `docker-compose -f docker-compose-v3-test-video.yml down` | ||
version: "3" | ||
services: | ||
browser: | ||
image: selenium/node-${BROWSER}:${TAG:-test-video} | ||
volumes: | ||
- /dev/shm:/dev/shm | ||
depends_on: | ||
- selenium-hub | ||
environment: | ||
- SE_EVENT_BUS_HOST=selenium-hub | ||
- SE_EVENT_BUS_PUBLISH_PORT=4442 | ||
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443 | ||
ports: | ||
- "6900:5900" | ||
|
||
browser_video: | ||
image: selenium/video:${VIDEO_TAG:-test-video} | ||
volumes: | ||
- ./videos:/videos | ||
depends_on: | ||
- browser | ||
environment: | ||
- DISPLAY_CONTAINER_NAME=browser | ||
- FILE_NAME=${VIDEO_FILE_NAME} | ||
|
||
selenium-hub: | ||
image: selenium/hub:${TAG:-test-video} | ||
container_name: selenium-hub | ||
ports: | ||
- "4442:4442" | ||
- "4443:4443" | ||
- "4444:4444" | ||
|
||
tests: | ||
image: docker-selenium-tests:latest | ||
build: | ||
context: ./ | ||
dockerfile: ./Dockerfile | ||
depends_on: | ||
- selenium-hub | ||
environment: | ||
- RUN_IN_DOCKER_COMPOSE=true | ||
- SELENIUM_GRID_HOST=selenium-hub | ||
command: ["./bootstrap.sh", "${NODE}"] |
Oops, something went wrong.