Esempio n. 1
0
 def oracle_results_count(expected_results, should_match):
     if should_match:
         self.assertEqual(Search.count_results(self.driver),
                          expected_results)
     else:
         self.assertNotEqual(Search.count_results(self.driver),
                             expected_results)
Esempio n. 2
0
    def test_A_000015(self):
        """ Confirms no date filters returns the same number of results as
        applying a date filter from 01/01/0100 to 01/01/9000 """
        def oracle(init_count, final_count):
            self.assertEqual(init_count, final_count)

        Search.search_location(self.driver, 'United States')
        Search.search(self.driver)
        Search.filter_dates(self.driver, '01/01/0100', '01/01/9000')
        init_count = Search.count_results(self.driver)
        Search.clear_date_filter(self.driver)
        Search.search(self.driver)
        final_count = Search.count_results(self.driver)
        oracle(init_count, final_count)
Esempio n. 3
0
    def test_A_000019(self):
        """ Confirm empty operations on the filter modals don't affect the
        results set or the persistance of the searchbox entry """
        def oracle_search_text_is_same(text):
            """ Check if the text is the same in the search field """
            self.assertEqual(Search.get_searchbox_text(self.driver), text)

        def oracle_result(init_result):
            """ Compare search results count to the initial level """
            self.assertEqual(init_result, Search.count_results(self.driver))

        location = "NUIO üł. 54343nt, 342sf 234sdf, 12..."  # deliberately random
        Search.search_location(self.driver, location)
        Search.search(self.driver)
        init_result_count = Search.count_results(self.driver)
        Services.filters(self.driver)  # apply no services filters
        Keywords.empty_keywords(self.driver)  # no keyword filters
        Advanced.empty_advanced(self.driver)  # no advanced filters
        Search.search(self.driver)
        oracle_result(init_result_count)
        oracle_search_text_is_same(location)
        Search.reset(self.driver)
        Search.search(self.driver)
        oracle_result(init_result_count)
        oracle_search_text_is_same(location)
Esempio n. 4
0
    def test_A_000010(self):
        """ Confirms that filtering by all keywords and all data types
        returns the same number of results as if no search parameters
        were applied.  This test is applied near both the Dallas Texas
        and Rio De Janeiro Brazil areas
        """
        def oracle():
            """ A search which filters for all keywords and all data types
            returns the same number of results as a search without any
            filters
            """
            for rio_count in rio_counts:
                self.assertEqual(rio_count, rio_counts[0])
            for dallas_count in dallas_counts:
                self.assertEqual(dallas_count, dallas_counts[0])

        driver = self.driver
        rio_counts = []
        dallas_counts = []
        Search.search_location(driver, 'Rio De Janeiro')
        Keywords.filter_root(driver, ['Biological', 'Chemical', 'Physical'])
        rio_counts.append(Search.count_results(driver))
        Advanced.filter_all_value_types(driver)
        rio_counts.append(Search.count_results(driver))
        Search.reset(driver)
        rio_counts.append(Search.count_results(driver))
        Search.search_location(driver, 'Dallas')
        Keywords.filter_root(driver, ['Biological', 'Chemical', 'Physical'])
        dallas_counts.append(Search.count_results(driver))
        Advanced.filter_all_value_types(driver)
        dallas_counts.append(Search.count_results(driver))
        Search.reset(driver)
        dallas_counts.append(Search.count_results(driver))
        oracle()
Esempio n. 5
0
 def oracle():
     """ 51 results are returned for a Lake Annie Florida data search,
     when the search is filtered to only include "Archbold Biological
     Center" service
     """
     self.assertIn('51', Search.count_results(self.driver))
Esempio n. 6
0
 def oracle():
     """ The results count over Cape Cod Bay (no land in view)
     is 0 after filtering for only NLDAS services
     """
     self.assertEqual(Search.count_results(self.driver), '0')
Esempio n. 7
0
 def oracle():
     """ Results count is nonzero after map navigations and a map
     location search (in that order)
     """
     self.assertNotEqual(Search.count_results(self.driver), '0')
Esempio n. 8
0
 def oracle_filters():
     """ Checks search results with applied filters is greater than 97 """
     self.assertGreater(Search.count_results(self.driver), 97)
Esempio n. 9
0
 def oracle_search():
     """ Checks search result is greater than 8000 """
     self.assertGreater(Search.count_results(self.driver), 8000)
Esempio n. 10
0
 def oracle():
     """ Checks that search result is greater than 0 """
     self.assertGreater(Search.count_results(self.driver), 0)
Esempio n. 11
0
 def oracle_result(init_result):
     """ Compare search results count to the initial level """
     self.assertEqual(init_result, Search.count_results(self.driver))
Esempio n. 12
0
 def oracle():
     """ Search result is greater than zero """
     self.assertGreater(Search.count_results(self.driver), 0)
Esempio n. 13
0
    def test_A_000017(self):
        """ Confirm Reset button clears Filter Results text and categorical
        filters """
        def oracle_results_count(expected_results, should_match):
            if should_match:
                self.assertEqual(Search.count_results(self.driver),
                                 expected_results)
            else:
                self.assertNotEqual(Search.count_results(self.driver),
                                    expected_results)

        def oracle_data_prop_selection(data_props, should_be_selected):
            """ Checks that filter options not selected """
            for data_prop in data_props:
                if should_be_selected:
                    self.assertTrue(
                        Filter.data_prop_is_selected(self.driver, data_prop))
                else:
                    self.assertFalse(
                        Filter.data_prop_is_selected(self.driver, data_prop))

        def oracle_data_service_selection(data_services, should_be_selected):
            """ Checks that filter options not selected """
            for data_service in data_services:
                if should_be_selected:
                    self.assertTrue(
                        Filter.data_service_is_selected(
                            self.driver, data_service))
                else:
                    self.assertFalse(
                        Filter.data_service_is_selected(
                            self.driver, data_service))

        data_props = ["Data Type", "Sample Medium"]
        data_services = ["Community Collaborative Rain, Hail and Snow Network"]
        Search.search_location(self.driver, "Montreal ")
        Search.search(self.driver)
        expected_results = Search.count_results(self.driver)
        Filter.open(self.driver)
        Filter.selection(self.driver)
        Filter.close(self.driver)
        TestSystem.wait(5)
        Search.reset(self.driver)
        Search.search(self.driver)
        oracle_results_count(expected_results, should_match=True)
        Filter.open(self.driver)
        Filter.find_in_table(self.driver, "DOLLARD")
        oracle_results_count(expected_results, should_match=False)
        Search.reset(self.driver)
        Search.search(self.driver)
        oracle_results_count(expected_results, should_match=True)
        Filter.open(self.driver)
        Filter.set_data_props(self.driver, data_props)
        Filter.open(self.driver)
        Filter.set_data_services(self.driver, data_services)
        oracle_results_count(expected_results, should_match=False)
        Filter.open(self.driver)
        oracle_data_prop_selection(data_props, should_be_selected=True)
        oracle_data_service_selection(data_services, should_be_selected=True)
        Filter.close(self.driver)
        Search.reset(self.driver)
        Search.search(self.driver)
        oracle_results_count(expected_results, should_match=True)
        Filter.open(self.driver)
        oracle_data_prop_selection(data_props, should_be_selected=False)
        oracle_data_service_selection(data_services, should_be_selected=False)