From 6114f8a07e577b97cefb43728713f0384794b4eb Mon Sep 17 00:00:00 2001 From: Valentin Zickner Date: Tue, 1 Oct 2024 12:04:52 +0200 Subject: [PATCH 1/2] rename module to rpaframework --- .github/workflows/main.yml | 8 +- .github/workflows/release.yml | 8 +- .github/workflows/test-release.yml | 8 +- README.md | 2 +- robocorp/README.md | 74 -- rpaframework/.gitignore | 1 + rpaframework/README.md | 54 ++ .../docs/robocorpExample.bpmn | 4 +- .../docs/robocorpExample.png | Bin .../flowable/.gitignore | 0 .../flowable/__init__.py | 0 .../flowable/rpaframework_client}/API.py | 1 - .../flowable/rpaframework_client}/__init__.py | 0 .../flowable/rpaframework_client}/__main__.py | 19 +- .../rpaframework_client/call_python_module.py | 4 +- .../rpaframework_handler.py | 26 +- {robocorp => rpaframework}/setup.py | 10 +- {robocorp => rpaframework}/tests/__init__.py | 0 .../tests/basic_test.py | 0 .../tests/bpmn_utils.py | 0 .../cassettes/test_with_custom_action.yml | 106 +-- .../fixtures/cassettes/test_with_robot.yml | 669 ++++++++++++++++++ .../fixtures/processes/robocorpExample.bpmn | 2 +- .../tests/robocorp_action_weather.py | 0 rpaframework/tests/rpaframework_weather.robot | 10 + .../tests/test_rpaframework_client.py | 33 +- {robocorp => rpaframework}/tests/vcr.py | 0 27 files changed, 857 insertions(+), 182 deletions(-) delete mode 100644 robocorp/README.md create mode 100644 rpaframework/.gitignore create mode 100644 rpaframework/README.md rename {robocorp => rpaframework}/docs/robocorpExample.bpmn (96%) rename {robocorp => rpaframework}/docs/robocorpExample.png (100%) rename {robocorp => rpaframework}/flowable/.gitignore (100%) rename {robocorp => rpaframework}/flowable/__init__.py (100%) rename {robocorp/flowable/robocorp_client => rpaframework/flowable/rpaframework_client}/API.py (92%) rename {robocorp/flowable/robocorp_client => rpaframework/flowable/rpaframework_client}/__init__.py (100%) rename {robocorp/flowable/robocorp_client => rpaframework/flowable/rpaframework_client}/__main__.py (62%) rename robocorp/flowable/robocorp_client/call_robocorp.py => rpaframework/flowable/rpaframework_client/call_python_module.py (70%) rename robocorp/flowable/robocorp_client/robocorp_handler.py => rpaframework/flowable/rpaframework_client/rpaframework_handler.py (86%) rename {robocorp => rpaframework}/setup.py (56%) rename {robocorp => rpaframework}/tests/__init__.py (100%) rename {robocorp => rpaframework}/tests/basic_test.py (100%) rename {robocorp => rpaframework}/tests/bpmn_utils.py (100%) rename {robocorp => rpaframework}/tests/fixtures/cassettes/test_with_custom_action.yml (76%) create mode 100644 rpaframework/tests/fixtures/cassettes/test_with_robot.yml rename {robocorp => rpaframework}/tests/fixtures/processes/robocorpExample.bpmn (97%) rename {robocorp => rpaframework}/tests/robocorp_action_weather.py (100%) create mode 100644 rpaframework/tests/rpaframework_weather.robot rename robocorp/tests/test_robocorp_client.py => rpaframework/tests/test_rpaframework_client.py (67%) rename {robocorp => rpaframework}/tests/vcr.py (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 98187ed..eeaa9f5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,7 @@ jobs: working-directory: ./external-worker/ - run: python -m unittest discover working-directory: ./external-worker/ - test-robocorp-client: + test-rpa-framework-client: runs-on: ubuntu-latest strategy: matrix: @@ -46,7 +46,7 @@ jobs: - run: python setup.py install working-directory: ./external-worker/ - run: pip install -e ".[testing]" - working-directory: ./robocorp/ - - run: cp -a external-worker/flowable/external_worker_client robocorp/flowable/ # we need to copy this module over, since it's only searching locally for modules + working-directory: ./rpaframework/ + - run: cp -a external-worker/flowable/external_worker_client rpaframework/flowable/ # we need to copy this module over, since it's only searching locally for modules - run: python -m unittest discover - working-directory: ./robocorp/ + working-directory: ./rpaframework/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b04614..461e873 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: packages-dir: external-worker/dist/ verbose: true - build-robocorp-client: + build-rpa-framework-client: runs-on: ubuntu-latest environment: release permissions: @@ -49,11 +49,11 @@ jobs: - run: source venv/bin/activate - run: pip install setuptools - run: python setup.py sdist - working-directory: ./robocorp/ + working-directory: ./rpaframework/ - run: pip wheel --no-deps . -w dist - working-directory: ./robocorp/ + working-directory: ./rpaframework/ - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - packages-dir: robocorp/dist/ + packages-dir: rpaframework/dist/ verbose: true diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index f7fb4db..5e2ffb2 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -34,7 +34,7 @@ jobs: packages-dir: external-worker/dist/ verbose: true - build-robocorp-client: + build-rpa-framework-client: runs-on: ubuntu-latest environment: release permissions: @@ -52,12 +52,12 @@ jobs: - run: source venv/bin/activate - run: pip install setuptools - run: python setup.py sdist - working-directory: ./robocorp/ + working-directory: ./rpaframework/ - run: pip wheel --no-deps . -w dist - working-directory: ./robocorp/ + working-directory: ./rpaframework/ - name: Publish package distributions to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ - packages-dir: robocorp/dist/ + packages-dir: rpaframework/dist/ verbose: true diff --git a/README.md b/README.md index 9b4f428..70906b4 100644 --- a/README.md +++ b/README.md @@ -9,4 +9,4 @@ This is a collection of multiple Flowable Python clients. Currently, the project consists out of: * [External Worker Client](./external-worker): A library to connect custom application code to Flowable with the external worker functionality -* [Robocorp Client](./robocorp-client): A python module to execute Robocorp actions and tasks with the Flowable Robocorp task (based on the external worker). \ No newline at end of file +* [RPA Framework Client](./rpaframework): A python module to execute RPA Framework tasks with the Flowable RPA Framework task (based on the external worker). \ No newline at end of file diff --git a/robocorp/README.md b/robocorp/README.md deleted file mode 100644 index 7cb219b..0000000 --- a/robocorp/README.md +++ /dev/null @@ -1,74 +0,0 @@ -from typing import Dict# Flowable Robocorp Client - -[License: -![license](https://img.shields.io/hexpm/l/plug.svg)](https://github.com/flowable/flowable-external-client-python/blob/main/LICENSE) - -![Flowable Actions CI](https://github.com/flowable/flowable-external-client-python/actions/workflows/main.yml/badge.svg?branch=main) - -This is a python module to connect a Flowable installation through an external worker with a Robocorp task or action. -This allows to execute a Robocorp task/action from a business process with BPMN or a case diagram CMMN. -The application is started with a task/action definition from Robocorp and connects to an external worker topic. -When using the Robocorp task in Flowable, it is possible to specify a task/action name. -In the task, the specific task/action specified will be executed and the result (only for actions) will be sent back to the process. -It is required that the variables in the diagram match exactly the variables inside the robocorp task/action. - -## Installation - -To install the Flowable Robocorp client, execute the following command: - -``` -pip install flowable.robocorp-client -``` - -## Sample - -The following [diagram BPMN](docs/robocorpExample.bpmn) illustrates a basic usage of the Robocorp task: - -![Simple BPMN diagram with a start event, a robocorp task and an end event](docs/robocorpExample.png) - -The following example `get-weather-forecast.py` can be used as a Robocorp action: -```python -from robocorp.actions import action - -@action -def get_weather_forecast(city: str, days: int, scale: str = "celsius") -> dict[str, str]: - """ - Returns weather conditions forecast for a given city. - - Args: - city (str): Target city to get the weather conditions for - days: How many day forecast to return - scale (str): Temperature scale to use, should be one of "celsius" or "fahrenheit" - - Returns: - object: The requested weather conditions forecast with the temperature as one element - """ - - # your implementation goes here... - - return { - "temperature": "the weather will be nice" - } -``` - -The Robocorp worker can be started with the following command: -```sh -python -m flowable.robocorp_client --flowable-token myTopic action get-weather-forecast.py -``` - -You can request `` at the [Flowable Trial](https://trial.flowable.com/work/) by clicking at the bottom left on your user and go to Settings. -Once in the settings, choose "Access Token" and press the button "New token". -After providing name and the validity, the token is generated and can be set. - -Once the module is started and a process instance is created, it will automatically execute the Robocorp action and returns the result to Flowable. -The Python module will keep running until stopped to process potential additional jobs. - -## Authentication - -Next to the cloud authentication, it's possible to authenticate against other hosts. -The hostname can be specified with `--flowable-host`. - -For the authentication there are two possibilities: - -1. Providing a bearer token with the `--flowable-token ` attribute. -2. Providing basic authentication with `--flowable-username ` and `--flowable-password ` diff --git a/rpaframework/.gitignore b/rpaframework/.gitignore new file mode 100644 index 0000000..6caf68a --- /dev/null +++ b/rpaframework/.gitignore @@ -0,0 +1 @@ +output \ No newline at end of file diff --git a/rpaframework/README.md b/rpaframework/README.md new file mode 100644 index 0000000..dad7f0f --- /dev/null +++ b/rpaframework/README.md @@ -0,0 +1,54 @@ +# Flowable RPA Framework Client + +[License: +![license](https://img.shields.io/hexpm/l/plug.svg)](https://github.com/flowable/flowable-external-client-python/blob/main/LICENSE) + +![Flowable Actions CI](https://github.com/flowable/flowable-external-client-python/actions/workflows/main.yml/badge.svg?branch=main) + +This is a python module to connect a Flowable installation through an external worker with a RPA framework task. +This allows to execute an RPA framework task from a business process with BPMN or a case diagram CMMN. +The application is started with a task definition from RPA framework and connects to an external worker topic. +When using the RPA framework task in Flowable, it is possible to specify a task name. +In the task, the specific task specified will be executed and the result will be sent back to the process. +It is required that the variables in the diagram match exactly the variables inside the RPA framework task. + +## Installation + +To install the Flowable RPA framework client, execute the following command: + +``` +pip install flowable.rpaframework-client +``` + +## Sample + +The following [diagram BPMN](docs/rpaframeworkExample.bpmn) illustrates a basic usage of the RPA framework task: + +![Simple BPMN diagram with a start event, a RPA Framework task and an end event](docs/rpaframeworkExample.png) + +The following example `get-weather-forecast.py` can be used as an RPA framework task: +``` + +``` + +The RPA Framework worker can be started with the following command: +```sh +python -m flowable.rpaframework_client --flowable-token myTopic myTask.robot +``` + +You can request `` at the [Flowable Trial](https://trial.flowable.com/work/) by clicking at the bottom left on your user and go to Settings. +Once in the settings, choose "Access Token" and press the button "New token". +After providing name and the validity, the token is generated and can be set. + +Once the module is started and a process instance is created, it will automatically execute the RPA framework action and returns the result to Flowable. +The Python module will keep running until stopped to process potential additional jobs. + +## Authentication + +Next to the cloud authentication, it's possible to authenticate against other hosts. +The hostname can be specified with `--flowable-host`. + +For the authentication there are two possibilities: + +1. Providing a bearer token with the `--flowable-token ` attribute. +2. Providing basic authentication with `--flowable-username ` and `--flowable-password ` diff --git a/robocorp/docs/robocorpExample.bpmn b/rpaframework/docs/robocorpExample.bpmn similarity index 96% rename from robocorp/docs/robocorpExample.bpmn rename to rpaframework/docs/robocorpExample.bpmn index b9d47e1..5acab49 100644 --- a/robocorp/docs/robocorpExample.bpmn +++ b/rpaframework/docs/robocorpExample.bpmn @@ -10,9 +10,9 @@ - + - + diff --git a/robocorp/docs/robocorpExample.png b/rpaframework/docs/robocorpExample.png similarity index 100% rename from robocorp/docs/robocorpExample.png rename to rpaframework/docs/robocorpExample.png diff --git a/robocorp/flowable/.gitignore b/rpaframework/flowable/.gitignore similarity index 100% rename from robocorp/flowable/.gitignore rename to rpaframework/flowable/.gitignore diff --git a/robocorp/flowable/__init__.py b/rpaframework/flowable/__init__.py similarity index 100% rename from robocorp/flowable/__init__.py rename to rpaframework/flowable/__init__.py diff --git a/robocorp/flowable/robocorp_client/API.py b/rpaframework/flowable/rpaframework_client/API.py similarity index 92% rename from robocorp/flowable/robocorp_client/API.py rename to rpaframework/flowable/rpaframework_client/API.py index b648015..9bf5fc8 100644 --- a/robocorp/flowable/robocorp_client/API.py +++ b/rpaframework/flowable/rpaframework_client/API.py @@ -19,7 +19,6 @@ def flw_input(self, name: str): def flw_output(self, name: str, value: any): output_file_name = os.environ.get("FLOWABLE_OUTPUT_FILE") self.result[name] = value - print('assign ' + name + '=' + value) if output_file_name is not None: with open(output_file_name, "w") as f: f.write(json.dumps(self.result)) diff --git a/robocorp/flowable/robocorp_client/__init__.py b/rpaframework/flowable/rpaframework_client/__init__.py similarity index 100% rename from robocorp/flowable/robocorp_client/__init__.py rename to rpaframework/flowable/rpaframework_client/__init__.py diff --git a/robocorp/flowable/robocorp_client/__main__.py b/rpaframework/flowable/rpaframework_client/__main__.py similarity index 62% rename from robocorp/flowable/robocorp_client/__main__.py rename to rpaframework/flowable/rpaframework_client/__main__.py index 82fa7a6..a55d24b 100644 --- a/robocorp/flowable/robocorp_client/__main__.py +++ b/rpaframework/flowable/rpaframework_client/__main__.py @@ -4,14 +4,14 @@ from flowable.external_worker_client import ExternalWorkerClient from flowable.external_worker_client.cloud_token import FlowableCloudToken -from flowable.robocorp_client.robocorp_handler import RobocorpActionHandler, RobocorpTaskHandler, RobocorpRobotHandler +from flowable.rpaframework_client.rpaframework_handler import RobocorpActionHandler, RobocorpTaskHandler, RpaframeworkRobotHandler if __name__ == "__main__": - parser = argparse.ArgumentParser(description="Flowable Robocorp Client") + parser = argparse.ArgumentParser(description="Flowable RPA Framework Client") - parser.add_argument('topic', help='Topic of the Robocorp Action to listen to') - parser.add_argument('mode', type=str, choices=['action', 'task', 'robot'], help='Type of robocorp action/task/robot') - parser.add_argument('path', type=str, help='The directory or file with the actions/tasks to run.') + parser.add_argument('topic', help='Topic of the client to listen to') + parser.add_argument('path', type=str, help='The directory or file with the RPA framework task to run.') + parser.add_argument('--mode', type=str, choices=['robot', 'action', 'task'], default='robot', help='Type of rpaframework robot or robocorp action or task') parser.add_argument('--flowable-host', type=str, default='https://trial.flowable.com', help='URL of Flowable Work') parser.add_argument('--flowable-token', type=str, help='Bearer Token, can be used for example with the Flowable Trial') parser.add_argument('--flowable-username', type=str, help='Username for Flowable Work when using Basic Authentication') @@ -20,7 +20,6 @@ args = parser.parse_args() topic = args.topic - robocorp_action_file = args.path auth = None if args.flowable_token: auth = FlowableCloudToken(args.flowable_token) @@ -31,9 +30,9 @@ client = ExternalWorkerClient(args.flowable_host, auth=auth) if args.mode == 'action': - robocorp_job_handler = RobocorpActionHandler(robocorp_action_file) + job_handler = RobocorpActionHandler(args.path) elif args.mode == 'task': - robocorp_job_handler = RobocorpTaskHandler(robocorp_action_file) + job_handler = RobocorpTaskHandler(args.path) else: - robocorp_job_handler = RobocorpRobotHandler(robocorp_action_file) - subscription = client.subscribe(topic, robocorp_job_handler.handle_task) + job_handler = RpaframeworkRobotHandler(args.path) + subscription = client.subscribe(topic, job_handler.handle_task) diff --git a/robocorp/flowable/robocorp_client/call_robocorp.py b/rpaframework/flowable/rpaframework_client/call_python_module.py similarity index 70% rename from robocorp/flowable/robocorp_client/call_robocorp.py rename to rpaframework/flowable/rpaframework_client/call_python_module.py index 20a997e..3b73e6c 100644 --- a/robocorp/flowable/robocorp_client/call_robocorp.py +++ b/rpaframework/flowable/rpaframework_client/call_python_module.py @@ -3,7 +3,7 @@ import sys -def call_robocorp(args, mod_name, env=None): +def call_python_module(args, mod_name, env=None): if env is None: env = os.environ.copy() call_args = [sys.executable, "-m", mod_name] @@ -11,5 +11,5 @@ def call_robocorp(args, mod_name, env=None): try: return subprocess.run(call_args, capture_output=True, text=True, env=env) except subprocess.CalledProcessError as exc: - print("ERROR: failed to call robocorp", exc.returncode, exc.output) + print("ERROR: failed to call rpa framework", exc.returncode, exc.output) diff --git a/robocorp/flowable/robocorp_client/robocorp_handler.py b/rpaframework/flowable/rpaframework_client/rpaframework_handler.py similarity index 86% rename from robocorp/flowable/robocorp_client/robocorp_handler.py rename to rpaframework/flowable/rpaframework_client/rpaframework_handler.py index d9f270c..9bc582c 100644 --- a/robocorp/flowable/robocorp_client/robocorp_handler.py +++ b/rpaframework/flowable/rpaframework_client/rpaframework_handler.py @@ -5,14 +5,14 @@ import tempfile from flowable.external_worker_client import ExternalWorkerAcquireJobResponse, WorkerResultBuilder -from flowable.robocorp_client.call_robocorp import call_robocorp +from flowable.rpaframework_client.call_python_module import call_python_module def extract_action_and_parameters(job): action = None params = [] for variable in job.variables: - if variable.name == '__robocorpTaskName': + if variable.name == '__rpaFrameworkTaskName': action = variable.value else: if variable.value is not None: @@ -24,7 +24,7 @@ def extract_action_and_parameters_map(job): action = None params = {} for variable in job.variables: - if variable.name == '__robocorpTaskName': + if variable.name == '__rpaFrameworkTaskName': action = variable.value else: if variable.value is not None: @@ -84,7 +84,7 @@ def handle_task(self, job: ExternalWorkerAcquireJobResponse, worker_result_build robocorp_args = ['run', self.robocorp_action_file, '-a' + action.__str__(), '--log-output-to-stdout=json', '-o' + output_dir, '--'] robocorp_args.extend(params) print('---> Execute job "' + job.id + '"', robocorp_args) - results = call_robocorp(robocorp_args, mod_name='robocorp.actions') + results = call_python_module(robocorp_args, mod_name='robocorp.actions') if results.returncode != 0: print('---> Job execution failed for "' + job.id + '". Output saved to ' + output_dir) return worker_result_builder.failure().error_message('failed with status code ' + str(results.returncode)).error_details(results.stderr + results.stdout) @@ -108,7 +108,7 @@ def handle_task(self, job: ExternalWorkerAcquireJobResponse, worker_result_build robocorp_args = ['run', self.robocorp_action_file, '-t' + action.__str__(), '-o' + output_dir, '--'] robocorp_args.extend(params) print('---> Execute job "' + job.id + '"', robocorp_args) - results = call_robocorp(robocorp_args, mod_name='robocorp.tasks') + results = call_python_module(robocorp_args, mod_name='robocorp.tasks') if results.returncode != 0: print('---> Job execution failed for "' + job.id + '". Output saved to ' + output_dir) return worker_result_builder.failure().error_message('failed with status code ' + str(results.returncode)).error_details(results.stderr + results.stdout) @@ -116,30 +116,30 @@ def handle_task(self, job: ExternalWorkerAcquireJobResponse, worker_result_build return worker_result_builder.success() -class RobocorpRobotHandler: - def __init__(self, robocorp_action_file: str): - self.robocorp_action_file = robocorp_action_file +class RpaframeworkRobotHandler: + def __init__(self, rpaframework_action_file: str): + self.rpaframework_action_file = rpaframework_action_file def handle_task(self, job: ExternalWorkerAcquireJobResponse, worker_result_builder: WorkerResultBuilder): action, params = extract_action_and_parameters_map(job) if action is None: - return worker_result_builder.failure().error_message('failed to find robocorp action name') + return worker_result_builder.failure().error_message('failed to find rpaframework action name') output_dir = create_output_dir(job) - robocorp_args = ['--rpa', '--name', action.__str__(), '--report', 'NONE', '--outputdir', output_dir, self.robocorp_action_file] - print('---> Execute job "' + job.id + '"', robocorp_args) + rpaframework_args = ['--rpa', '--name', action.__str__(), '--report', 'NONE', '--outputdir', output_dir, self.rpaframework_action_file] + print('---> Execute job "' + job.id + '"', rpaframework_args) tmp = tempfile.NamedTemporaryFile(delete=False) tmp.close() new_env = os.environ.copy() new_env["FLOWABLE_INPUT_VARIABLES"] = json.dumps(params) new_env["FLOWABLE_OUTPUT_FILE"] = tmp.name - results = call_robocorp(robocorp_args, mod_name='robot', env=new_env) + results = call_python_module(rpaframework_args, mod_name='robot', env=new_env) if results.returncode != 0: print('---> Job execution failed for "' + job.id + '". Output saved to ' + output_dir) os.unlink(tmp.name) return worker_result_builder.failure().error_message('failed with status code ' + str(results.returncode)).error_details(results.stderr + results.stdout) - print('---> Job execution done for "' + job.id + '". Output saved to ' + output_dir, robocorp_args) + print('---> Job execution done for "' + job.id + '". Output saved to ' + output_dir, rpaframework_args) with open(tmp.name, 'r') as content_file: content = json.loads(content_file.read()) diff --git a/robocorp/setup.py b/rpaframework/setup.py similarity index 56% rename from robocorp/setup.py rename to rpaframework/setup.py index d25b3d6..325cf96 100644 --- a/robocorp/setup.py +++ b/rpaframework/setup.py @@ -7,16 +7,16 @@ long_description = (this_directory / "README.md").read_text() setup( - name='flowable.robocorp-client', - packages=['flowable', 'flowable.robocorp_client'], + name='flowable.rpaframework-client', + packages=['flowable', 'flowable.rpaframework_client'], version='1.0.1rc3', - description='Flowable client to be used with Robocorp. This client connects to a Flowable instance via external worker and executes robocorp tasks or actions.', + description='Flowable client to be used with rpaframework. This client connects to a Flowable instance via external worker and executes rpaframework robots or robocorp tasks or actions.', long_description=long_description, long_description_content_type='text/markdown', author='Flowable', license='Apache License, Version 2.0', - install_requires=['flowable.external-worker-client>=1.0.1rc3', 'robocorp-actions>=0.2.1', 'robocorp-tasks>=3.1.1', 'robocorp-truststore>=0.9.1'], + install_requires=['flowable.external-worker-client>=1.0.1rc3'], extras_require={ - 'testing': ['pytest', 'vcrpy', 'flowable.external-worker-client>=1.0.1rc3'] + 'testing': ['pytest', 'vcrpy', 'flowable.external-worker-client>=1.0.1rc3', 'robocorp-actions>=0.2.1', 'robocorp-tasks>=3.1.1', 'robocorp-truststore>=0.9.1', 'rpaframework'] }, ) diff --git a/robocorp/tests/__init__.py b/rpaframework/tests/__init__.py similarity index 100% rename from robocorp/tests/__init__.py rename to rpaframework/tests/__init__.py diff --git a/robocorp/tests/basic_test.py b/rpaframework/tests/basic_test.py similarity index 100% rename from robocorp/tests/basic_test.py rename to rpaframework/tests/basic_test.py diff --git a/robocorp/tests/bpmn_utils.py b/rpaframework/tests/bpmn_utils.py similarity index 100% rename from robocorp/tests/bpmn_utils.py rename to rpaframework/tests/bpmn_utils.py diff --git a/robocorp/tests/fixtures/cassettes/test_with_custom_action.yml b/rpaframework/tests/fixtures/cassettes/test_with_custom_action.yml similarity index 76% rename from robocorp/tests/fixtures/cassettes/test_with_custom_action.yml rename to rpaframework/tests/fixtures/cassettes/test_with_custom_action.yml index 80ed24a..42df7af 100644 --- a/robocorp/tests/fixtures/cassettes/test_with_custom_action.yml +++ b/rpaframework/tests/fixtures/cassettes/test_with_custom_action.yml @@ -1,6 +1,6 @@ interactions: - request: - body: "--7d6d74e28e95ea697b80fb2e866f3861\r\nContent-Disposition: form-data; name=\"file\"; + body: "--c6a0c0b2df1c8d9e94b55f3855748d8a\r\nContent-Disposition: form-data; name=\"file\"; filename=\"robocorpExample.bpmn\"\r\n\r\n\n\n \n \n \n + sourceExpression=\"get_weather_forecast\" target=\"__rpaFrameworkTaskName\">\n \ \n \ \n \n \ \n \n \n \n \ \n \n - \ \n \n\r\n--7d6d74e28e95ea697b80fb2e866f3861--\r\n" + \ \n \n\r\n--c6a0c0b2df1c8d9e94b55f3855748d8a--\r\n" headers: Accept: - '*/*' @@ -59,16 +59,16 @@ interactions: Connection: - keep-alive Content-Length: - - '4594' + - '4598' Content-Type: - - multipart/form-data; boundary=7d6d74e28e95ea697b80fb2e866f3861 + - multipart/form-data; boundary=c6a0c0b2df1c8d9e94b55f3855748d8a User-Agent: - python-requests/2.32.3 method: POST uri: http://localhost:8090/flowable-work/process-api/repository/deployments response: body: - string: '{"id":"PRC-d7476565-7789-11ef-8757-fe6a9bab3681","name":"robocorpExample","deploymentTime":"2024-09-20T21:52:17.778+02:00","category":null,"parentDeploymentId":"PRC-d7476565-7789-11ef-8757-fe6a9bab3681","url":"http://localhost:8090/flowable-work/process-api/repository/deployments/PRC-d7476565-7789-11ef-8757-fe6a9bab3681","tenantId":""}' + string: '{"id":"PRC-aaf66307-7fd5-11ef-b484-768b56d159b1","name":"robocorpExample","deploymentTime":"2024-10-01T11:15:14.481+02:00","category":null,"parentDeploymentId":"PRC-aaf66307-7fd5-11ef-b484-768b56d159b1","url":"http://localhost:8090/flowable-work/process-api/repository/deployments/PRC-aaf66307-7fd5-11ef-b484-768b56d159b1","tenantId":""}' headers: Cache-Control: - no-cache, no-store, max-age=0, must-revalidate @@ -77,7 +77,7 @@ interactions: Content-Type: - application/json;charset=UTF-8 Date: - - Fri, 20 Sep 2024 19:52:17 GMT + - Tue, 01 Oct 2024 09:15:14 GMT Expires: - '0' Keep-Alive: @@ -85,7 +85,7 @@ interactions: Pragma: - no-cache Set-Cookie: - - XSRF-TOKEN=62423fb1-697e-413c-9b3d-3f24f0e9780b; Path=/flowable-work + - XSRF-TOKEN=1496c0b2-5702-4afa-b8cf-c379f2793eff; Path=/flowable-work Transfer-Encoding: - chunked Vary: @@ -115,11 +115,11 @@ interactions: User-Agent: - python-requests/2.32.3 method: GET - uri: http://localhost:8090/flowable-work/process-api/repository/process-definitions?deploymentId=PRC-d7476565-7789-11ef-8757-fe6a9bab3681 + uri: http://localhost:8090/flowable-work/process-api/repository/process-definitions?deploymentId=PRC-aaf66307-7fd5-11ef-b484-768b56d159b1 response: body: - string: '{"data":[{"id":"PRC-robocorpExample:3:d749d667-7789-11ef-8757-fe6a9bab3681","url":"http://localhost:8090/flowable-work/process-api/repository/process-definitions/PRC-robocorpExample:3:d749d667-7789-11ef-8757-fe6a9bab3681","key":"robocorpExample","version":3,"name":"Robocorp - Example","description":null,"tenantId":"","deploymentId":"PRC-d7476565-7789-11ef-8757-fe6a9bab3681","deploymentUrl":"http://localhost:8090/flowable-work/process-api/repository/deployments/PRC-d7476565-7789-11ef-8757-fe6a9bab3681","resource":"http://localhost:8090/flowable-work/process-api/repository/deployments/PRC-d7476565-7789-11ef-8757-fe6a9bab3681/resources/robocorpExample.bpmn","diagramResource":null,"category":"http://flowable.org/test","graphicalNotationDefined":true,"suspended":false,"startFormDefined":false}],"total":1,"start":0,"sort":"name","order":"asc","size":1}' + string: '{"data":[{"id":"PRC-robocorpExample:4:aaf99759-7fd5-11ef-b484-768b56d159b1","url":"http://localhost:8090/flowable-work/process-api/repository/process-definitions/PRC-robocorpExample:4:aaf99759-7fd5-11ef-b484-768b56d159b1","key":"robocorpExample","version":4,"name":"Robocorp + Example","description":null,"tenantId":"","deploymentId":"PRC-aaf66307-7fd5-11ef-b484-768b56d159b1","deploymentUrl":"http://localhost:8090/flowable-work/process-api/repository/deployments/PRC-aaf66307-7fd5-11ef-b484-768b56d159b1","resource":"http://localhost:8090/flowable-work/process-api/repository/deployments/PRC-aaf66307-7fd5-11ef-b484-768b56d159b1/resources/robocorpExample.bpmn","diagramResource":null,"category":"http://flowable.org/test","graphicalNotationDefined":true,"suspended":false,"startFormDefined":false}],"total":1,"start":0,"sort":"name","order":"asc","size":1}' headers: Cache-Control: - no-cache, no-store, max-age=0, must-revalidate @@ -128,7 +128,7 @@ interactions: Content-Type: - application/json;charset=UTF-8 Date: - - Fri, 20 Sep 2024 19:52:17 GMT + - Tue, 01 Oct 2024 09:15:14 GMT Expires: - '0' Keep-Alive: @@ -136,7 +136,7 @@ interactions: Pragma: - no-cache Set-Cookie: - - XSRF-TOKEN=73278ac4-c116-42b6-bee9-73ed4296f913; Path=/flowable-work + - XSRF-TOKEN=3c816eb4-151a-4159-9529-eef9bedbbf39; Path=/flowable-work Transfer-Encoding: - chunked Vary: @@ -153,7 +153,7 @@ interactions: code: 200 message: '' - request: - body: '{"processDefinitionId": "PRC-robocorpExample:3:d749d667-7789-11ef-8757-fe6a9bab3681", + body: '{"processDefinitionId": "PRC-robocorpExample:4:aaf99759-7fd5-11ef-b484-768b56d159b1", "variables": [{"name": "city", "type": "string", "value": "Zurich"}, {"name": "days", "type": "integer", "value": 3}]}' headers: @@ -175,8 +175,8 @@ interactions: uri: http://localhost:8090/flowable-work/process-api/runtime/process-instances response: body: - string: '{"id":"PRC-d76ffc09-7789-11ef-8757-fe6a9bab3681","url":"http://localhost:8090/flowable-work/process-api/runtime/process-instances/PRC-d76ffc09-7789-11ef-8757-fe6a9bab3681","name":null,"businessKey":null,"businessStatus":null,"suspended":false,"ended":false,"processDefinitionId":"PRC-robocorpExample:3:d749d667-7789-11ef-8757-fe6a9bab3681","processDefinitionUrl":"http://localhost:8090/flowable-work/process-api/repository/process-definitions/PRC-robocorpExample:3:d749d667-7789-11ef-8757-fe6a9bab3681","processDefinitionName":"Robocorp - Example","processDefinitionDescription":null,"activityId":null,"startUserId":"admin","startTime":"2024-09-20T21:52:18.044+02:00","superProcessInstanceId":null,"variables":[{"name":"city","type":"string","value":"Zurich","scope":"local"},{"name":"initiator","type":"string","value":"admin","scope":"local"},{"name":"days","type":"integer","value":3,"scope":"local"}],"callbackId":null,"callbackType":null,"referenceId":null,"referenceType":null,"propagatedStageInstanceId":null,"tenantId":"","completed":false}' + string: '{"id":"PRC-ab2d518b-7fd5-11ef-b484-768b56d159b1","url":"http://localhost:8090/flowable-work/process-api/runtime/process-instances/PRC-ab2d518b-7fd5-11ef-b484-768b56d159b1","name":null,"businessKey":null,"businessStatus":null,"suspended":false,"ended":false,"processDefinitionId":"PRC-robocorpExample:4:aaf99759-7fd5-11ef-b484-768b56d159b1","processDefinitionUrl":"http://localhost:8090/flowable-work/process-api/repository/process-definitions/PRC-robocorpExample:4:aaf99759-7fd5-11ef-b484-768b56d159b1","processDefinitionName":"Robocorp + Example","processDefinitionDescription":null,"activityId":null,"startUserId":"admin","startTime":"2024-10-01T11:15:14.841+02:00","superProcessInstanceId":null,"variables":[{"name":"city","type":"string","value":"Zurich","scope":"local"},{"name":"initiator","type":"string","value":"admin","scope":"local"},{"name":"days","type":"integer","value":3,"scope":"local"}],"callbackId":null,"callbackType":null,"referenceId":null,"referenceType":null,"propagatedStageInstanceId":null,"tenantId":"","completed":false}' headers: Cache-Control: - no-cache, no-store, max-age=0, must-revalidate @@ -185,7 +185,7 @@ interactions: Content-Type: - application/json;charset=UTF-8 Date: - - Fri, 20 Sep 2024 19:52:17 GMT + - Tue, 01 Oct 2024 09:15:14 GMT Expires: - '0' Keep-Alive: @@ -193,7 +193,7 @@ interactions: Pragma: - no-cache Set-Cookie: - - XSRF-TOKEN=051033f2-6205-488e-84e9-aa4140c00722; Path=/flowable-work + - XSRF-TOKEN=e4ce7854-15d4-4959-a33c-469480f68aec; Path=/flowable-work Transfer-Encoding: - chunked Vary: @@ -223,11 +223,11 @@ interactions: User-Agent: - python-requests/2.32.3 method: GET - uri: http://localhost:8090/flowable-work/external-job-api/jobs?processInstanceId=PRC-d76ffc09-7789-11ef-8757-fe6a9bab3681 + uri: http://localhost:8090/flowable-work/external-job-api/jobs?processInstanceId=PRC-ab2d518b-7fd5-11ef-b484-768b56d159b1 response: body: - string: '{"data":[{"id":"JOB-d7707145-7789-11ef-8757-fe6a9bab3681","url":"http://localhost:8090/flowable-work/external-job-api/jobs/JOB-d7707145-7789-11ef-8757-fe6a9bab3681","correlationId":"d7707144-7789-11ef-8757-fe6a9bab3681","processInstanceId":"PRC-d76ffc09-7789-11ef-8757-fe6a9bab3681","processDefinitionId":"PRC-robocorpExample:3:d749d667-7789-11ef-8757-fe6a9bab3681","executionId":"PRC-d770231e-7789-11ef-8757-fe6a9bab3681","scopeId":null,"subScopeId":null,"scopeDefinitionId":null,"scopeType":null,"elementId":"bpmnTask_1","elementName":"Get - Weather Forecast","retries":3,"exceptionMessage":null,"dueDate":null,"createTime":"2024-09-20T19:52:18.047Z","tenantId":"","lockOwner":null,"lockExpirationTime":null}],"total":1,"start":0,"sort":"id","order":"asc","size":1}' + string: '{"data":[{"id":"JOB-ab300fb7-7fd5-11ef-b484-768b56d159b1","url":"http://localhost:8090/flowable-work/external-job-api/jobs/JOB-ab300fb7-7fd5-11ef-b484-768b56d159b1","correlationId":"ab300fb6-7fd5-11ef-b484-768b56d159b1","processInstanceId":"PRC-ab2d518b-7fd5-11ef-b484-768b56d159b1","processDefinitionId":"PRC-robocorpExample:4:aaf99759-7fd5-11ef-b484-768b56d159b1","executionId":"PRC-ab2d9fb0-7fd5-11ef-b484-768b56d159b1","scopeId":null,"subScopeId":null,"scopeDefinitionId":null,"scopeType":null,"elementId":"bpmnTask_1","elementName":"Get + Weather Forecast","retries":3,"exceptionMessage":null,"dueDate":null,"createTime":"2024-10-01T09:15:14.859Z","tenantId":"","lockOwner":null,"lockExpirationTime":null}],"total":1,"start":0,"sort":"id","order":"asc","size":1}' headers: Cache-Control: - no-cache, no-store, max-age=0, must-revalidate @@ -236,7 +236,7 @@ interactions: Content-Type: - application/json;charset=UTF-8 Date: - - Fri, 20 Sep 2024 19:52:17 GMT + - Tue, 01 Oct 2024 09:15:14 GMT Expires: - '0' Keep-Alive: @@ -244,7 +244,7 @@ interactions: Pragma: - no-cache Set-Cookie: - - XSRF-TOKEN=8d8dec72-f0fc-4452-a82c-a18f107e41c9; Path=/flowable-work + - XSRF-TOKEN=dc33065e-c012-44d1-ba48-6f57e1af01ab; Path=/flowable-work Transfer-Encoding: - chunked Vary: @@ -274,11 +274,11 @@ interactions: User-Agent: - python-requests/2.32.3 method: GET - uri: http://localhost:8090/flowable-work/external-job-api/jobs/JOB-d7707145-7789-11ef-8757-fe6a9bab3681?i=0 + uri: http://localhost:8090/flowable-work/external-job-api/jobs/JOB-ab300fb7-7fd5-11ef-b484-768b56d159b1?i=0 response: body: - string: '{"id":"JOB-d7707145-7789-11ef-8757-fe6a9bab3681","url":"http://localhost:8090/flowable-work/external-job-api/jobs/JOB-d7707145-7789-11ef-8757-fe6a9bab3681","correlationId":"d7707144-7789-11ef-8757-fe6a9bab3681","processInstanceId":"PRC-d76ffc09-7789-11ef-8757-fe6a9bab3681","processDefinitionId":"PRC-robocorpExample:3:d749d667-7789-11ef-8757-fe6a9bab3681","executionId":"PRC-d770231e-7789-11ef-8757-fe6a9bab3681","scopeId":null,"subScopeId":null,"scopeDefinitionId":null,"scopeType":null,"elementId":"bpmnTask_1","elementName":"Get - Weather Forecast","retries":3,"exceptionMessage":null,"dueDate":null,"createTime":"2024-09-20T19:52:18.047Z","tenantId":"","lockOwner":null,"lockExpirationTime":null}' + string: '{"id":"JOB-ab300fb7-7fd5-11ef-b484-768b56d159b1","url":"http://localhost:8090/flowable-work/external-job-api/jobs/JOB-ab300fb7-7fd5-11ef-b484-768b56d159b1","correlationId":"ab300fb6-7fd5-11ef-b484-768b56d159b1","processInstanceId":"PRC-ab2d518b-7fd5-11ef-b484-768b56d159b1","processDefinitionId":"PRC-robocorpExample:4:aaf99759-7fd5-11ef-b484-768b56d159b1","executionId":"PRC-ab2d9fb0-7fd5-11ef-b484-768b56d159b1","scopeId":null,"subScopeId":null,"scopeDefinitionId":null,"scopeType":null,"elementId":"bpmnTask_1","elementName":"Get + Weather Forecast","retries":3,"exceptionMessage":null,"dueDate":null,"createTime":"2024-10-01T09:15:14.859Z","tenantId":"","lockOwner":null,"lockExpirationTime":null}' headers: Cache-Control: - no-cache, no-store, max-age=0, must-revalidate @@ -287,7 +287,7 @@ interactions: Content-Type: - application/json;charset=UTF-8 Date: - - Fri, 20 Sep 2024 19:52:17 GMT + - Tue, 01 Oct 2024 09:15:14 GMT Expires: - '0' Keep-Alive: @@ -295,7 +295,7 @@ interactions: Pragma: - no-cache Set-Cookie: - - XSRF-TOKEN=29769a42-9c6e-476b-8e5c-924e7cdf37fd; Path=/flowable-work + - XSRF-TOKEN=01ce5e5a-fa08-4f07-a5d0-a97bbd8db53d; Path=/flowable-work Transfer-Encoding: - chunked Vary: @@ -325,11 +325,11 @@ interactions: User-Agent: - python-requests/2.32.3 method: GET - uri: http://localhost:8090/flowable-work/external-job-api/jobs/JOB-d7707145-7789-11ef-8757-fe6a9bab3681?i=1 + uri: http://localhost:8090/flowable-work/external-job-api/jobs/JOB-ab300fb7-7fd5-11ef-b484-768b56d159b1?i=1 response: body: - string: '{"id":"JOB-d7707145-7789-11ef-8757-fe6a9bab3681","url":"http://localhost:8090/flowable-work/external-job-api/jobs/JOB-d7707145-7789-11ef-8757-fe6a9bab3681","correlationId":"d7707144-7789-11ef-8757-fe6a9bab3681","processInstanceId":"PRC-d76ffc09-7789-11ef-8757-fe6a9bab3681","processDefinitionId":"PRC-robocorpExample:3:d749d667-7789-11ef-8757-fe6a9bab3681","executionId":"PRC-d770231e-7789-11ef-8757-fe6a9bab3681","scopeId":null,"subScopeId":null,"scopeDefinitionId":null,"scopeType":null,"elementId":"bpmnTask_1","elementName":"Get - Weather Forecast","retries":3,"exceptionMessage":null,"dueDate":null,"createTime":"2024-09-20T19:52:18.047Z","tenantId":"","lockOwner":"lelia.local-44317","lockExpirationTime":"2024-09-20T19:53:18.540Z"}' + string: '{"id":"JOB-ab300fb7-7fd5-11ef-b484-768b56d159b1","url":"http://localhost:8090/flowable-work/external-job-api/jobs/JOB-ab300fb7-7fd5-11ef-b484-768b56d159b1","correlationId":"ab300fb6-7fd5-11ef-b484-768b56d159b1","processInstanceId":"PRC-ab2d518b-7fd5-11ef-b484-768b56d159b1","processDefinitionId":"PRC-robocorpExample:4:aaf99759-7fd5-11ef-b484-768b56d159b1","executionId":"PRC-ab2d9fb0-7fd5-11ef-b484-768b56d159b1","scopeId":null,"subScopeId":null,"scopeDefinitionId":null,"scopeType":null,"elementId":"bpmnTask_1","elementName":"Get + Weather Forecast","retries":3,"exceptionMessage":null,"dueDate":null,"createTime":"2024-10-01T09:15:14.859Z","tenantId":"","lockOwner":"lelia.local-44950","lockExpirationTime":"2024-10-01T09:16:15.469Z"}' headers: Cache-Control: - no-cache, no-store, max-age=0, must-revalidate @@ -338,7 +338,7 @@ interactions: Content-Type: - application/json;charset=UTF-8 Date: - - Fri, 20 Sep 2024 19:52:17 GMT + - Tue, 01 Oct 2024 09:15:15 GMT Expires: - '0' Keep-Alive: @@ -346,7 +346,7 @@ interactions: Pragma: - no-cache Set-Cookie: - - XSRF-TOKEN=d9451b5a-7346-4344-8983-65b324b94404; Path=/flowable-work + - XSRF-TOKEN=cb8b8493-b761-40ec-a14d-571d23309f52; Path=/flowable-work Transfer-Encoding: - chunked Vary: @@ -376,11 +376,11 @@ interactions: User-Agent: - python-requests/2.32.3 method: GET - uri: http://localhost:8090/flowable-work/external-job-api/jobs/JOB-d7707145-7789-11ef-8757-fe6a9bab3681?i=2 + uri: http://localhost:8090/flowable-work/external-job-api/jobs/JOB-ab300fb7-7fd5-11ef-b484-768b56d159b1?i=2 response: body: - string: '{"id":"JOB-d7707145-7789-11ef-8757-fe6a9bab3681","url":"http://localhost:8090/flowable-work/external-job-api/jobs/JOB-d7707145-7789-11ef-8757-fe6a9bab3681","correlationId":"d7707144-7789-11ef-8757-fe6a9bab3681","processInstanceId":"PRC-d76ffc09-7789-11ef-8757-fe6a9bab3681","processDefinitionId":"PRC-robocorpExample:3:d749d667-7789-11ef-8757-fe6a9bab3681","executionId":"PRC-d770231e-7789-11ef-8757-fe6a9bab3681","scopeId":null,"subScopeId":null,"scopeDefinitionId":null,"scopeType":null,"elementId":"bpmnTask_1","elementName":"Get - Weather Forecast","retries":3,"exceptionMessage":null,"dueDate":null,"createTime":"2024-09-20T19:52:18.047Z","tenantId":"","lockOwner":"lelia.local-44317","lockExpirationTime":"2024-09-20T19:53:18.540Z"}' + string: '{"id":"JOB-ab300fb7-7fd5-11ef-b484-768b56d159b1","url":"http://localhost:8090/flowable-work/external-job-api/jobs/JOB-ab300fb7-7fd5-11ef-b484-768b56d159b1","correlationId":"ab300fb6-7fd5-11ef-b484-768b56d159b1","processInstanceId":"PRC-ab2d518b-7fd5-11ef-b484-768b56d159b1","processDefinitionId":"PRC-robocorpExample:4:aaf99759-7fd5-11ef-b484-768b56d159b1","executionId":"PRC-ab2d9fb0-7fd5-11ef-b484-768b56d159b1","scopeId":null,"subScopeId":null,"scopeDefinitionId":null,"scopeType":null,"elementId":"bpmnTask_1","elementName":"Get + Weather Forecast","retries":3,"exceptionMessage":null,"dueDate":null,"createTime":"2024-10-01T09:15:14.859Z","tenantId":"","lockOwner":"lelia.local-44950","lockExpirationTime":"2024-10-01T09:16:15.469Z"}' headers: Cache-Control: - no-cache, no-store, max-age=0, must-revalidate @@ -389,7 +389,7 @@ interactions: Content-Type: - application/json;charset=UTF-8 Date: - - Fri, 20 Sep 2024 19:52:18 GMT + - Tue, 01 Oct 2024 09:15:15 GMT Expires: - '0' Keep-Alive: @@ -397,7 +397,7 @@ interactions: Pragma: - no-cache Set-Cookie: - - XSRF-TOKEN=3045f0c1-f8f9-4375-9400-d8cf7d519b57; Path=/flowable-work + - XSRF-TOKEN=da2f8cf4-a79f-48f9-9c0a-66ade85ca60f; Path=/flowable-work Transfer-Encoding: - chunked Vary: @@ -427,11 +427,11 @@ interactions: User-Agent: - python-requests/2.32.3 method: GET - uri: http://localhost:8090/flowable-work/external-job-api/jobs/JOB-d7707145-7789-11ef-8757-fe6a9bab3681?i=3 + uri: http://localhost:8090/flowable-work/external-job-api/jobs/JOB-ab300fb7-7fd5-11ef-b484-768b56d159b1?i=3 response: body: string: '{"message":"Not found","exception":"Could not find external worker - job with id ''JOB-d7707145-7789-11ef-8757-fe6a9bab3681''."}' + job with id ''JOB-ab300fb7-7fd5-11ef-b484-768b56d159b1''."}' headers: Cache-Control: - no-cache, no-store, max-age=0, must-revalidate @@ -440,7 +440,7 @@ interactions: Content-Type: - application/json;charset=UTF-8 Date: - - Fri, 20 Sep 2024 19:52:18 GMT + - Tue, 01 Oct 2024 09:15:15 GMT Expires: - '0' Keep-Alive: @@ -448,7 +448,7 @@ interactions: Pragma: - no-cache Set-Cookie: - - XSRF-TOKEN=ebf40149-a726-467b-b666-a2ee794e55b5; Path=/flowable-work + - XSRF-TOKEN=bfa8bf61-12df-49e6-a90a-b6c37587e488; Path=/flowable-work Transfer-Encoding: - chunked Vary: @@ -478,10 +478,10 @@ interactions: User-Agent: - python-requests/2.32.3 method: GET - uri: http://localhost:8090/flowable-work/process-api/history/historic-variable-instances?processInstanceId=PRC-d76ffc09-7789-11ef-8757-fe6a9bab3681&variableName=temperature + uri: http://localhost:8090/flowable-work/process-api/history/historic-variable-instances?processInstanceId=PRC-ab2d518b-7fd5-11ef-b484-768b56d159b1&variableName=temperature response: body: - string: '{"data":[{"id":"VAR-d81f9d09-7789-11ef-8757-fe6a9bab3681","processInstanceId":"PRC-d76ffc09-7789-11ef-8757-fe6a9bab3681","processInstanceUrl":"http://localhost:8090/flowable-work/process-api/history/historic-process-instances/PRC-d76ffc09-7789-11ef-8757-fe6a9bab3681","taskId":null,"executionId":"PRC-d76ffc09-7789-11ef-8757-fe6a9bab3681","variable":{"name":"temperature","type":"integer","value":18,"scope":"global"}}],"total":1,"start":0,"sort":"variableName","order":"asc","size":1}' + string: '{"data":[{"id":"VAR-abf77e6b-7fd5-11ef-b484-768b56d159b1","processInstanceId":"PRC-ab2d518b-7fd5-11ef-b484-768b56d159b1","processInstanceUrl":"http://localhost:8090/flowable-work/process-api/history/historic-process-instances/PRC-ab2d518b-7fd5-11ef-b484-768b56d159b1","taskId":null,"executionId":"PRC-ab2d518b-7fd5-11ef-b484-768b56d159b1","variable":{"name":"temperature","type":"integer","value":18,"scope":"global"}}],"total":1,"start":0,"sort":"variableName","order":"asc","size":1}' headers: Cache-Control: - no-cache, no-store, max-age=0, must-revalidate @@ -490,7 +490,7 @@ interactions: Content-Type: - application/json;charset=UTF-8 Date: - - Fri, 20 Sep 2024 19:52:18 GMT + - Tue, 01 Oct 2024 09:15:15 GMT Expires: - '0' Keep-Alive: @@ -498,7 +498,7 @@ interactions: Pragma: - no-cache Set-Cookie: - - XSRF-TOKEN=118c41ad-05fe-4c95-8282-b11ef9433cfc; Path=/flowable-work + - XSRF-TOKEN=0696c993-114f-492a-a807-373b8bce3c79; Path=/flowable-work Transfer-Encoding: - chunked Vary: @@ -530,11 +530,11 @@ interactions: User-Agent: - python-requests/2.32.3 method: DELETE - uri: http://localhost:8090/flowable-work/process-api/runtime/process-instances/PRC-d76ffc09-7789-11ef-8757-fe6a9bab3681 + uri: http://localhost:8090/flowable-work/process-api/runtime/process-instances/PRC-ab2d518b-7fd5-11ef-b484-768b56d159b1 response: body: string: '{"message":"Not found","exception":"Could not find a process instance - with id ''PRC-d76ffc09-7789-11ef-8757-fe6a9bab3681''."}' + with id ''PRC-ab2d518b-7fd5-11ef-b484-768b56d159b1''."}' headers: Cache-Control: - no-cache, no-store, max-age=0, must-revalidate @@ -543,7 +543,7 @@ interactions: Content-Type: - application/json;charset=UTF-8 Date: - - Fri, 20 Sep 2024 19:52:18 GMT + - Tue, 01 Oct 2024 09:15:16 GMT Expires: - '0' Keep-Alive: @@ -551,7 +551,7 @@ interactions: Pragma: - no-cache Set-Cookie: - - XSRF-TOKEN=544145b7-2c6a-4f55-861d-1aecc58aea32; Path=/flowable-work + - XSRF-TOKEN=7a01c8bf-2d93-4791-8bfb-73aea89be58b; Path=/flowable-work Transfer-Encoding: - chunked Vary: @@ -583,7 +583,7 @@ interactions: User-Agent: - python-requests/2.32.3 method: DELETE - uri: http://localhost:8090/flowable-work/process-api/repository/deployments/PRC-d7476565-7789-11ef-8757-fe6a9bab3681 + uri: http://localhost:8090/flowable-work/process-api/repository/deployments/PRC-aaf66307-7fd5-11ef-b484-768b56d159b1 response: body: string: '' @@ -593,7 +593,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 20 Sep 2024 19:52:18 GMT + - Tue, 01 Oct 2024 09:15:16 GMT Expires: - '0' Keep-Alive: @@ -601,7 +601,7 @@ interactions: Pragma: - no-cache Set-Cookie: - - XSRF-TOKEN=f2d2e2e7-ad28-407c-9759-9d471b06d820; Path=/flowable-work + - XSRF-TOKEN=3ccda606-0e66-46f5-af27-cadab7655554; Path=/flowable-work Vary: - Origin - Access-Control-Request-Method diff --git a/rpaframework/tests/fixtures/cassettes/test_with_robot.yml b/rpaframework/tests/fixtures/cassettes/test_with_robot.yml new file mode 100644 index 0000000..520b1a0 --- /dev/null +++ b/rpaframework/tests/fixtures/cassettes/test_with_robot.yml @@ -0,0 +1,669 @@ +interactions: +- request: + body: "--b17ad67bd020881a19cf3c9437c51551\r\nContent-Disposition: form-data; name=\"file\"; + filename=\"robocorpExample.bpmn\"\r\n\r\n\n\n + \ \n \n + \ \n \n + \ \n + \ \n \n + \ \n \n \n \n + \ \n + \ \n \n + \ \n \n \n \n + \ \n + \ \n \n + \ \n \n \n + \ \n \n + \ \n \n \n \n + \ \n \n \n \n + \ \n \n + \ \n \n \n + \ \n + \ \n + \ \n + \ \n \n \n \n \n \n \n + \ \n \n + \ \n \n + \ \n \n + \ \n \n + \ \n \n\r\n--b17ad67bd020881a19cf3c9437c51551--\r\n" + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Basic YWRtaW46dGVzdA== + Connection: + - keep-alive + Content-Length: + - '4598' + Content-Type: + - multipart/form-data; boundary=b17ad67bd020881a19cf3c9437c51551 + User-Agent: + - python-requests/2.32.3 + method: POST + uri: http://localhost:8090/flowable-work/process-api/repository/deployments + response: + body: + string: '{"id":"PRC-b6366979-7fd7-11ef-b484-768b56d159b1","name":"robocorpExample","deploymentTime":"2024-10-01T11:29:52.349+02:00","category":null,"parentDeploymentId":"PRC-b6366979-7fd7-11ef-b484-768b56d159b1","url":"http://localhost:8090/flowable-work/process-api/repository/deployments/PRC-b6366979-7fd7-11ef-b484-768b56d159b1","tenantId":""}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Type: + - application/json;charset=UTF-8 + Date: + - Tue, 01 Oct 2024 09:29:51 GMT + Expires: + - '0' + Keep-Alive: + - timeout=60 + Pragma: + - no-cache + Set-Cookie: + - XSRF-TOKEN=ec06ac38-7349-46a1-b28a-7cf8ddb69c9d; Path=/flowable-work + Transfer-Encoding: + - chunked + Vary: + - origin,access-control-request-method,access-control-request-headers,accept-encoding + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-XSS-Protection: + - '0' + content-length: + - '337' + status: + code: 201 + message: '' +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Basic YWRtaW46dGVzdA== + Connection: + - keep-alive + User-Agent: + - python-requests/2.32.3 + method: GET + uri: http://localhost:8090/flowable-work/process-api/repository/process-definitions?deploymentId=PRC-b6366979-7fd7-11ef-b484-768b56d159b1 + response: + body: + string: '{"data":[{"id":"PRC-robocorpExample:10:b6399dcb-7fd7-11ef-b484-768b56d159b1","url":"http://localhost:8090/flowable-work/process-api/repository/process-definitions/PRC-robocorpExample:10:b6399dcb-7fd7-11ef-b484-768b56d159b1","key":"robocorpExample","version":10,"name":"Robocorp + Example","description":null,"tenantId":"","deploymentId":"PRC-b6366979-7fd7-11ef-b484-768b56d159b1","deploymentUrl":"http://localhost:8090/flowable-work/process-api/repository/deployments/PRC-b6366979-7fd7-11ef-b484-768b56d159b1","resource":"http://localhost:8090/flowable-work/process-api/repository/deployments/PRC-b6366979-7fd7-11ef-b484-768b56d159b1/resources/robocorpExample.bpmn","diagramResource":null,"category":"http://flowable.org/test","graphicalNotationDefined":true,"suspended":false,"startFormDefined":false}],"total":1,"start":0,"sort":"name","order":"asc","size":1}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Type: + - application/json;charset=UTF-8 + Date: + - Tue, 01 Oct 2024 09:29:51 GMT + Expires: + - '0' + Keep-Alive: + - timeout=60 + Pragma: + - no-cache + Set-Cookie: + - XSRF-TOKEN=816658d3-fecc-4c2e-bf08-fb0a26f17d30; Path=/flowable-work + Transfer-Encoding: + - chunked + Vary: + - origin,access-control-request-method,access-control-request-headers,accept-encoding + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-XSS-Protection: + - '0' + content-length: + - '859' + status: + code: 200 + message: '' +- request: + body: '{"processDefinitionId": "PRC-robocorpExample:10:b6399dcb-7fd7-11ef-b484-768b56d159b1", + "variables": [{"name": "city", "type": "string", "value": "Zurich"}, {"name": + "days", "type": "integer", "value": 3}]}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Basic YWRtaW46dGVzdA== + Connection: + - keep-alive + Content-Length: + - '205' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: http://localhost:8090/flowable-work/process-api/runtime/process-instances + response: + body: + string: '{"id":"PRC-b669fc9d-7fd7-11ef-b484-768b56d159b1","url":"http://localhost:8090/flowable-work/process-api/runtime/process-instances/PRC-b669fc9d-7fd7-11ef-b484-768b56d159b1","name":null,"businessKey":null,"businessStatus":null,"suspended":false,"ended":false,"processDefinitionId":"PRC-robocorpExample:10:b6399dcb-7fd7-11ef-b484-768b56d159b1","processDefinitionUrl":"http://localhost:8090/flowable-work/process-api/repository/process-definitions/PRC-robocorpExample:10:b6399dcb-7fd7-11ef-b484-768b56d159b1","processDefinitionName":"Robocorp + Example","processDefinitionDescription":null,"activityId":null,"startUserId":"admin","startTime":"2024-10-01T11:29:52.687+02:00","superProcessInstanceId":null,"variables":[{"name":"city","type":"string","value":"Zurich","scope":"local"},{"name":"initiator","type":"string","value":"admin","scope":"local"},{"name":"days","type":"integer","value":3,"scope":"local"}],"callbackId":null,"callbackType":null,"referenceId":null,"referenceType":null,"propagatedStageInstanceId":null,"tenantId":"","completed":false}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Type: + - application/json;charset=UTF-8 + Date: + - Tue, 01 Oct 2024 09:29:51 GMT + Expires: + - '0' + Keep-Alive: + - timeout=60 + Pragma: + - no-cache + Set-Cookie: + - XSRF-TOKEN=ab8f5bf7-b57c-4acb-a00f-a8550198eb0d; Path=/flowable-work + Transfer-Encoding: + - chunked + Vary: + - origin,access-control-request-method,access-control-request-headers,accept-encoding + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-XSS-Protection: + - '0' + content-length: + - '1048' + status: + code: 201 + message: '' +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Basic YWRtaW46dGVzdA== + Connection: + - keep-alive + User-Agent: + - python-requests/2.32.3 + method: GET + uri: http://localhost:8090/flowable-work/external-job-api/jobs?processInstanceId=PRC-b669fc9d-7fd7-11ef-b484-768b56d159b1 + response: + body: + string: '{"data":[{"id":"JOB-b66d5809-7fd7-11ef-b484-768b56d159b1","url":"http://localhost:8090/flowable-work/external-job-api/jobs/JOB-b66d5809-7fd7-11ef-b484-768b56d159b1","correlationId":"b66d5808-7fd7-11ef-b484-768b56d159b1","processInstanceId":"PRC-b669fc9d-7fd7-11ef-b484-768b56d159b1","processDefinitionId":"PRC-robocorpExample:10:b6399dcb-7fd7-11ef-b484-768b56d159b1","executionId":"PRC-b66a71d2-7fd7-11ef-b484-768b56d159b1","scopeId":null,"subScopeId":null,"scopeDefinitionId":null,"scopeType":null,"elementId":"bpmnTask_1","elementName":"Get + Weather Forecast","retries":3,"exceptionMessage":null,"dueDate":null,"createTime":"2024-10-01T09:29:52.709Z","tenantId":"","lockOwner":null,"lockExpirationTime":null}],"total":1,"start":0,"sort":"id","order":"asc","size":1}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Type: + - application/json;charset=UTF-8 + Date: + - Tue, 01 Oct 2024 09:29:51 GMT + Expires: + - '0' + Keep-Alive: + - timeout=60 + Pragma: + - no-cache + Set-Cookie: + - XSRF-TOKEN=e8cf384b-ef1a-4adb-bcae-fa0a40aed48a; Path=/flowable-work + Transfer-Encoding: + - chunked + Vary: + - origin,access-control-request-method,access-control-request-headers,accept-encoding + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-XSS-Protection: + - '0' + content-length: + - '766' + status: + code: 200 + message: '' +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Basic YWRtaW46dGVzdA== + Connection: + - keep-alive + User-Agent: + - python-requests/2.32.3 + method: GET + uri: http://localhost:8090/flowable-work/external-job-api/jobs/JOB-b66d5809-7fd7-11ef-b484-768b56d159b1?i=0 + response: + body: + string: '{"id":"JOB-b66d5809-7fd7-11ef-b484-768b56d159b1","url":"http://localhost:8090/flowable-work/external-job-api/jobs/JOB-b66d5809-7fd7-11ef-b484-768b56d159b1","correlationId":"b66d5808-7fd7-11ef-b484-768b56d159b1","processInstanceId":"PRC-b669fc9d-7fd7-11ef-b484-768b56d159b1","processDefinitionId":"PRC-robocorpExample:10:b6399dcb-7fd7-11ef-b484-768b56d159b1","executionId":"PRC-b66a71d2-7fd7-11ef-b484-768b56d159b1","scopeId":null,"subScopeId":null,"scopeDefinitionId":null,"scopeType":null,"elementId":"bpmnTask_1","elementName":"Get + Weather Forecast","retries":3,"exceptionMessage":null,"dueDate":null,"createTime":"2024-10-01T09:29:52.709Z","tenantId":"","lockOwner":null,"lockExpirationTime":null}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Type: + - application/json;charset=UTF-8 + Date: + - Tue, 01 Oct 2024 09:29:53 GMT + Expires: + - '0' + Keep-Alive: + - timeout=60 + Pragma: + - no-cache + Set-Cookie: + - XSRF-TOKEN=442081ff-4c73-4b8e-a4a2-f0265f4fde8a; Path=/flowable-work + Transfer-Encoding: + - chunked + Vary: + - origin,access-control-request-method,access-control-request-headers,accept-encoding + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-XSS-Protection: + - '0' + content-length: + - '700' + status: + code: 200 + message: '' +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Basic YWRtaW46dGVzdA== + Connection: + - keep-alive + User-Agent: + - python-requests/2.32.3 + method: GET + uri: http://localhost:8090/flowable-work/external-job-api/jobs/JOB-b66d5809-7fd7-11ef-b484-768b56d159b1?i=1 + response: + body: + string: '{"id":"JOB-b66d5809-7fd7-11ef-b484-768b56d159b1","url":"http://localhost:8090/flowable-work/external-job-api/jobs/JOB-b66d5809-7fd7-11ef-b484-768b56d159b1","correlationId":"b66d5808-7fd7-11ef-b484-768b56d159b1","processInstanceId":"PRC-b669fc9d-7fd7-11ef-b484-768b56d159b1","processDefinitionId":"PRC-robocorpExample:10:b6399dcb-7fd7-11ef-b484-768b56d159b1","executionId":"PRC-b66a71d2-7fd7-11ef-b484-768b56d159b1","scopeId":null,"subScopeId":null,"scopeDefinitionId":null,"scopeType":null,"elementId":"bpmnTask_1","elementName":"Get + Weather Forecast","retries":3,"exceptionMessage":null,"dueDate":null,"createTime":"2024-10-01T09:29:52.709Z","tenantId":"","lockOwner":"lelia.local-47149","lockExpirationTime":"2024-10-01T09:30:53.302Z"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Type: + - application/json;charset=UTF-8 + Date: + - Tue, 01 Oct 2024 09:29:53 GMT + Expires: + - '0' + Keep-Alive: + - timeout=60 + Pragma: + - no-cache + Set-Cookie: + - XSRF-TOKEN=96ace30d-0efa-4679-ab83-401961399af7; Path=/flowable-work + Transfer-Encoding: + - chunked + Vary: + - origin,access-control-request-method,access-control-request-headers,accept-encoding + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-XSS-Protection: + - '0' + content-length: + - '737' + status: + code: 200 + message: '' +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Basic YWRtaW46dGVzdA== + Connection: + - keep-alive + User-Agent: + - python-requests/2.32.3 + method: GET + uri: http://localhost:8090/flowable-work/external-job-api/jobs/JOB-b66d5809-7fd7-11ef-b484-768b56d159b1?i=2 + response: + body: + string: '{"id":"JOB-b66d5809-7fd7-11ef-b484-768b56d159b1","url":"http://localhost:8090/flowable-work/external-job-api/jobs/JOB-b66d5809-7fd7-11ef-b484-768b56d159b1","correlationId":"b66d5808-7fd7-11ef-b484-768b56d159b1","processInstanceId":"PRC-b669fc9d-7fd7-11ef-b484-768b56d159b1","processDefinitionId":"PRC-robocorpExample:10:b6399dcb-7fd7-11ef-b484-768b56d159b1","executionId":"PRC-b66a71d2-7fd7-11ef-b484-768b56d159b1","scopeId":null,"subScopeId":null,"scopeDefinitionId":null,"scopeType":null,"elementId":"bpmnTask_1","elementName":"Get + Weather Forecast","retries":3,"exceptionMessage":null,"dueDate":null,"createTime":"2024-10-01T09:29:52.709Z","tenantId":"","lockOwner":"lelia.local-47149","lockExpirationTime":"2024-10-01T09:30:53.302Z"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Type: + - application/json;charset=UTF-8 + Date: + - Tue, 01 Oct 2024 09:29:53 GMT + Expires: + - '0' + Keep-Alive: + - timeout=60 + Pragma: + - no-cache + Set-Cookie: + - XSRF-TOKEN=eddff1a8-83e4-499f-94ca-aaa88137ec8f; Path=/flowable-work + Transfer-Encoding: + - chunked + Vary: + - origin,access-control-request-method,access-control-request-headers,accept-encoding + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-XSS-Protection: + - '0' + content-length: + - '737' + status: + code: 200 + message: '' +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Basic YWRtaW46dGVzdA== + Connection: + - keep-alive + User-Agent: + - python-requests/2.32.3 + method: GET + uri: http://localhost:8090/flowable-work/external-job-api/jobs/JOB-b66d5809-7fd7-11ef-b484-768b56d159b1?i=3 + response: + body: + string: '{"id":"JOB-b66d5809-7fd7-11ef-b484-768b56d159b1","url":"http://localhost:8090/flowable-work/external-job-api/jobs/JOB-b66d5809-7fd7-11ef-b484-768b56d159b1","correlationId":"b66d5808-7fd7-11ef-b484-768b56d159b1","processInstanceId":"PRC-b669fc9d-7fd7-11ef-b484-768b56d159b1","processDefinitionId":"PRC-robocorpExample:10:b6399dcb-7fd7-11ef-b484-768b56d159b1","executionId":"PRC-b66a71d2-7fd7-11ef-b484-768b56d159b1","scopeId":null,"subScopeId":null,"scopeDefinitionId":null,"scopeType":null,"elementId":"bpmnTask_1","elementName":"Get + Weather Forecast","retries":3,"exceptionMessage":null,"dueDate":null,"createTime":"2024-10-01T09:29:52.709Z","tenantId":"","lockOwner":"lelia.local-47149","lockExpirationTime":"2024-10-01T09:30:53.302Z"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Type: + - application/json;charset=UTF-8 + Date: + - Tue, 01 Oct 2024 09:29:54 GMT + Expires: + - '0' + Keep-Alive: + - timeout=60 + Pragma: + - no-cache + Set-Cookie: + - XSRF-TOKEN=d3b98fc6-9f60-4c54-9aa7-5df07ff01ade; Path=/flowable-work + Transfer-Encoding: + - chunked + Vary: + - origin,access-control-request-method,access-control-request-headers,accept-encoding + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-XSS-Protection: + - '0' + content-length: + - '737' + status: + code: 200 + message: '' +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Basic YWRtaW46dGVzdA== + Connection: + - keep-alive + User-Agent: + - python-requests/2.32.3 + method: GET + uri: http://localhost:8090/flowable-work/external-job-api/jobs/JOB-b66d5809-7fd7-11ef-b484-768b56d159b1?i=4 + response: + body: + string: '{"message":"Not found","exception":"Could not find external worker + job with id ''JOB-b66d5809-7fd7-11ef-b484-768b56d159b1''."}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Type: + - application/json;charset=UTF-8 + Date: + - Tue, 01 Oct 2024 09:29:54 GMT + Expires: + - '0' + Keep-Alive: + - timeout=60 + Pragma: + - no-cache + Set-Cookie: + - XSRF-TOKEN=f859d5d9-5b8d-4d16-9e70-f16d38c67574; Path=/flowable-work + Transfer-Encoding: + - chunked + Vary: + - origin,access-control-request-method,access-control-request-headers,accept-encoding + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-XSS-Protection: + - '0' + content-length: + - '124' + status: + code: 404 + message: '' +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Basic YWRtaW46dGVzdA== + Connection: + - keep-alive + User-Agent: + - python-requests/2.32.3 + method: GET + uri: http://localhost:8090/flowable-work/process-api/history/historic-variable-instances?processInstanceId=PRC-b669fc9d-7fd7-11ef-b484-768b56d159b1&variableName=temperature + response: + body: + string: '{"data":[{"id":"VAR-b754aacd-7fd7-11ef-b484-768b56d159b1","processInstanceId":"PRC-b669fc9d-7fd7-11ef-b484-768b56d159b1","processInstanceUrl":"http://localhost:8090/flowable-work/process-api/history/historic-process-instances/PRC-b669fc9d-7fd7-11ef-b484-768b56d159b1","taskId":null,"executionId":"PRC-b669fc9d-7fd7-11ef-b484-768b56d159b1","variable":{"name":"temperature","type":"integer","value":18,"scope":"global"}}],"total":1,"start":0,"sort":"variableName","order":"asc","size":1}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Type: + - application/json;charset=UTF-8 + Date: + - Tue, 01 Oct 2024 09:29:54 GMT + Expires: + - '0' + Keep-Alive: + - timeout=60 + Pragma: + - no-cache + Set-Cookie: + - XSRF-TOKEN=aca3f907-ff15-471b-90d6-48e4c307172f; Path=/flowable-work + Transfer-Encoding: + - chunked + Vary: + - origin,access-control-request-method,access-control-request-headers,accept-encoding + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-XSS-Protection: + - '0' + content-length: + - '485' + status: + code: 200 + message: '' +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Basic YWRtaW46dGVzdA== + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python-requests/2.32.3 + method: DELETE + uri: http://localhost:8090/flowable-work/process-api/runtime/process-instances/PRC-b669fc9d-7fd7-11ef-b484-768b56d159b1 + response: + body: + string: '{"message":"Not found","exception":"Could not find a process instance + with id ''PRC-b669fc9d-7fd7-11ef-b484-768b56d159b1''."}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Type: + - application/json;charset=UTF-8 + Date: + - Tue, 01 Oct 2024 09:29:54 GMT + Expires: + - '0' + Keep-Alive: + - timeout=60 + Pragma: + - no-cache + Set-Cookie: + - XSRF-TOKEN=21dffd06-24de-469e-8bf9-36c7b9af040f; Path=/flowable-work + Transfer-Encoding: + - chunked + Vary: + - origin,access-control-request-method,access-control-request-headers,accept-encoding + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-XSS-Protection: + - '0' + content-length: + - '123' + status: + code: 404 + message: '' +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Basic YWRtaW46dGVzdA== + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python-requests/2.32.3 + method: DELETE + uri: http://localhost:8090/flowable-work/process-api/repository/deployments/PRC-b6366979-7fd7-11ef-b484-768b56d159b1 + response: + body: + string: '' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Date: + - Tue, 01 Oct 2024 09:29:54 GMT + Expires: + - '0' + Keep-Alive: + - timeout=60 + Pragma: + - no-cache + Set-Cookie: + - XSRF-TOKEN=f95f3ece-63d2-4caf-ba27-01fe5e228524; Path=/flowable-work + Vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-XSS-Protection: + - '0' + status: + code: 204 + message: '' +version: 1 diff --git a/robocorp/tests/fixtures/processes/robocorpExample.bpmn b/rpaframework/tests/fixtures/processes/robocorpExample.bpmn similarity index 97% rename from robocorp/tests/fixtures/processes/robocorpExample.bpmn rename to rpaframework/tests/fixtures/processes/robocorpExample.bpmn index b9d47e1..9d73632 100644 --- a/robocorp/tests/fixtures/processes/robocorpExample.bpmn +++ b/rpaframework/tests/fixtures/processes/robocorpExample.bpmn @@ -10,7 +10,7 @@ - + diff --git a/robocorp/tests/robocorp_action_weather.py b/rpaframework/tests/robocorp_action_weather.py similarity index 100% rename from robocorp/tests/robocorp_action_weather.py rename to rpaframework/tests/robocorp_action_weather.py diff --git a/rpaframework/tests/rpaframework_weather.robot b/rpaframework/tests/rpaframework_weather.robot new file mode 100644 index 0000000..6fa5177 --- /dev/null +++ b/rpaframework/tests/rpaframework_weather.robot @@ -0,0 +1,10 @@ +*** Settings *** +Library flowable.rpaframework_client.API + +*** Tasks *** +Get weather forecast + ${city}= flw input city + ${days}= flw input days + ${length}= Get Length ${city} + ${temperature}= Evaluate ${days} * ${length} + flw output temperature ${temperature} \ No newline at end of file diff --git a/robocorp/tests/test_robocorp_client.py b/rpaframework/tests/test_rpaframework_client.py similarity index 67% rename from robocorp/tests/test_robocorp_client.py rename to rpaframework/tests/test_rpaframework_client.py index 0a95ca1..a8436a7 100644 --- a/robocorp/tests/test_robocorp_client.py +++ b/rpaframework/tests/test_rpaframework_client.py @@ -14,20 +14,37 @@ class TestRestClient(BasicTest): @my_vcr.use_cassette def test_with_custom_action(self): + self.run_test( + [sys.executable, "-m", 'flowable.rpaframework_client', + '--flowable-host', base_url, + '--flowable-username', auth.username, + '--flowable-password', auth.password, + '--mode', 'action', + 'myTopic', + os.path.join(os.path.dirname(os.path.abspath(__file__)), 'robocorp_action_weather.py') + ] + ) + + @my_vcr.use_cassette + def test_with_robot(self): + self.run_test( + [sys.executable, "-m", 'flowable.rpaframework_client', + '--flowable-host', base_url, + '--flowable-username', auth.username, + '--flowable-password', auth.password, + 'myTopic', + os.path.join(os.path.dirname(os.path.abspath(__file__)), 'rpaframework_weather.robot') + ] + ) + + def run_test(self, call_args): self.deploy_process('robocorpExample.bpmn') process_instance_id = start_process(base_url, auth, self._process_definition_id, [ {'name': 'city', 'type': 'string', 'value': 'Zurich'}, {'name': 'days', 'type': 'integer', 'value': 3} ]) try: - call_args = [sys.executable, "-m", 'flowable.robocorp_client', - '--flowable-host', base_url, - '--flowable-username', auth.username, - '--flowable-password', auth.password, - 'myTopic', - 'action', - os.path.join(os.path.dirname(os.path.abspath(__file__)), 'robocorp_action_weather.py') - ] + print(" ".join(call_args)) r = requests.get(base_url + '/external-job-api/jobs?processInstanceId=' + process_instance_id, auth=auth) diff --git a/robocorp/tests/vcr.py b/rpaframework/tests/vcr.py similarity index 100% rename from robocorp/tests/vcr.py rename to rpaframework/tests/vcr.py From 1a6d793fc103b85845855a3c8248e5d04b703f9f Mon Sep 17 00:00:00 2001 From: Valentin Zickner Date: Tue, 1 Oct 2024 12:09:18 +0200 Subject: [PATCH 2/2] fix tests with rpaframework by downgrading python --- .github/workflows/main.yml | 2 +- .github/workflows/test-release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eeaa9f5..ee7f535 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.12.0"] + python-version: ["3.11.0"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 5e2ffb2..4bbfa7b 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -3,7 +3,7 @@ name: Publish Package to Test PyPi on: create: tags: - - v* + - 'v*' jobs: build-external-worker-client: