Skip to content

Commit

Permalink
Ajustes Browserstack com Playwright(Browser Library)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinogueiras committed Aug 14, 2023
1 parent 606c00e commit 30202b1
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
.vscode
logs
results
log.html
output.xml
playwright-log.txt
report.html
interactive_console_output.xml
results
pabot_results
.pabotsuitenames
resources/variables.resource
__pycache__
.env
6 changes: 6 additions & 0 deletions libraries/date.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from datetime import datetime

def get_current_datetime():
data = datetime.now()

return data.strftime('%d/%m/%Y %H:%M:%S')
27 changes: 24 additions & 3 deletions resources/main.resource
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
Documentation Arquivo principal do projeto

Library Browser
Library ../libraries/date.py

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

Resource variables.resource

*** Variables ***
${BROWSER} Chromium
${HEADLESS} False
${BROWSER} Chromium
${HEADLESS} True

*** Keywords ***
Do Login
Expand All @@ -19,7 +22,25 @@ Do Login

Start Test
New Browser browser=${BROWSER} headless=${HEADLESS}
#Setup Browserstack

Finish Test
Sleep 1
Take Screenshot
Take Screenshot

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

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

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

0 comments on commit 30202b1

Please sign in to comment.