Пример #1
0
    def test_make_form(self):
        print "Testing form creation"
        page = LoginPage(self.driver, self.live_server_url)
        page.login('admin', 'admin')
        #Create a new branch model
        graph_page = GraphPage(self.driver, self.live_server_url)
        graph_id = graph_page.add_new_graph()
        #Add a node to it of type geojson
        branch_node_page = NodePage(self.driver, self.live_server_url,
                                    graph_id)
        node_ids = branch_node_page.add_new_node(
            '22000000-0000-0000-0000-000000000000',
            'geojson-feature-collection')
        #Create a resource model
        resource_graph_page = GraphPage(self.driver, self.live_server_url)
        resource_graph_id = resource_graph_page.add_new_graph(
            "New Resource Model")
        #Add a the branch model created above to the
        resource_node_page = NodePage(self.driver, self.live_server_url,
                                      resource_graph_id)
        resource_node_page.add_new_node(graph_id, '', True)
        #Navigate to the card manager and click on the correspoding card for the node created above
        form_page = FormPage(self.driver, self.live_server_url, graph_id)
        form_id = form_page.add_new_form()
        form_id_is_valid = True
        try:
            uuid.UUID(form_id)
        except:
            form_id_is_valid = False
        form_page.configure_form("FormA")

        self.assertTrue(form_id_is_valid)
Пример #2
0
    def test_make_map_widget(self):
        print "Testing creation and function of the map widget in a card"
        page = LoginPage(self.driver, self.live_server_url)
        page.login('admin', 'admin')
        #Create a new branch model
        graph_page = GraphPage(self.driver, self.live_server_url)
        graph_id = graph_page.add_new_graph()
        #Add a node to it of type geojson
        branch_node_page = NodePage(self.driver, self.live_server_url, graph_id)
        node_ids = branch_node_page.add_new_node('22000000-0000-0000-0000-000000000000', 'geojson-feature-collection')
        #Create a resource model
        resource_graph_page = GraphPage(self.driver, self.live_server_url)
        resource_graph_id = resource_graph_page.add_new_graph("New Resource Model")
        #Add a the branch model created above to the
        resource_node_page = NodePage(self.driver, self.live_server_url, resource_graph_id)
        resource_node_page.add_new_node(graph_id, '', True)
        #Navigate to the card manager and click on the correspoding card for the node created above
        card_page = CardPage(self.driver, self.live_server_url, graph_id)
        card_id = card_page.select_card(node_ids)

        card_designer_page = CardDesignerPage(self.driver, self.live_server_url, card_id)
        map_widget = card_designer_page.add_widget(MapWidget)

        results = {}
        card_designer_page.open()
        results['opened maptools'] = map_widget.open_tools()
        results['added basemap'] = map_widget.add_basemap()
        results['added overlay'] = map_widget.add_overlay(1)
        map_tools_working = True
        for k, v in results.iteritems():
            if v != True:
                map_tools_working = False
        print 'map tools results', results

        self.assertTrue(map_tools_working)
Пример #3
0
    def test_add_resource(self):
        print "Testing resource instance creation and crud"
        page = LoginPage(self.driver, self.live_server_url)
        page.login('admin', 'admin')
        #Create a new branch model
        graph_page = GraphPage(self.driver, self.live_server_url)
        graph_id = graph_page.add_new_graph()
        #Add a node to it of type geojson
        branch_node_page = NodePage(self.driver, self.live_server_url,
                                    graph_id)
        node_ids = branch_node_page.add_new_node(
            '22000000-0000-0000-0000-000000000000',
            'geojson-feature-collection')
        #Create a resource model
        resource_graph_page = GraphPage(self.driver, self.live_server_url)
        resource_graph_id = resource_graph_page.add_new_graph(
            "New Resource Model")
        #Add a the branch model created above to the
        resource_node_page = NodePage(self.driver, self.live_server_url,
                                      resource_graph_id)
        resource_node_page.add_new_node(graph_id, '', True)
        #Navigate to the report manager and click on the correspoding card for the node created above
        form_page = FormPage(self.driver, self.live_server_url,
                             resource_graph_id)
        form_id = form_page.add_new_form()
        form_page.configure_form("FormB")

        report_manager_page = ReportManagerPage(self.driver,
                                                self.live_server_url,
                                                resource_graph_id)
        report_id = report_manager_page.add_new_report()
        #Navigate to the report editor page click around to verify things are working, activate and save the report
        report_editor_page = ReportEditorPage(self.driver,
                                              self.live_server_url, report_id)
        report_editor_page.open()
        map_widget = report_editor_page.add_widget(MapWidget)
        map_widget.open_tools()
        map_widget.add_overlay(2)
        report_editor_page.save_report("ReportB")

        resource_manager_page = ResourceManagerPage(self.driver,
                                                    self.live_server_url,
                                                    resource_graph_id)
        resource_instance_id = resource_manager_page.add_new_resource()

        resource_editor_page = ResourceEditorPage(self.driver,
                                                  self.live_server_url,
                                                  resource_instance_id)
        map_widget = resource_editor_page.add_widget(MapWidget)
        map_widget.draw_point()
        result = resource_editor_page.save_edits()
        self.assertTrue(result == ['Save'])
Пример #4
0
    def test_make_report(self):
        print "Testing report creation"
        page = LoginPage(self.driver, self.live_server_url)
        page.login('admin', 'admin')
        #Create a new branch model
        graph_page = GraphPage(self.driver, self.live_server_url)
        graph_id = graph_page.add_new_graph()
        #Add a node to it of type geojson
        branch_node_page = NodePage(self.driver, self.live_server_url,
                                    graph_id)
        node_ids = branch_node_page.add_new_node(
            '22000000-0000-0000-0000-000000000000',
            'geojson-feature-collection')
        #Create a resource model
        resource_graph_page = GraphPage(self.driver, self.live_server_url)
        resource_graph_id = resource_graph_page.add_new_graph(
            "New Resource Model")
        #Add a the branch model created above to the
        resource_node_page = NodePage(self.driver, self.live_server_url,
                                      resource_graph_id)
        resource_node_page.add_new_node(graph_id, '', True)
        #Navigate to the report manager and click on the correspoding card for the node created above
        report_manager_page = ReportManagerPage(self.driver,
                                                self.live_server_url, graph_id)
        report_id = report_manager_page.add_new_report()
        report_id_is_valid = True

        try:
            uuid.UUID(report_id)
        except:
            report_id_is_valid = False

        #Navigate to the report editor page click around to verify things are working, activate and save the report
        report_editor_page = ReportEditorPage(self.driver,
                                              self.live_server_url, report_id)
        report_editor_page.open()

        results = {}
        map_widget = report_editor_page.add_widget(MapWidget)
        results['opened maptools'] = map_widget.open_tools()
        results['added basemap'] = map_widget.add_basemap()
        results['added overlay'] = map_widget.add_overlay(2)
        report_editor_page.save_report("ReportA")

        print results
        self.assertTrue(results['opened maptools'] == True
                        and results['added basemap'] == True
                        and results['added overlay'] == True)
Пример #5
0
    def test_make_graph(self):
        print "Testing graph creation"
        page = LoginPage(self.driver, self.live_server_url)
        page.login('admin', 'admin')

        page = GraphPage(self.driver, self.live_server_url)
        graph_id = page.add_new_graph()

        self.assertEqual(self.driver.current_url, '%s/graph/%s/settings' % (self.live_server_url, graph_id))
Пример #6
0
 def test_make_node(self):
     print "Testing node creation and appendment to a graph"
     page = LoginPage(self.driver, self.live_server_url)
     page.login('admin', 'admin')
     graph_page = GraphPage(self.driver, self.live_server_url)
     graph_id = graph_page.add_new_graph()
     page = NodePage(self.driver, self.live_server_url, graph_id)
     node_ids = page.add_new_node('22000000-0000-0000-0000-000000000000', 'geojson-feature-collection')
     try:
         uuid.UUID(node_ids['node_id'])
         uuid.UUID(node_ids['nodegroup_id'])
         node_ids_are_valid = True
     except:
         node_id_is_valid = False
     self.assertTrue(node_ids_are_valid)