diff --git a/.gitignore b/.gitignore index ca91b7a..0f2dc0c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /local.log +env diff --git a/README.md b/README.md index 0b2d5c6..0d1124f 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,10 @@ pip3 install -r requirements.txt * Run sample test: - To run the sample test across platforms defined in the `browserstack.yml` file, run: ``` - browserstack-sdk ./scripts/test.py + browserstack-sdk ./tests/test.py ``` * Run tests on locally hosted website: - To run the local test across platforms defined in the `browserstack.yml` file, run: ``` - browserstack-sdk ./scripts/local-test.py + browserstack-sdk ./tests/local-test.py ``` diff --git a/tests/local-test.py b/tests/local-test.py index 3d31daa..5271b2b 100644 --- a/tests/local-test.py +++ b/tests/local-test.py @@ -1,8 +1,5 @@ import json from selenium import webdriver -from selenium.webdriver.support.ui import WebDriverWait -from selenium.webdriver.support import expected_conditions as EC -from selenium.webdriver.common.by import By from selenium.webdriver.chrome.options import Options as ChromeOptions options = ChromeOptions() @@ -15,11 +12,10 @@ options=options) try: - driver.get('http://bs-local.com:45691/check') - body_text = WebDriverWait(driver, 10).until( - EC.visibility_of_element_located((By.CSS_SELECTOR, 'body'))).text + driver.get('http://bs-local.com:45454') + page_title = driver.title # check if local connected successfully - if body_text == 'Up and running': + if 'BrowserStack Local' in page_title: # mark test as passed if Local website is accessible driver.execute_script( 'browserstack_executor: {"action": "setSessionStatus", "arguments": {"status":"passed", "reason": "Local Test ran successfully"}}')