Skip to content

Commit

Permalink
Merge pull request #12 from BlueBrain/wip/ayimaster
Browse files Browse the repository at this point in the history
Add a locator for contributor
  • Loading branch information
ayimaok authored Dec 12, 2024
2 parents c96affb + f78ee69 commit 833c43d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
9 changes: 5 additions & 4 deletions locators/home_page_locators.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
class HomePageLocators:
LOGIN_BUTTON = (By.XPATH, "//a[contains(.,'Log in')]")
ABOUT = (By.XPATH, "(//a[@href='/app/about'])[2]")
A_LETTER = (By.XPATH, "//button[.='A']")
BB_GITHUB_BTN = (By.XPATH, "(//a[@href='https://github.com/BlueBrain'])[2]")
BBOP1 = (By.XPATH, "(//a[@href='/app'])[1]")
BBOP2 = (By.XPATH, "(//a[@href='/app'])[2]")
Expand All @@ -19,12 +20,12 @@ class HomePageLocators:
CONTRIBUTOR_TABLE = (By.XPATH, "//div[@class='relative mt-4 grid w-full grid-cols-1 gap-x-12 "
"gap-y-8 px-6 md:grid-cols-3 md:gap-y-20 md:px-0 "
"lg:grid-cols-4 2xl:grid-cols-5']")
DOC1 = (By.CSS_SELECTOR, "a[href='https://bluebrainnexus.io/']")
DOC2 = (By.CSS_SELECTOR, "a[href='https://channelpedia.epfl.ch/']")
DOC3 = (By.CSS_SELECTOR, "a[href='a[href='https://bbp.epfl.ch/nmc-portal/welcome.html']")
DOC4 = (By.CSS_SELECTOR, "a[href='a[href='a[href='https://www.hippocampushub.eu/']")
MAIN_TITLE = (By.XPATH, "//h1[contains(text(),'Virtual labs')]")
P1 = (By.XPATH, "//p[contains(text(),'The Blue Brain Open Platform is built on')]")
TITLE1 = (By.XPATH, "//h4[contains(text(),'Prefer')]")
TITLE2 = (By.XPATH, "//h4[contains(text(),'who advanced the Blue Brain Project scientifically "
"over the years.')]")
DOC1 = (By.CSS_SELECTOR, "a[href='https://bluebrainnexus.io/']")
DOC2 = (By.CSS_SELECTOR, "a[href='https://channelpedia.epfl.ch/']")
DOC3 = (By.CSS_SELECTOR, "a[href='a[href='https://bbp.epfl.ch/nmc-portal/welcome.html']")
DOC4 = (By.CSS_SELECTOR, "a[href='a[href='a[href='https://www.hippocampushub.eu/']")
3 changes: 3 additions & 0 deletions pages/home_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def find_contributor_table(self):
def find_contributor(self):
return self.find_element(HomePageLocators.CONTRIBUTOR)

def find_a_letter(self):
return self.find_element(HomePageLocators.A_LETTER)

def find_github_btn(self):
return self.find_element(HomePageLocators.BB_GITHUB_BTN)

Expand Down
5 changes: 5 additions & 0 deletions tests/test_homepage.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ def test_homepage(self, setup, logger):
assert logo1.is_displayed(), "The logo is not displayed"
logger.info("Bottom logo is displayed")

letter_a = home_page.find_a_letter()
assert letter_a, f"Letter A is not found"
letter_a.click()
time.sleep(3)

login_button = home_page.find_login_button()
assert login_button.is_displayed()
logger.info("'Login' button is found")
Expand Down

0 comments on commit 833c43d

Please sign in to comment.