add docstrings

This commit is contained in:
Waylon Walker 2020-07-26 23:12:45 -05:00 committed by GitHub
parent c210657d32
commit b7df452394
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,9 +11,12 @@ REPOS = [
def test_repos_loaded(slow_driver): def test_repos_loaded(slow_driver):
""" """
Test that GitHub repo cards are loaded client side. Test that the each repo-name exists as a title in one of the repo cards.
On waylonwalker.com repo cards have a title with a class of "repo-name"
""" """
repos = slow_driver.find_elements_by_class_name("repo-name") repos = slow_driver.find_elements_by_class_name("repo-name")
# get innertext from elements
header_text = [ header_text = [
header.text for header in repos header.text for header in repos
] ]
@ -22,7 +25,11 @@ def test_repos_loaded(slow_driver):
def test_repo_description_loaded(slow_driver): def test_repo_description_loaded(slow_driver):
"Test that each repo has a description longer than 10 characters" """
Test that each repo has a description longer than 10 characters
On waylonwalker.com repo cards have a descriptiion with a class of "repo-description"
"""
repo_elements = slow_driver.find_elements_by_class_name("repo") repo_elements = slow_driver.find_elements_by_class_name("repo")
for el in repo_elements: for el in repo_elements:
desc = el.find_element_by_class_name("repo-description") desc = el.find_element_by_class_name("repo-description")
@ -30,6 +37,12 @@ def test_repo_description_loaded(slow_driver):
def test_repo_stars_loaded(slow_driver): def test_repo_stars_loaded(slow_driver):
"""
Ensure that stars are properly parsed from the api and loaded client side
On waylonwalker.com repo cards have a stars element with a class of "repo-stars" and
is displayed as "n stars"
"""
repo_elements = slow_driver.find_elements_by_class_name("repo") repo_elements = slow_driver.find_elements_by_class_name("repo")
for el in repo_elements: for el in repo_elements:
stars = el.find_element_by_class_name("repo-stars") stars = el.find_element_by_class_name("repo-stars")