From fa549805b9717422fc93fda8ede01346e142b9c0 Mon Sep 17 00:00:00 2001 From: Thiago Nogueira dos Santos Date: Wed, 16 Aug 2023 14:01:58 -0300 Subject: [PATCH] =?UTF-8?q?Implementa=C3=A7=C3=A3o=20simples=20do=20Docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci-robot.yml | 8 +++----- resources/main.resource | 29 ++++++++++++++--------------- run-tests-with-multi-thread.sh | 12 ++++++++++++ run-tests-with-single-thread.sh | 10 ++++++++++ 4 files changed, 39 insertions(+), 20 deletions(-) create mode 100644 run-tests-with-multi-thread.sh create mode 100644 run-tests-with-single-thread.sh diff --git a/.github/workflows/ci-robot.yml b/.github/workflows/ci-robot.yml index 4502fc4..52a3a65 100644 --- a/.github/workflows/ci-robot.yml +++ b/.github/workflows/ci-robot.yml @@ -2,7 +2,7 @@ name: Robot Framework - E2E Tests on: pull_request: - branches: [ master, develop ] + branches: [ develop ] jobs: e2e-tests: @@ -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: | diff --git a/resources/main.resource b/resources/main.resource index bdc4095..1f29079 100644 --- a/resources/main.resource +++ b/resources/main.resource @@ -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 @@ -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} \ No newline at end of file diff --git a/run-tests-with-multi-thread.sh b/run-tests-with-multi-thread.sh new file mode 100644 index 0000000..755d88e --- /dev/null +++ b/run-tests-with-multi-thread.sh @@ -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 \ No newline at end of file diff --git a/run-tests-with-single-thread.sh b/run-tests-with-single-thread.sh new file mode 100644 index 0000000..5f8fd50 --- /dev/null +++ b/run-tests-with-single-thread.sh @@ -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 \ No newline at end of file