Skip to content

Commit

Permalink
amended selectors and authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
omehes committed Jun 17, 2024
1 parent ad6247c commit e756d50
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
15 changes: 13 additions & 2 deletions tests/ui/pages/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,15 @@ def private_repo_warning_is_visible(self):

@property
def gitpod_user_dropdown(self):
return self.page.wait_for_selector("div:nth-child(1) > div.relative")
return self.page.wait_for_selector("div:nth-child(1) > button:nth-child(1)")

def click_gitpod_user_dropdown(self):
self.gitpod_user_dropdown.click()

@property
def gitpod_user_selector(self):
return self.page.wait_for_selector(
"div:nth-child(1) > div.relative :text('openstax')"
"div:nth-child(1) > button:nth-child(1) :text('openstax')"
)

def click_gitpod_user_selector(self):
Expand All @@ -349,6 +349,17 @@ def continue_with_github_button(self):
def click_continue_with_github_button(self):
self.continue_with_github_button.click()

@property
def continue_with_workspace_is_visible(self):
return self.page.is_visible("div.flex:nth-child(4)")

@property
def continue_with_workspace_button(self):
return self.page.locator("button").get_by_text("Continue (⌘Enter)", exact=True)

def click_continue_with_workspace_button(self):
self.continue_with_github_button.click()

def wait_for_validation_end(
self, condition, timeout_seconds=900, interval_seconds=10
):
Expand Down
9 changes: 8 additions & 1 deletion tests/ui/test_home_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@ def test_home_ui(chrome_page, github_user, github_password, gitpod_repo_url):

github_login_window.click(sign_in_button_selector)

if home.continue_with_github_is_visible:
home.click_continue_with_github_button()

if home.gitpod_user_dropdown.inner_text() != "0 openstax":
home.click_gitpod_user_dropdown()
home.click_gitpod_user_selector()

home.click_workspace_continue_button()
if home.continue_with_github_is_visible:
home.click_continue_with_github_button()

if home.continue_with_workspace_is_visible:
home.click_workspace_continue_button()

# THEN: openstax extension launches and icon appears
assert home.openstax_icon_is_visible
Expand Down

0 comments on commit e756d50

Please sign in to comment.