Пример #1
0
 def _buy_offering(self):
     bought_response_text = read_response_file('responses', 'store2', 'service2_bought.json')
     self.network._servers['http']['store2.example.com'].add_response('GET', '/mystore/api/offering/offerings/service2.rdf', {'content': bought_response_text})
     dialog = FormModalTester(self, self.wait_element_visible(".wc-buy-modal"))
     dialog.accept()
     WebDriverWait(self.driver, 10).until(EC.staleness_of(dialog.element))
     self.wait_wirecloud_ready()
Пример #2
0
 def _buy_offering(self):
     bought_response_text = read_response_file('responses', 'store2',
                                               'service2_bought.json')
     self.network._servers['http']['store2.example.com'].add_response(
         'GET', '/mystore/api/offering/offerings/service2.rdf',
         {'content': bought_response_text})
     dialog = FormModalTester(self,
                              self.wait_element_visible(".wc-buy-modal"))
     dialog.accept().wait_close(timeout=10)
     self.wait_wirecloud_ready()
Пример #3
0
 def _buy_offering(self):
     bought_response_text = read_response_file('responses', 'store2',
                                               'service2_bought.json')
     self.network._servers['http']['store2.example.com'].add_response(
         'GET', '/mystore/api/offering/offerings/service2.rdf',
         {'content': bought_response_text})
     dialog = FormModalTester(self,
                              self.wait_element_visible(".wc-buy-modal"))
     dialog.accept()
     WebDriverWait(self.driver, 10).until(EC.staleness_of(dialog.element))
     self.wait_wirecloud_ready()
Пример #4
0
    def test_ngsi_api_reports_failures(self):
        self.login()

        widget = self.add_widget_to_mashup('Wirecloud NGSI API test widget')

        # Change widget settings
        widget.open_menu().click_entry('Settings')
        dialog = FormModalTester(self, self.wait_element_visible_by_css_selector(".wc-component-preferences-dialog"))
        dialog.get_field("ngsi_server").set_value('http://orion.example.com:1026')
        dialog.get_field("use_user_fiware_token").click()
        dialog.accept()

        # Check the widget raises an error
        with widget:
            WebDriverWait(self.driver, 2).until(lambda driver: driver.find_element_by_id('api_available').text == 'Yes')
            self.driver.find_element_by_css_selector('.btn-primary').click()
            alert = self.wait_element_visible_by_css_selector('.alert-error p')
            self.assertEqual(alert.text, 'Unexpected error code: 404')
Пример #5
0
    def test_ngsi_api_reports_failures(self):

        self.login(username="******", next="/admin/Workspace")

        widget = self.create_widget('Wirecloud NGSI API test widget')

        # Change widget settings
        widget.open_menu().click_entry('Settings')
        dialog = FormModalTester(
            self, self.wait_element_visible(".wc-component-preferences-modal"))
        dialog.get_field("ngsi_server").set_value(
            'http://orion.example.com:1026')
        dialog.get_field("use_user_fiware_token").click()
        dialog.accept()

        # Check the widget raises an error
        with widget:
            WebDriverWait(self.driver,
                          2).until(lambda driver: driver.find_element_by_id(
                              'api_available').text == 'Yes')
            self.driver.find_element_by_css_selector('.btn-primary').click()
            alert = self.wait_element_visible('.alert-error p')
            self.assertEqual(alert.text, 'Unexpected error code: 404')
Пример #6
0
    def test_store_upload_resource(self):

        self.network._servers['http']['store.example.com'].add_response(
            'POST', '/api/offering/resources', {'content': ''})

        self.login(username='******')

        with self.myresources_view as myresources:
            with myresources.search_in_results('Test') as resource:

                resource.advanced_operation('Publish')

                dialog = FormModalTester(
                    self, self.wait_element_visible(".publish_resource"))
                dialog.find_element(
                    '[value="user_with_markets/fiware"]').click()
                dialog.accept().wait_close()