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

Add wait for "No matching records" message #65

Merged
merged 4 commits into from
Feb 1, 2018
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
2 changes: 1 addition & 1 deletion cadasta/test/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.2.10.1'
__version__ = '0.3.0.0'
12 changes: 6 additions & 6 deletions cadasta/test/record_tests/test_party_browsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ def test_search_for_an_existing_party_works(
self.wd.BY_XPATH(
'//*[@id="sidebar"]//a[normalize-space()="Parties"]').click()
search_input = self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0_filter"]//input[@type="search"]')
'//*[@id="paginated-table-filter"]//input[@type="search"]')
name = basic_individual['name']
search_input.send_keys(name)
self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0"]//td[contains(.,"{}")]'.format(name))
'//*[@id="paginated-table"]//td[contains(.,"{}")]'.format(name))
self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0"]//td[contains(.,"Individual")]')
'//*[@id="paginated-table"]//td[contains(.,"Individual")]')

def test_search_that_results_in_no_party_works(
self, records_org_prj, prj_user
Expand All @@ -44,8 +44,8 @@ def test_search_that_results_in_no_party_works(
self.wd.BY_XPATH(
'//*[@id="sidebar"]//a[normalize-space()="Parties"]').click()
search_input = self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0_filter"]//input[@type="search"]')
'//*[@id="paginated-table-filter"]//input[@type="search"]')
search_input.send_keys(random_string())
self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0"]'
self.wd.wait_for_xpath(
'//*[@id="paginated-table"]'
'//*[normalize-space()="No matching records found"]')
38 changes: 19 additions & 19 deletions cadasta/test/record_tests/test_party_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ def test_user_can_create_delete_party(self, basic_org_prj, data_collector):
expected_path = self.prj_dashboard_path + 'records/parties/'
assert self.get_url_path() == expected_path
search_input = self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0_filter"]//input[@type="search"]')
'//*[@id="paginated-table-filter"]//input[@type="search"]')
search_input.send_keys(name)
self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0"]//td[contains(.,"{}")]'.format(name))
self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0"]//td[contains(.,"Individual")]')
self.wd.wait_for_xpath(
'//*[@id="paginated-table"]//td[contains(.,"{}")]'.format(name))
self.wd.wait_for_xpath(
'//*[@id="paginated-table"]//td[contains(.,"Individual")]')
self.wd.BY_LINK(name).click()
self.wd.BY_XPATH('//h2[contains(.,"{}")]'.format(name))
self.wd.BY_XPATH('//td[contains(.,"{}")]'.format(name))
Expand All @@ -76,10 +76,10 @@ def test_user_can_create_delete_party(self, basic_org_prj, data_collector):
'//button[contains(., "Yes, delete this party")]').click()
assert self.get_url_path() == expected_path
search_input = self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0_filter"]//input[@type="search"]')
'//*[@id="paginated-table-filter"]//input[@type="search"]')
search_input.send_keys(name)
self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0"]'
'//*[@id="paginated-table"]'
'//*[normalize-space()="No matching records found" or'
' normalize-space()="No data available in table"]')

Expand All @@ -100,12 +100,12 @@ def test_user_can_create_update_party_with_custom_attributes(
expected_path = self.prj_dashboard_path + 'records/parties/'
assert self.get_url_path() == expected_path
search_input = self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0_filter"]//input[@type="search"]')
'//*[@id="paginated-table-filter"]//input[@type="search"]')
search_input.send_keys(name)
self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0"]//td[contains(.,"{}")]'.format(name))
'//*[@id="paginated-table"]//td[contains(.,"{}")]'.format(name))
self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0"]//td[contains(.,"Individual")]')
'//*[@id="paginated-table"]//td[contains(.,"Individual")]')
self.wd.BY_LINK(name).click()
self.wd.BY_XPATH('//h2[contains(.,"{}")]'.format(name))
self.wd.BY_XPATH('//td[contains(.,"{}")]'.format(name))
Expand Down Expand Up @@ -148,12 +148,12 @@ def test_user_can_create_update_individual_with_conditional_attributes(
expected_path = self.prj_dashboard_path + 'records/parties/'
assert self.get_url_path() == expected_path
search_input = self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0_filter"]//input[@type="search"]')
'//*[@id="paginated-table-filter"]//input[@type="search"]')
search_input.send_keys(name)
self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0"]//td[contains(.,"{}")]'.format(name))
'//*[@id="paginated-table"]//td[contains(.,"{}")]'.format(name))
self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0"]//td[contains(.,"Individual")]')
'//*[@id="paginated-table"]//td[contains(.,"Individual")]')
self.wd.BY_LINK(name).click()
self.wd.BY_XPATH('//h2[contains(.,"{}")]'.format(name))
self.wd.BY_XPATH('//td[contains(.,"{}")]'.format(name))
Expand Down Expand Up @@ -199,12 +199,12 @@ def test_user_can_create_corporation_with_conditional_attributes(
expected_path = self.prj_dashboard_path + 'records/parties/'
assert self.get_url_path() == expected_path
search_input = self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0_filter"]//input[@type="search"]')
'//*[@id="paginated-table-filter"]//input[@type="search"]')
search_input.send_keys(name)
self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0"]//td[contains(.,"{}")]'.format(name))
'//*[@id="paginated-table"]//td[contains(.,"{}")]'.format(name))
self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0"]//td[contains(.,"Corporation")]')
'//*[@id="paginated-table"]//td[contains(.,"Corporation")]')
self.wd.BY_LINK(name).click()
self.wd.BY_XPATH('//h2[contains(.,"{}")]'.format(name))
self.wd.BY_XPATH('//td[contains(.,"{}")]'.format(name))
Expand Down Expand Up @@ -235,12 +235,12 @@ def test_user_can_create_group_with_conditional_attributes(
expected_path = self.prj_dashboard_path + 'records/parties/'
assert self.get_url_path() == expected_path
search_input = self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0_filter"]//input[@type="search"]')
'//*[@id="paginated-table-filter"]//input[@type="search"]')
search_input.send_keys(name)
self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0"]//td[contains(.,"{}")]'.format(name))
'//*[@id="paginated-table"]//td[contains(.,"{}")]'.format(name))
self.wd.BY_XPATH(
'//*[@id="DataTables_Table_0"]//td[contains(.,"Group")]')
'//*[@id="paginated-table"]//td[contains(.,"Group")]')
self.wd.BY_LINK(name).click()
self.wd.BY_XPATH('//h2[contains(.,"{}")]'.format(name))
self.wd.BY_XPATH('//td[contains(.,"{}")]'.format(name))
Expand Down