Skip to content

Commit 9fef37d

Browse files
committed
Added bstack to file names
1 parent 0029786 commit 9fef37d

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

tests/bstack-local-test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import pytest
2+
3+
def test_local(selenium):
4+
selenium.get('http://bs-local.com:45454')
5+
local_page_title = selenium.title
6+
assert local_page_title == 'BrowserStack Local'

tests/bstack-sample-test.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import pytest
2+
from selenium.webdriver.common.by import By
3+
4+
def test_example(selenium):
5+
selenium.get('https://bstackdemo.com/')
6+
7+
# locating product on webpage and getting name of the product
8+
productText = selenium.find_element(By.XPATH, '//*[@id="1"]/p').text
9+
10+
# clicking the 'Add to cart' button
11+
selenium.find_element(By.XPATH, '//*[@id="1"]/div[4]').click()
12+
13+
# waiting until the Cart pane has been displayed on the webpage
14+
selenium.find_element(By.CLASS_NAME, 'float-cart__content')
15+
16+
# locating product in cart and getting name of the product in cart
17+
productCartText = selenium.find_element(By.XPATH, '//*[@id="__next"]/div/div/div[2]/div[2]/div[2]/div/div[3]/p[1]').text
18+
19+
# checking whether product has been added to cart by comparing product name
20+
assert productCartText == productText

0 commit comments

Comments
 (0)