add tests
This commit is contained in:
parent
be5b06bd3f
commit
a12e213871
3 changed files with 81 additions and 0 deletions
19
tests/test_scroll.py
Normal file
19
tests/test_scroll.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
"Test that more cards load after scrolling"
|
||||
from src.testproject.sdk.drivers import webdriver
|
||||
import time
|
||||
|
||||
def test_cards_load(driver):
|
||||
"test that cards load on the page, and more load as we scroll"
|
||||
num_cards = []
|
||||
num_cards.append(len(driver.find_elements_by_class_name('post-wrapper')))
|
||||
|
||||
driver = webdriver.Chrome()
|
||||
driver.execute_script("window.scrollTo(0, 100000)")
|
||||
# time.sleep(3)
|
||||
num_cards.append(len(driver.find_elements_by_class_name('post-wrapper')))
|
||||
|
||||
# test that cards are loaded
|
||||
assert num_cards[0] >= 3
|
||||
# test that more cards are loaded after scrolling
|
||||
assert num_cards[0] > num_cards[1]
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue