Skip to content

Commit

Permalink
add run script
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanni8 committed Jan 7, 2024
1 parent 256f590 commit 2acc9f6
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
**/__pycache__/**
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# m450-lb3
# M450-lb3

50 changes: 50 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

# Scriptheaders are for noobs :)

export $(cat .env | xargs)

echo "Starting Playwright tests..."

cd playwright

. venv/bin/activate

PLAYWRIGHT_URL="https:$(browserstack-sdk pytest -s ./tests/test.py | grep "View build on BrowserStack dashboard:" | rev | cut -d ":" -f 1 | rev)"

cd ..

echo "Finished Playwright tests..."


echo "Starting Selenium tests..."

cd selenium

. venv/bin/activate

SELENIUM_URL="https:$(browserstack-sdk python ./tests/test.py | grep "View build on BrowserStack dashboard:" | rev | cut -d ":" -f 1 | rev)"

cd ..

echo "Finished Selenium tests..."

echo "Starting Puppeteer tests..."

cd puppeteer

node test.spec.js > /dev/null

echo "Finished Puppeteer tests..."

echo "\n\n\n"

echo "#####################"

echo "Playwright Report: $PLAYWRIGHT_URL"

echo "Selenium Report: $SELENIUM_URL"

echo "Puppeteer has no report. View test results in the web console."

echo "#####################"
4 changes: 4 additions & 0 deletions selenium/browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ platforms:
osVersion: 17
browserName: safari
deviceOrientation: portrait
- deviceName: Google Pixel 8 Pro
osVersion: 14.0
browserName: chrome
deviceOrientation: portrait
- os: OS X
osVersion: Sonoma
browserName: Firefox
Expand Down
4 changes: 4 additions & 0 deletions selenium/tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def close_welcome_message(driver: webdriver.Chrome) -> None:
)
driver.find_element(By.CSS_SELECTOR, "#welcome-wrapper #close-action").click()

driver.implicitly_wait(1)

if len(driver.find_elements(By.ID, "welcome-wrapper")) == 0:
driver.execute_script(
'browserstack_executor: {"action": "setSessionStatus", "arguments": {"status":"passed", "reason": "Welcome message closed successfully"}}'
Expand Down Expand Up @@ -68,6 +70,8 @@ def close_welcome_message_with_button(driver: webdriver.Chrome) -> None:

driver.find_element(By.CSS_SELECTOR, "#welcome-wrapper #action > button").click()

driver.implicitly_wait(1)

if len(driver.find_elements(By.ID, "welcome-wrapper")) == 0:
driver.execute_script(
'browserstack_executor: {"action": "setSessionStatus", "arguments": {"status":"passed", "reason": "Welcome message closed successfully"}}'
Expand Down

0 comments on commit 2acc9f6

Please sign in to comment.