Skip to content

Commit 1586503

Browse files
Update test_local.py
1 parent 375d740 commit 1586503

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_local.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from selenium.webdriver.support import expected_conditions as EC
55
from selenium.webdriver.common.by import By
66
from selenium.common.exceptions import NoSuchElementException, TimeoutException
7+
from percy import percy_snapshot
78

89
# Define a pytest fixture for the WebDriver setup and teardown
910
@pytest.fixture(params=["chrome", "firefox", "safari"], scope="function")
@@ -29,7 +30,7 @@ def test_add_to_cart(driver):
2930

3031
# Wait for the page title to contain 'StackDemo'
3132
WebDriverWait(driver, 30).until(EC.title_contains('StackDemo'))
32-
PercySDK.screenshot(driver, "page1")
33+
percy_snapshot(driver, 'page1')
3334
# Get the text of the product - iPhone 12
3435
item_on_page = WebDriverWait(driver, 10).until(
3536
EC.visibility_of_element_located((By.XPATH, '//*[@id="1"]/p'))
@@ -44,7 +45,7 @@ def test_add_to_cart(driver):
4445
WebDriverWait(driver, 30).until(
4546
EC.visibility_of_element_located((By.CLASS_NAME, 'float-cart__content'))
4647
)
47-
PercySDK.screenshot(driver, "page2")
48+
percy_snapshot(driver, 'page2')
4849
# Get the text of the product in the cart
4950
item_in_cart = WebDriverWait(driver, 30).until(
5051
EC.visibility_of_element_located((By.XPATH, '//*[@id="__next"]/div/div/div[2]/div[2]/div[2]/div/div[3]/p[1]'))

0 commit comments

Comments
 (0)