Skip to content

Commit

Permalink
More integration test audit changes. Issue #2323 (#2454)
Browse files Browse the repository at this point in the history
* More integration test audit changes.

* Revert conftest changes.

* Fix lint error.

* Changed page wait.

Co-authored-by: Jared Lockhart <119884+jaredlockhart@users.noreply.github.com>
  • Loading branch information
b4handjr and jaredlockhart authored Apr 3, 2020
1 parent d6f9922 commit db2dba5
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 2 deletions.
3 changes: 1 addition & 2 deletions app/tests/integration/pages/experiment_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ class DesignPage(Base):
_firefox_pref_type_locator = (By.CSS_SELECTOR, "#id_pref_type")
_firefox_pref_branch_locator = (By.CSS_SELECTOR, "#id_pref_branch")
_new_branch_locator = (By.CSS_SELECTOR, "#add-branch-button")
_page_wait_locator = (By.CSS_SELECTOR, ".page-edit-design")

def wait_for_page_to_load(self):
self.wait.until(
lambda _: self.find_element(*self._page_wait_locator).is_displayed()
lambda _: self.find_element(*self._add_branch_btn_locator).is_displayed()
)
return self

Expand Down
6 changes: 6 additions & 0 deletions app/tests/integration/pages/experiment_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ class DetailPage(Base):

_page_wait_locator = (By.CSS_SELECTOR, "body.page-detail-view")

def wait_for_page_to_load(self):
self.wait.until(
lambda _: self.find_element(*self._page_wait_locator).is_displayed()
)
return self

@property
def objective_section(self):
return self.ObjectivesRegion(self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ class ObjectiveAndAnalysisPage(Base):

_page_wait_locator = (By.CSS_SELECTOR, "body.page-edit-overview")

def wait_for_page_to_load(self):
self.wait.until(
lambda _: self.find_element(*self._page_wait_locator).is_displayed()
)
return self

@property
def objectives_text_box(self):
element = self.find_element(*self._objectives_text_box_locator)
Expand Down
8 changes: 8 additions & 0 deletions app/tests/integration/pages/experiment_overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ class ExperimentOverview(Base):
_save_btn_locator = (By.CSS_SELECTOR, "#save-btn")
_save_and_continue_btn_locator = (By.CSS_SELECTOR, "#save-and-continue-btn")

_page_wait_locator = (By.CSS_SELECTOR, "body.page-edit-overview")

def wait_for_page_to_load(self):
self.wait.until(
lambda _: self.find_element(*self._page_wait_locator).is_displayed()
)
return self

@property
def experiment_type(self):
options = self.find_elements(*self._experiment_type_locator)
Expand Down
6 changes: 6 additions & 0 deletions app/tests/integration/pages/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ class Home(Base):
_create_experiment_btn_locator = (By.CSS_SELECTOR, "a.col.btn-primary")
_page_wait_locator = (By.CSS_SELECTOR, "body.page-list-view")

def wait_for_page_to_load(self):
self.wait.until(
lambda _: self.find_element(*self._page_wait_locator).is_displayed()
)
return self

def create_experiment(self):
self.find_element(*self._create_experiment_btn_locator).click()
from pages.experiment_overview import ExperimentOverview
Expand Down
6 changes: 6 additions & 0 deletions app/tests/integration/pages/owned_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ class OwnedExperiments(Base):
_owned_text_locator = (By.CSS_SELECTOR, ".m-0")
_page_wait_locator = (By.CSS_SELECTOR, "body.page-list-view")

def wait_for_page_to_load(self):
self.wait.until(
lambda _: self.find_element(*self._page_wait_locator).is_displayed()
)
return self

@property
def count(self):
"""Return the number of owned experiments."""
Expand Down
6 changes: 6 additions & 0 deletions app/tests/integration/pages/subscribed_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ class SubscribedExperiments(Base):
_subscribed_text_locator = (By.CSS_SELECTOR, ".m-0")
_page_wait_locator = (By.CSS_SELECTOR, "body.page-list-view")

def wait_for_page_to_load(self):
self.wait.until(
lambda _: self.find_element(*self._page_wait_locator).is_displayed()
)
return self

@property
def count(self):
"""Return the number of subscribed experiments."""
Expand Down

0 comments on commit db2dba5

Please sign in to comment.