%global _empty_manifest_terminate_build 0 Name: python-reportportal-behave-client Version: 1.1.1 Release: 1 Summary: ReportPortal integration client lib License: MIT URL: https://github.com/Adrian-Tamas/reportportal-behave-integration-client-lib Source0: https://mirrors.nju.edu.cn/pypi/web/packages/2b/94/2a06ccbe99324fccb488ff07f67e2e00d66c07ae9111829e73934be43c4a/reportportal-behave-client-1.1.1.tar.gz BuildArch: noarch Requires: python3-mss Requires: python3-behave Requires: python3-reportportal-client %description # Description This library is Report Portal connector that allows you to integrate Report Portal with your Python Behave BDD testing framework Your automation framework will run just as it does now unless you choose to run with Report Portal Integration The library was updated to work with Report Portal API v5+ and the reportportal-client lib v5 # Installation ## Manual 1. Clone the repository 2. Enter the folder and run `pip install .` ## Using pip and pypi.org ```bash pip install reportportal-behave-client ``` **NOTE: Use version >= 1.0.3 for ReportPortal v5** # Sending reports to Report Portal In order to enable the Report Portal Integration add the `-D rp_enable=True`: ```bash behave -D rp_enable=True ``` For step based reporting you need to also add the step based flag `-D step_based=True`: ```bash behave -D rp_enable=True -D step_based=True ``` # Integrating the lib in your framework In your environments.py file add the service in each method. For e.g.: ```python def before_all(context): tags = ', '.join([tag for tags in context.config.tags.ands for tag in tags]) attributes = { # Used to label launches in Report Portal "environment": context.config.userdata.get('environment', "staging"), "version": context.config.userdata.get('version', "unknown"), } rp_enable = context.config.userdata.getbool('rp_enable', False) step_based = context.config.userdata.getbool('step_based', True) context.requested_browser = context.config.userdata.get('browser', "chrome") rp_token = os.environ.get("RP_TOKEN") add_screenshot = context.config.userdata.getbool('add_screenshot', False) launch_name = f"Execution using tags: {tags}" launch_description = f"BDD Tests for: {tags}" context.behave_integration_service = BehaveIntegrationService(rp_endpoint=rp_endpoint, rp_project=rp_project, rp_token=rp_token, rp_launch_name=launch_name, rp_launch_description=launch_description, rp_enable=rp_enable, step_based=step_based, add_screenshot=add_screenshot, verify_ssl=False) context.launch_id = context.behave_integration_service.launch_service(attributes=attributes, tags=tags) def before_feature(context, feature): context.feature_id = context.behave_integration_service.before_feature(feature) def before_scenario(context, scenario): context.scenario_id = context.behave_integration_service.before_scenario(scenario, feature_id=context.feature_id) def before_step(context, step): context.step_id = context.behave_integration_service.before_step(step, scenario_id=context.scenario_id) def after_step(context, step): context.behave_integration_service.after_step(step, context.step_id) def after_scenario(context, scenario): context.behave_integration_service.after_scenario(scenario, context.scenario_id) def after_feature(context, feature): context.behave_integration_service.after_feature(feature, context.feature_id) def after_all(context): context.behave_integration_service.after_all(context.launch_id) ``` %package -n python3-reportportal-behave-client Summary: ReportPortal integration client lib Provides: python-reportportal-behave-client BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-reportportal-behave-client # Description This library is Report Portal connector that allows you to integrate Report Portal with your Python Behave BDD testing framework Your automation framework will run just as it does now unless you choose to run with Report Portal Integration The library was updated to work with Report Portal API v5+ and the reportportal-client lib v5 # Installation ## Manual 1. Clone the repository 2. Enter the folder and run `pip install .` ## Using pip and pypi.org ```bash pip install reportportal-behave-client ``` **NOTE: Use version >= 1.0.3 for ReportPortal v5** # Sending reports to Report Portal In order to enable the Report Portal Integration add the `-D rp_enable=True`: ```bash behave -D rp_enable=True ``` For step based reporting you need to also add the step based flag `-D step_based=True`: ```bash behave -D rp_enable=True -D step_based=True ``` # Integrating the lib in your framework In your environments.py file add the service in each method. For e.g.: ```python def before_all(context): tags = ', '.join([tag for tags in context.config.tags.ands for tag in tags]) attributes = { # Used to label launches in Report Portal "environment": context.config.userdata.get('environment', "staging"), "version": context.config.userdata.get('version', "unknown"), } rp_enable = context.config.userdata.getbool('rp_enable', False) step_based = context.config.userdata.getbool('step_based', True) context.requested_browser = context.config.userdata.get('browser', "chrome") rp_token = os.environ.get("RP_TOKEN") add_screenshot = context.config.userdata.getbool('add_screenshot', False) launch_name = f"Execution using tags: {tags}" launch_description = f"BDD Tests for: {tags}" context.behave_integration_service = BehaveIntegrationService(rp_endpoint=rp_endpoint, rp_project=rp_project, rp_token=rp_token, rp_launch_name=launch_name, rp_launch_description=launch_description, rp_enable=rp_enable, step_based=step_based, add_screenshot=add_screenshot, verify_ssl=False) context.launch_id = context.behave_integration_service.launch_service(attributes=attributes, tags=tags) def before_feature(context, feature): context.feature_id = context.behave_integration_service.before_feature(feature) def before_scenario(context, scenario): context.scenario_id = context.behave_integration_service.before_scenario(scenario, feature_id=context.feature_id) def before_step(context, step): context.step_id = context.behave_integration_service.before_step(step, scenario_id=context.scenario_id) def after_step(context, step): context.behave_integration_service.after_step(step, context.step_id) def after_scenario(context, scenario): context.behave_integration_service.after_scenario(scenario, context.scenario_id) def after_feature(context, feature): context.behave_integration_service.after_feature(feature, context.feature_id) def after_all(context): context.behave_integration_service.after_all(context.launch_id) ``` %package help Summary: Development documents and examples for reportportal-behave-client Provides: python3-reportportal-behave-client-doc %description help # Description This library is Report Portal connector that allows you to integrate Report Portal with your Python Behave BDD testing framework Your automation framework will run just as it does now unless you choose to run with Report Portal Integration The library was updated to work with Report Portal API v5+ and the reportportal-client lib v5 # Installation ## Manual 1. Clone the repository 2. Enter the folder and run `pip install .` ## Using pip and pypi.org ```bash pip install reportportal-behave-client ``` **NOTE: Use version >= 1.0.3 for ReportPortal v5** # Sending reports to Report Portal In order to enable the Report Portal Integration add the `-D rp_enable=True`: ```bash behave -D rp_enable=True ``` For step based reporting you need to also add the step based flag `-D step_based=True`: ```bash behave -D rp_enable=True -D step_based=True ``` # Integrating the lib in your framework In your environments.py file add the service in each method. For e.g.: ```python def before_all(context): tags = ', '.join([tag for tags in context.config.tags.ands for tag in tags]) attributes = { # Used to label launches in Report Portal "environment": context.config.userdata.get('environment', "staging"), "version": context.config.userdata.get('version', "unknown"), } rp_enable = context.config.userdata.getbool('rp_enable', False) step_based = context.config.userdata.getbool('step_based', True) context.requested_browser = context.config.userdata.get('browser', "chrome") rp_token = os.environ.get("RP_TOKEN") add_screenshot = context.config.userdata.getbool('add_screenshot', False) launch_name = f"Execution using tags: {tags}" launch_description = f"BDD Tests for: {tags}" context.behave_integration_service = BehaveIntegrationService(rp_endpoint=rp_endpoint, rp_project=rp_project, rp_token=rp_token, rp_launch_name=launch_name, rp_launch_description=launch_description, rp_enable=rp_enable, step_based=step_based, add_screenshot=add_screenshot, verify_ssl=False) context.launch_id = context.behave_integration_service.launch_service(attributes=attributes, tags=tags) def before_feature(context, feature): context.feature_id = context.behave_integration_service.before_feature(feature) def before_scenario(context, scenario): context.scenario_id = context.behave_integration_service.before_scenario(scenario, feature_id=context.feature_id) def before_step(context, step): context.step_id = context.behave_integration_service.before_step(step, scenario_id=context.scenario_id) def after_step(context, step): context.behave_integration_service.after_step(step, context.step_id) def after_scenario(context, scenario): context.behave_integration_service.after_scenario(scenario, context.scenario_id) def after_feature(context, feature): context.behave_integration_service.after_feature(feature, context.feature_id) def after_all(context): context.behave_integration_service.after_all(context.launch_id) ``` %prep %autosetup -n reportportal-behave-client-1.1.1 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-reportportal-behave-client -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Tue May 30 2023 Python_Bot - 1.1.1-1 - Package Spec generated