Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amended selectors and authentication for poet #201

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading