Skip to content

Commit

Permalink
Implementação simples do Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
thinogueiras committed Aug 16, 2023
1 parent 30202b1 commit fa54980
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 20 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/ci-robot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Robot Framework - E2E Tests

on:
pull_request:
branches: [ master, develop ]
branches: [ develop ]

jobs:
e2e-tests:
Expand All @@ -16,11 +16,9 @@ jobs:
run: |
pip install robotframework
- name: Install library Browser(Playwright)
run: |
pip install -U pip
- name: Install Playwright (Library Browser)
run: |
pip install robotframework-browser
pip install -U robotframework-browser
- name: Install Node Dependencies
run: |
Expand Down
29 changes: 14 additions & 15 deletions resources/main.resource
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
Documentation Arquivo principal do projeto

Library Browser
Library ../libraries/date.py
# Library ../libraries/date.py

Resource pages/login.resource
Resource pages/dashboard.resource

Resource variables.resource
# Resource variables.resource

*** Variables ***
${BROWSER} Chromium
Expand All @@ -28,19 +28,18 @@ Finish Test
Sleep 1
Take Screenshot

Setup Browserstack
${Datetime} Get Current Datetime
# Setup Browserstack
# ${Datetime} Get Current Datetime

${CAPS} Create Dictionary
... os=Windows
... os_version=11
... browser=chrome
... name=Test Execution: ${Datetime}
... browserstack.username=${BROWSERSTACK_USERNAME}
... browserstack.accessKey=${BROWSERSTACK_ACCESSKEY}
... client.playwrightVersion=latest
# ${CAPS} Create Dictionary
# ... os=Windows
# ... os_version=11
# ... browser=chrome
# ... name=Test Execution: ${Datetime}
# ... browserstack.username=${BROWSERSTACK_USERNAME}
# ... browserstack.accessKey=${BROWSERSTACK_ACCESSKEY}
# ... client.playwrightVersion=latest

${BSENCODEDCAPS} Evaluate urllib.parse.quote( json.dumps(${CAPS}) )
# ${BSENCODEDCAPS} Evaluate urllib.parse.quote( json.dumps(${CAPS}) )

Connect To Browser wss://cdp.browserstack.com/playwright?caps=${BSENCODEDCAPS}

# Connect To Browser wss://cdp.browserstack.com/playwright?caps=${BSENCODEDCAPS}
12 changes: 12 additions & 0 deletions run-tests-with-multi-thread.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
docker run --name robot-tests -it \
-v /${PWD}/resources:/opt/robotframework/resources:Z \
-v /${PWD}/tests:/opt/robotframework/tests:Z \
-e ROBOT_THREADS=10 \
-e PABOT_OPTIONS="--testlevelsplit" \
ppodgorsek/robot-framework:latest

rm -rf $(PWD)/logs

docker cp robot-tests:/opt/robotframework/reports $(PWD)/logs

docker container rm -f robot-tests
10 changes: 10 additions & 0 deletions run-tests-with-single-thread.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
docker run --name robot-tests -it \
-v /${PWD}/resources:/opt/robotframework/resources:Z \
-v /${PWD}/tests:/opt/robotframework/tests:Z \
ppodgorsek/robot-framework:latest

rm -rf $(PWD)/logs

docker cp robot-tests:/opt/robotframework/reports $(PWD)/logs

docker container rm -f robot-tests

0 comments on commit fa54980

Please sign in to comment.