Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Commit

Permalink
Merge pull request #345 from davehunt/pypom-dev4
Browse files Browse the repository at this point in the history
Merging
  • Loading branch information
rbillings committed May 24, 2016
2 parents 508d147 + e527d52 commit f35dff9
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 51 deletions.
10 changes: 5 additions & 5 deletions oneanddone/tests/functional/pages/base.py
Expand Up @@ -23,21 +23,21 @@ def set_field(self, locator, value):

@property
def is_user_logged_in(self):
return not self.is_element_displayed(self._login_locator)
return not self.is_element_displayed(*self._login_locator)

@property
def is_login_button_visible(self):
return self.is_element_displayed(self._login_locator)
return self.is_element_displayed(*self._login_locator)

@property
def profile_link_text(self):
return self.find_element(self._profile_link_locator).text
return self.find_element(*self._profile_link_locator).text

def click_login(self):
self.find_element(self._login_locator).click()
self.find_element(*self._login_locator).click()

def click_user_profile_details(self):
self.find_element(self._profile_link_locator).click()
self.find_element(*self._profile_link_locator).click()
from pages.user.user_profile_details import UserProfileDetailsPage
return UserProfileDetailsPage(self.selenium, self.base_url).wait_for_page_to_load()

Expand Down
16 changes: 8 additions & 8 deletions oneanddone/tests/functional/pages/home.py
Expand Up @@ -21,33 +21,33 @@ class HomePage(Base):

@property
def displayed_profile_name(self):
return self.find_element(self._displayed_profile_name_locator).text
return self.find_element(*self._displayed_profile_name_locator).text

@property
def is_task_in_progress(self):
return self.is_element_displayed(self._task_in_progress_locator)
return self.is_element_displayed(*self._task_in_progress_locator)

@property
def task_in_progress(self):
return self.find_element(self._task_in_progress_locator).text
return self.find_element(*self._task_in_progress_locator).text

@property
def is_suggested_first_tasks_heading_visible(self):
return self.is_element_displayed(self._suggested_first_tasks_heading_locator)
return self.is_element_displayed(*self._suggested_first_tasks_heading_locator)

@property
def suggested_first_tasks(self):
return [Task(self, web_element) for web_element in
self.find_elements(self._suggested_first_task_locator)]
self.find_elements(*self._suggested_first_task_locator)]

def click_task_in_progress(self):
self.find_element(self._task_in_progress_locator).click()
self.find_element(*self._task_in_progress_locator).click()
return TaskDetailsPage(self.selenium, self.base_url).wait_for_page_to_load()

def click_pick_a_task_button(self):
self.find_element(self._pick_a_task_locator).click()
self.find_element(*self._pick_a_task_locator).click()
return AvailableTasksPage(self.selenium, self.base_url).wait_for_page_to_load()

def click_available_tasks(self):
self.find_element(self._available_tasks_locator).click()
self.find_element(*self._available_tasks_locator).click()
return AvailableTasksPage(self.selenium, self.base_url).wait_for_page_to_load()
6 changes: 3 additions & 3 deletions oneanddone/tests/functional/pages/tasks/available_tasks.py
Expand Up @@ -18,12 +18,12 @@ class AvailableTasksPage(Base):
@property
def available_tasks(self):
return [Task(self, web_element) for web_element in
self.find_elements(self._available_tasks_list_locator)]
self.find_elements(*self._available_tasks_list_locator)]

@property
def displayed_profile_name(self):
return self.find_element(self._displayed_profile_name_locator).text
return self.find_element(*self._displayed_profile_name_locator).text

@property
def is_available_tasks_list_visible(self):
return self.is_element_displayed(self._available_tasks_list_locator)
return self.is_element_displayed(*self._available_tasks_list_locator)
6 changes: 3 additions & 3 deletions oneanddone/tests/functional/pages/tasks/regions/task.py
Expand Up @@ -14,8 +14,8 @@ class Task(Region):

@property
def name(self):
return self.find_element(self._name_locator).text
return self.find_element(*self._name_locator).text

def click(self):
self.find_element(self._name_locator).click()
return TaskDetailsPage(self.selenium, self.base_url).wait_for_page_to_load()
self.find_element(*self._name_locator).click()
return TaskDetailsPage(self.selenium, self.page.base_url).wait_for_page_to_load()
22 changes: 11 additions & 11 deletions oneanddone/tests/functional/pages/tasks/task_details.py
Expand Up @@ -19,46 +19,46 @@ class TaskDetailsPage(Base):
_save_for_later_button_locator = (By.ID, 'save-for-later')

def click_abandon_task_button(self):
self.find_element(self._abandon_task_button_locator).click()
self.find_element(*self._abandon_task_button_locator).click()
return TaskFeedbackPage(self.selenium, self.base_url).wait_for_page_to_load()

def click_complete_task_button(self):
self.find_element(self._complete_task_button_locator).click()
self.find_element(*self._complete_task_button_locator).click()
return TaskFeedbackPage(self.selenium, self.base_url).wait_for_page_to_load()

def click_get_started_button(self):
self.find_element(self._get_started_button_locator).click()
self.find_element(*self._get_started_button_locator).click()

def click_save_for_later_button(self):
self.find_element(self._save_for_later_button_locator).click()
self.find_element(*self._save_for_later_button_locator).click()
from pages.home import HomePage
return HomePage(self.selenium, self.base_url).wait_for_page_to_load()

def click_team(self):
self.find_element(self._team_link_locator).click()
self.find_element(*self._team_link_locator).click()
from pages.tasks.team_details import TeamDetailsPage
return TeamDetailsPage(self.selenium, self.base_url).wait_for_page_to_load()

@property
def is_abandon_task_button_visible(self):
return self.is_element_displayed(self._abandon_task_button_locator)
return self.is_element_displayed(*self._abandon_task_button_locator)

@property
def is_complete_task_button_visible(self):
return self.is_element_displayed(self._complete_task_button_locator)
return self.is_element_displayed(*self._complete_task_button_locator)

@property
def is_get_started_button_visible(self):
return self.is_element_displayed(self._get_started_button_locator)
return self.is_element_displayed(*self._get_started_button_locator)

@property
def is_save_for_later_button_visible(self):
return self.is_element_displayed(self._save_for_later_button_locator)
return self.is_element_displayed(*self._save_for_later_button_locator)

@property
def name(self):
return self.find_element(self._name_locator).text
return self.find_element(*self._name_locator).text

@property
def team(self):
return self.find_element(self._team_link_locator).text
return self.find_element(*self._team_link_locator).text
4 changes: 2 additions & 2 deletions oneanddone/tests/functional/pages/tasks/task_feedback.py
Expand Up @@ -15,8 +15,8 @@ class TaskFeedbackPage(Base):

@property
def name(self):
return self.find_element(self._name_locator).text
return self.find_element(*self._name_locator).text

def click_no_thanks_button(self):
self.find_element(self._no_thanks_button_locator).click()
self.find_element(*self._no_thanks_button_locator).click()
return WhatsNextPage(self.selenium, self.base_url).wait_for_page_to_load()
6 changes: 3 additions & 3 deletions oneanddone/tests/functional/pages/tasks/team_details.py
Expand Up @@ -17,13 +17,13 @@ class TeamDetailsPage(Base):

@property
def page_heading(self):
return self.find_element(self._page_heading).text
return self.find_element(*self._page_heading).text

@property
def task_list_header(self):
return self.find_element(self._task_list_header_locator).text
return self.find_element(*self._task_list_header_locator).text

@property
def available_tasks(self):
return [Task(self, web_element)
for web_element in self.find_elements(self._available_task_list_locator)]
for web_element in self.find_elements(*self._available_task_list_locator)]
4 changes: 2 additions & 2 deletions oneanddone/tests/functional/pages/user/user_profile_delete.py
Expand Up @@ -14,9 +14,9 @@ class UserProfileDeletePage(Base):
_confirm_button_locator = (By.ID, 'confirm-button')

def click_cancel_button(self):
self.find_element(self._cancel_button_locator).click()
self.find_element(*self._cancel_button_locator).click()
return HomePage(self.selenium, self.base_url).wait_for_page_to_load()

def click_confirm_button(self):
self.find_element(self._confirm_button_locator).click()
self.find_element(*self._confirm_button_locator).click()
return HomePage(self.selenium, self.base_url).wait_for_page_to_load()
12 changes: 6 additions & 6 deletions oneanddone/tests/functional/pages/user/user_profile_details.py
Expand Up @@ -22,25 +22,25 @@ class UserProfileDetailsPage(Base):

@property
def bugzilla_email(self):
return self.find_element(self._bugzilla_email_locator).text
return self.find_element(*self._bugzilla_email_locator).text

@property
def completed_tasks_count(self):
return int(self.find_element(self._tasks_completed_locator).text)
return int(self.find_element(*self._tasks_completed_locator).text)

@property
def completed_tasks(self):
return [Task(self, web_element) for web_element in
self.find_elements(self._completed_tasks_list_locator)]
self.find_elements(*self._completed_tasks_list_locator)]

@property
def user_profile_name(self):
return self.find_element(self._user_profile_name_locator).text
return self.find_element(*self._user_profile_name_locator).text

@property
def user_profile_url(self):
return self.find_element(self._user_profile_url_locator).text
return self.find_element(*self._user_profile_url_locator).text

def click_edit_profile_button(self):
self.find_element(self._edit_profile_button_locator).click()
self.find_element(*self._edit_profile_button_locator).click()
return UserProfileEditPage(self.selenium, self.base_url).wait_for_page_to_load()
16 changes: 8 additions & 8 deletions oneanddone/tests/functional/pages/user/user_profile_edit.py
Expand Up @@ -21,48 +21,48 @@ class UserProfileEditPage(Base):
@property
def bugzilla_email(self):
return self.find_element(
self._bugzilla_email_input_locator).get_attribute('value')
*self._bugzilla_email_input_locator).get_attribute('value')

@bugzilla_email.setter
def bugzilla_email(self, value):
self.set_field(self._bugzilla_email_input_locator, value)

@property
def display_name(self):
return self.find_element(self._name_input_locator).get_attribute('value')
return self.find_element(*self._name_input_locator).get_attribute('value')

@display_name.setter
def display_name(self, fullname):
self.set_field(self._name_input_locator, fullname)

@property
def is_privacy_policy_checkbox_checked(self):
return self.find_element(self._privacy_policy_checkbox_locator).is_selected()
return self.find_element(*self._privacy_policy_checkbox_locator).is_selected()

@property
def user_profile_url(self):
return self.find_element(
self._user_profile_url_input_locator).get_attribute('value')
*self._user_profile_url_input_locator).get_attribute('value')

@user_profile_url.setter
def user_profile_url(self, url):
self.set_field(self._user_profile_url_input_locator, url)

@property
def username(self):
return self.find_element(self._username_input_locator).get_attribute('value')
return self.find_element(*self._username_input_locator).get_attribute('value')

@username.setter
def username(self, username):
self.set_field(self._username_input_locator, username)

def click_delete_profile_button(self):
self.find_element(self._delete_profile_button_locator).click()
self.find_element(*self._delete_profile_button_locator).click()
return UserProfileDeletePage(self.selenium, self.base_url).wait_for_page_to_load()

def click_save_button(self, expectation):
self.find_element(self._save_button_locator).click()
self.find_element(*self._save_button_locator).click()
return self.expected_page(expectation)

def toggle_privacy_policy_checkbox(self):
self.find_element(self._privacy_policy_checkbox_locator).click()
self.find_element(*self._privacy_policy_checkbox_locator).click()

0 comments on commit f35dff9

Please sign in to comment.