-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests(acceptance): Add acceptance tests for global selection header (#…
…18452) This adds some acceptance tests for global selection header, some tests are commented out as they are bugs that need to be fixed.
- Loading branch information
Showing
6 changed files
with
380 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
from __future__ import absolute_import | ||
|
||
from .base import BasePage | ||
|
||
|
||
class GlobalSelectionPage(BasePage): | ||
def __init__(self, browser, client): | ||
super(GlobalSelectionPage, self).__init__(browser) | ||
self.client = client | ||
|
||
def get_selected_project_slug(self): | ||
return self.browser.element('[data-test-id="global-header-project-selector"]').text | ||
|
||
def get_selected_environment(self): | ||
return self.browser.element('[data-test-id="global-header-environment-selector"]').text | ||
|
||
def go_back_to_issues(self): | ||
self.browser.click('[data-test-id="back-to-issues"]') | ||
|
||
def open_project_selector(self): | ||
self.browser.click('[data-test-id="global-header-project-selector"]') | ||
|
||
def select_project_by_slug(self, slug): | ||
project_item_selector = u'//*[@data-test-id="badge-display-name" and text()="{}"]'.format( | ||
slug | ||
) | ||
|
||
self.open_project_selector() | ||
self.browser.wait_until(xpath=project_item_selector) | ||
self.browser.click(xpath=project_item_selector) | ||
|
||
def open_environment_selector(self): | ||
self.browser.click('[data-test-id="global-header-environment-selector"]') | ||
|
||
def select_environment(self, environment): | ||
environment_path = u'//*[text()="{}"]'.format(environment) | ||
|
||
self.open_project_selector() | ||
self.browser.wait_until(xpath=environment_path) | ||
self.browser.click(xpath=environment_path) | ||
|
||
def open_date_selector(self): | ||
self.browser.click('[data-test-id="global-header-timerange-selector"]') | ||
|
||
def select_date(self, date): | ||
date_path = u'//*[text()="{}"]'.format(date) | ||
|
||
self.open_project_selector() | ||
self.browser.wait_until(xpath=date_path) | ||
self.browser.click(xpath=date_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.