update test_repos_loaded
This commit is contained in:
parent
13b80faedc
commit
0739810df3
1 changed files with 14 additions and 6 deletions
20
sample.py
20
sample.py
|
|
@ -3,19 +3,27 @@ from src.testproject.sdk.drivers import webdriver
|
|||
REPOS = ['find-kedro', 'kedro-static-viz', 'kedro-action', 'steel-toes', ]
|
||||
RSS = 'https://waylonwalker.com/rss'
|
||||
|
||||
def test_all_links(driver, url):
|
||||
|
||||
|
||||
def test_title_on_every_page(driver):
|
||||
feed = feedparser.parse("https://waylonwalker.com/rss")['entries']
|
||||
for post in feed:
|
||||
driver.get(post['link'])
|
||||
|
||||
|
||||
def test_github_packages(driver):
|
||||
"check that each repo is represented in an h2"
|
||||
header_text = [header.text for header in driver.find_elements_by_tag_name("h2")]
|
||||
@report(test='Test Repos Loaded')
|
||||
def test_repos_loaded():
|
||||
"""
|
||||
Test that GitHub repo cards are loaded client side.
|
||||
"""
|
||||
driver = webdriver.Chrome()
|
||||
repo_elements = driver.find_elements_by_class_name('repo')
|
||||
header_text = [header.text for header in driver.find_elements_by_class_name("repo-name")]
|
||||
for repo in REPOS:
|
||||
if repo not in header_text:
|
||||
return False
|
||||
print(f'{repo} has an h2 tag')
|
||||
print(f'{repo} has an h2 tag')
|
||||
driver.quit()
|
||||
return True
|
||||
|
||||
|
||||
|
|
@ -34,7 +42,7 @@ if __name__ == "__main__":
|
|||
print('number of headers: ', len(headers))
|
||||
print("Test passed") if passed else print("Test failed")
|
||||
print('testing GitHub repos')
|
||||
test_github_packages(driver)
|
||||
test_repos_loaded()
|
||||
# print('testing title on page')
|
||||
# test_title_on_every_page(driver)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue