예제 #1
0
    def test_A_000023(self):
        """
        Confirm workspace maximum count limits are enforced
        """
        def oracle():
            """ Checks that Ok button of warning window is displayed """
            # self.assertTrue(FilterModal.ok.is_visible(self.driver))
            self.assertTrue(Filter.ok_is_visible(self.driver))

        Search.search_location(self.driver, "Dubai International Airport")
        Search.search(self.driver)
        Filter.open(self.driver)
        Filter.complex_selection_to_workspace(self.driver)
        Filter.close(self.driver)
        Search.search_location(self.driver, "Abu Dhabi")
        Search.search(self.driver)
        Filter.open(self.driver)
        Filter.complex_selection_to_workspace(self.driver,
                                              double=True,
                                              to_workspace=False)
        oracle()
예제 #2
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)