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

Test #3

Closed
wants to merge 19 commits into from
553 changes: 279 additions & 274 deletions vms/administrator/tests/test_formFields.py

Large diffs are not rendered by default.

656 changes: 341 additions & 315 deletions vms/administrator/tests/test_report.py

Large diffs are not rendered by default.

43 changes: 0 additions & 43 deletions vms/administrator/tests/test_selenium_working.py

This file was deleted.

4 changes: 0 additions & 4 deletions vms/administrator/tests/test_services.py

This file was deleted.

637 changes: 230 additions & 407 deletions vms/administrator/tests/test_settings.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions vms/event/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# Django
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.core.urlresolvers import reverse_lazy
from django.http import HttpResponseRedirect
Expand Down
2 changes: 1 addition & 1 deletion vms/pom/locators/administratorReportPageLocators.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class AdministratorReportPageLocators(object):
FIRST_NAME_SELECTOR = '//input[@name = "first_name"]'
LAST_NAME_SELECTOR = '//input[@name = "last_name"]'

NAME = '//table//tbody//tr[1]//td[1]'
NAME = '//table//tbody//tr[1]//td[4]'
DATE = '//table//tbody//tr[1]//td[6]'
START_TIME = '//table//tbody//tr[1]//td[7]'
END_TIME = '//table//tbody//tr[1]//td[8]'
Expand Down
19 changes: 7 additions & 12 deletions vms/pom/pages/administratorReportPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ def __init__(self, driver):
super(AdministratorReportPage, self).__init__(driver)

def go_to_admin_report(self):
self.home_page.get_admin_report_link().send_keys("\n")
self.home_page.get_admin_report_link().click()

def fill_report_form(self, info):
first_name = self.element_by_xpath(self.elements.FIRST_NAME_SELECTOR)
last_name = self.element_by_xpath(self.elements.LAST_NAME_SELECTOR)

first_name.clear()
last_name.clear()
[select1, select2,
select3] = self.get_event_job_organization_selectors()
[select1, select2, select3] = self.get_event_job_organization_selectors()

first_name.send_keys(info[0])
last_name.send_keys(info[1])
Expand All @@ -38,13 +37,10 @@ def fill_report_form(self, info):
self.submit_form()

def get_event_job_organization_selectors(self):
select1 = Select(
self.element_by_xpath(self.elements.REPORT_EVENT_SELECTOR))
select2 = Select(
self.element_by_xpath(self.elements.REPORT_JOB_SELECTOR))
select3 = Select(
self.element_by_xpath(self.elements.REPORT_ORG_SELECTOR))
return (select1, select2, select3)
select1 = Select(self.element_by_xpath(self.elements.REPORT_EVENT_SELECTOR))
select2 = Select(self.element_by_xpath(self.elements.REPORT_JOB_SELECTOR))
select3 = Select(self.element_by_xpath(self.elements.REPORT_ORG_SELECTOR))
return select1, select2, select3

def submit_form(self):
self.element_by_xpath(self.elements.SUBMIT_PATH).submit()
Expand All @@ -53,5 +49,4 @@ def get_alert_box_text(self):
return self.element_by_class_name(self.elements.NO_RESULT_BOX).text

def get_shift_summary(self):
return self.element_by_xpath(
self.elements.REPORT_SHIFT_SUMMARY_PATH).text
return self.element_by_xpath(self.elements.REPORT_SHIFT_SUMMARY_PATH).text
5 changes: 5 additions & 0 deletions vms/pom/pages/basePage.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ def get_value_for_xpath(self, xpath):

def element_by_tag_name(self, tag):
return self.driver.find_element_by_tag_name(tag)

@staticmethod
def remove_i18n(string):
slashes = [pos for pos, char in enumerate(string) if char == '/']
return string[:slashes[2]] + string[slashes[3]:]
9 changes: 4 additions & 5 deletions vms/pom/pages/eventsPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# local Django
from basePage import BasePage
from pom.locators.eventsPageLocators import EventsPageLocators
from pom.locators.eventsPageLocators import EventsPageLocators
from pom.pages.homePage import HomePage
from pom.pageUrls import PageUrls

Expand Down Expand Up @@ -74,7 +74,7 @@ def submit_form(self):
self.element_by_xpath(self.elements.GENERAL_SUBMIT_PATH).submit()

def go_to_events_page(self):
self.home_page.get_events_link().send_keys('\n')
self.home_page.get_events_link().click()

def navigate_to_event_list_view(self):
self.get_page(self.live_server_url, self.event_list_page)
Expand All @@ -96,7 +96,7 @@ def go_to_edit_event_page(self):
self.element_by_xpath(self.elements.EDIT_EVENT).click()

def go_to_create_job_page(self):
self.get_page(self.live_server_url, self.create_job_page)
self.click_link('Create Job')

def go_to_edit_job_page(self):
self.element_by_xpath(self.elements.EDIT_JOB).click()
Expand Down Expand Up @@ -230,5 +230,4 @@ def get_shift_end_time_value(self):
return self.get_value_for_xpath(self.elements.CREATE_SHIFT_END_TIME)

def get_shift_max_volunteers(self):
return self.get_value_for_xpath(
self.elements.CREATE_SHIFT_MAX_VOLUNTEER)
return self.get_value_for_xpath(self.elements.CREATE_SHIFT_MAX_VOLUNTEER)
Loading