Exemplo n.º 1
0
    def test_dispatch_click_task_with_id(self) -> None:
        uri = self.report_link_uri
        sites_task_report = SailUiForm(self.task_set.appian.interactor,
                                       json.loads(self.sites_task_report_resp),
                                       uri)
        initial_uuid = sites_task_report.uuid
        initial_context = sites_task_report.context
        task_to_accept = read_mock_file('task_accept_resp.json')
        self.custom_locust.set_response(
            "/suite/rest/a/task/latest/Bs3k2OfS55jCOcMb5D/status",
            200,
            task_to_accept
        )
        self.custom_locust.set_response(
            "/suite/rest/a/task/latest/Bs3k2OfS55jCOcMb5D/attributes",
            200,
            """{
            "isOfflineTask": false,
            "isSailTask": true,
            "isQuickTask": false,
            "taskId": "Bs3k2OfS55jCOcMb5D",
            "isAutoAcceptable": "true"
            }""")
        sites_task_report.click('Issue recommendation')

        task_to_accept_state = json.loads(task_to_accept)

        self.assertNotEqual(initial_uuid, sites_task_report.uuid)
        self.assertNotEqual(initial_context, sites_task_report.context)
        self.assertEqual(task_to_accept_state['uuid'], sites_task_report.uuid)
        self.assertEqual(task_to_accept_state['context'], sites_task_report.context)

        # Assert ui state updated
        self.assertEqual('Available Case Workers',
                         find_component_by_attribute_in_dict('label', 'Available Case Workers', sites_task_report.state).get('label')
                         )
Exemplo n.º 2
0
 def nav_to_site_designer(self):
     uri = "/suite/rest/a/applications/latest/app/design/koBHer_bdD8Emw8hLHIVbTE4VVYhe67L0vlHTpP4tgRJpQLzriXFo6NxZ2dZZJAhDGELUiEJfv4fTh6Y4tJc1q2NxztJuzv-XyAYA"
     # uri = "/suite/rest/a/applications/latest/app/design/koBRiBJbvt7QuRiqjQRMM3to01_ihyZOZXelvq2wVBYCVYJjp5azZLattqab0AluZv9C7OaLSY2kBts5BU09-bwMfqciz39GHYWTw"
     headers = self.appian.interactor.setup_sail_headers()
     headers['X-Client-Mode'] = 'DESIGN'
     resp = self.appian.interactor.get_page(uri,
                                            label="LoadSiteDesignerPage",
                                            headers=headers)
     # print(resp)
     # print(resp.text)
     form = SailUiForm(self.appian.interactor,
                       resp.json(),
                       uri,
                       breadcrumb='SitesDesigner')
     form = form.click('Add Page').select_dropdown_item(
         'Type', 'Record List')
     for extr in helper.extract_values(form.state, 'label', 'Content'):
         print('Choices after selecting record list ' +
               str(len(extr['choices'])))
     form = form.select_dropdown_item('Type', 'Report')
     for extr in helper.extract_values(form.state, 'label', 'Content'):
         print('Choices after selecting report ' +
               str(len(extr['choices'])))