ctripcorp / flybirds

基于自然语言的,跨端跨框架 BDD UI 自动化测试方案,BDD testing, Python style, Present by Trip Flight
https://ctripcorp.github.io/flybirds/
MIT License
849 stars 99 forks source link

flybirds create flybirds run -P features/test/web #34

Closed shopconan closed 2 years ago

shopconan commented 2 years ago

问题描述 / Describe the bug A clear and concise description of what the bug is.

问题复现步骤 / To Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

预期结果 / Expected behavior A clear and concise description of what you expected to happen.

截图 / Screenshots If applicable, add screenshots to help explain your problem.

环境信息 / Environment (please complete the following information):

Additional context Add any other context about the problem here.

我先执行了 $ flybirds run -P features/test/android 由于我模拟器没配置好,提示有问题, 我想直接试下web好了 先playwright install了各种浏览器

$ flybirds run -P features/test/web
2022-05-22 00:10:00,501 - flybirds_log - INFO - flybirds cmd info: features/test/web None --format=json report\24663315-63d7-40da-b16a-c309866701d0\report.json () True None True local
2022-05-22 00:10:00,502 - flybirds_log - INFO - report path: -o report\24663315-63d7-40da-b16a-c309866701d0\report.json
2022-05-22 00:10:00,504 - flybirds_log - INFO - screenshot path: report\24663315-63d7-40da-b16a-c309866701d0\screenshot
2022-05-22 00:10:00,504 - flybirds_log - INFO - the assembled behave execution command: behave features/test/web --format=json -o report\24663315-63d7-40da-b16a-c309866701d0\report.json --define screenShotDir=cmVwb3J0XDI0NjYzMzE1LTYzZDctNDBkYS1iMTZhLWMzMDk4NjY3MDFkMFxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr  
2022-05-22 00:10:00,504 - flybirds_log - INFO - ============last run_args: {'cmd_str': 'behave features/test/web --format=json -o report\\24663315-63d7-40da-b16a-c309866701d0\\report.json --define screenShotDir=cmVwb3J0XDI0NjYzMzE1LTYzZDctNDBkYS1iMTZhLWMzMDk4NjY3MDFkMFxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr', 'need_rerun': True, 'report_dir_path': 'report\\24663315-63d7-40da-b16a-c309866701d0', 'use_define': ['--define', 'screenShotDir=cmVwb3J0XDI0NjYzMzE1LTYzZDctNDBkYS1iMTZhLWMzMDk4NjY3MDFkMFxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw='], 'env_config': None, 'report_format': '--format=json', 'html': True, 'run_at': 'local', 'processes': 4, 'feature_path': 'features/test/web', 'parsed_tags': []}
2022-05-22 00:10:00,505 - flybirds_log - INFO - received run_args: {'cmd_str': 'behave features/test/web --format=json -o report\\24663315-63d7-40da-b16a-c309866701d0\\report.json --define screenShotDir=cmVwb3J0XDI0NjYzMzE1LTYzZDctNDBkYS1iMTZhLWMzMDk4NjY3MDFkMFxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr', 'need_rerun': True, 'report_dir_path': 'report\\24663315-63d7-40da-b16a-c309866701d0', 'use_define': ['--define', 'screenShotDir=cmVwb3J0XDI0NjYzMzE1LTYzZDctNDBkYS1iMTZhLWMzMDk4NjY3MDFkMFxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw='], 'env_config': None, 'report_format': '--format=json', 'html': True, 'run_at': 'local', 'processes': 4, 'feature_path': 'features/test/web', 'parsed_tags': []}
2022-05-22 00:10:00,514 - flybirds_log - INFO - find extend pkg
2022-05-22 00:10:00,549 - flybirds_log - INFO - use_define: ['--define', 'screenShotDir=cmVwb3J0XDI0NjYzMzE1LTYzZDctNDBkYS1iMTZhLWMzMDk4NjY3MDFkMFxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw=']
2022-05-22 00:10:00,931 - flybirds_log - INFO - change behave json format feature to flybirds feature
2022-05-22 00:10:00,932 - flybirds_log - INFO - change behave add_step_definition to flybirds add_step_definition
2022-05-22 00:10:00,979 - flybirds_log - INFO - [before_all_hook] user_data:{'screenShotDir': 'cmVwb3J0XDI0NjYzMzE1LTYzZDctNDBkYS1iMTZhLWMzMDk4NjY3MDFkMFxzY3JlZW5zaG90', 'run_at': 'bG9jYWw='}
2022-05-22 00:10:00,980 - flybirds_log - INFO - [loader] user_data: {'screenShotDir': 'report\\24663315-63d7-40da-b16a-c309866701d0\\screenshot', 'run_at': 'local'}
2022-05-22 00:10:00,981 - flybirds_log - INFO - [loader] run platform: android
2022-05-22 00:10:01,336 - flybirds_log - INFO - start on before hook
2022-05-22 00:10:01,337 - flybirds_log - INFO - [event config] user_data: {'screenShotDir': 'report\\24663315-63d7-40da-b16a-c309866701d0\\screenshot', 'run_at': 'local'}      
2022-05-22 00:10:01,337 - flybirds_log - INFO - user data,count:2
2022-05-22 00:10:01,338 - flybirds_log - INFO - run_config
2022-05-22 00:10:01,338 - flybirds_log - INFO - {'is_rerun': False, 'run_at': 'local'}  
2022-05-22 00:10:01,339 - flybirds_log - INFO - Logging configuration information       
2022-05-22 00:10:01,339 - flybirds_log - INFO - {'level': 'info'}
2022-05-22 00:10:01,340 - flybirds_log - INFO - APP configuration information
2022-05-22 00:10:01,340 - flybirds_log - INFO - {'package_name': 'ctrip.android.view', 'unique_tag': '', 'default_user': None, 'default_password': None, 'user_group': 1, 'package_path': 'https://download2.ctrip.com/html5/Ctrip_V8.43.0_SIT4-100053_Product_9725895.apk', 'overwrite_installation': False, 'run_id': None, 'build_id': None, 'pkg_version': None}
2022-05-22 00:10:01,341 - flybirds_log - INFO - Device configuration information        
2022-05-22 00:10:01,341 - flybirds_log - INFO - {'device_id': '127.0.0.1:62001', 'platform': 'android', 'web_driver_agent': 'com.fd.test.WebDriverAgentLib.xctrunner', 'screen_size': None}
2022-05-22 00:10:01,342 - flybirds_log - INFO - Web configuration information
2022-05-22 00:10:01,343 - flybirds_log - INFO - {'headless': False, 'browser_type': ['chromium'], 'default_time_out': 30}
2022-05-22 00:10:01,343 - flybirds_log - INFO - Frame parameter configuration information
2022-05-22 00:10:01,344 - flybirds_log - INFO - {'wait_ele_timeout': 35, 'wait_ele_disappear': 10, 'click_verify_timeout': 15, 'use_swipe_duration': False, 'swipe_duration': 6, 'use_poco_input': True, 'after_input_wait': 1, 'use_search_swipe_duration': False, 'search_swipe_duration': 1, 'swipe_search_count': 5, 'swipe_search_distance': 0.3, 'page_render_timeout': 65, 'app_start_time': 6, 'swipe_ready_time': 3, 'verify_pos_not_change_count': 5, 'screen_record_time': 90, 'use_snap': True, 'use_airtest_record': False}        
2022-05-22 00:10:01,345 - flybirds_log - INFO - Test report configuration information   
2022-05-22 00:10:01,345 - flybirds_log - INFO - {'screen_shot_dir': 'report\\24663315-63d7-40da-b16a-c309866701d0\\screenshot'}
2022-05-22 00:10:01,345 - flybirds_log - INFO - Process control configuration information
2022-05-22 00:10:01,345 - flybirds_log - INFO - {'before_run_page': 'restartApp', 'scenario_fail_page': 'restartApp', 'scenario_success_page': 'None', 'before_run_login': False, 'fail_screen_record': True, 'scenario_screen_record_time': 120, 'fail_rerun': False, 'max_fail_rerun_count': 1.0, 'max_retry_count': 1}
2022-05-22 00:10:01,347 - flybirds_log - INFO - configuration file read completed       
2022-05-22 00:10:01,348 - flybirds_log - INFO - Logging configuration information       
2022-05-22 00:10:01,348 - flybirds_log - INFO - {'level': 'info'}
2022-05-22 00:10:01,353 - flybirds_log - INFO - the python script in the project is read

2022-05-22 00:10:01,353 - flybirds_log - INFO - [active_before_all] user_data:{'screenShotDir': 'report\\24663315-63d7-40da-b16a-c309866701d0\\screenshot', 'run_at': 'local'}  
2022-05-22 00:10:01,353 - flybirds_log - INFO - default_active_tag_provider :android chromium
2022-05-22 00:10:01,354 - flybirds_log - INFO - [active_before_all] active_tag_provider:{'python2': 'false', 'python3': 'true', 'os': 'win32', 'platform': 'android', 'deviceType': 'ivd', 'cur_browser': 'chromium'}
2022-05-22 00:10:01,354 - flybirds_log - INFO - device prepare
2022-05-22 00:10:01,354 - flybirds_log - INFO - device_id information:127.0.0.1:62001   
[00:10:01][DEBUG]<airtest.core.android.adb> D:\Programs\anaconda\envs\dev\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s 127.0.0.1:62001 get-state        
[00:10:01][DEBUG]<airtest.core.android.adb> D:\Programs\anaconda\envs\dev\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s 127.0.0.1:62001 wait-for-device  
[00:10:01][DEBUG]<airtest.core.android.adb> D:\Programs\anaconda\envs\dev\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s 127.0.0.1:62001 shell getprop ro.build.version.sdk
2022-05-22 00:10:01,500 - flybirds_log - INFO - device connect info:<airtest.core.android.android.Android object at 0x0000024BA01731F0>
2022-05-22 00:10:01,501 - flybirds_log - INFO - initialize the device complete:127.0.0.1:62001
[00:10:01][DEBUG]<airtest.core.android.adb> D:\Programs\anaconda\envs\dev\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s 127.0.0.1:62001 shell pm list packages
2022-05-22 00:10:02,016 - flybirds_log - INFO - install app start, path:D:\Download\audio-visual\saas\data\indiehackerebooks\indie\download\installer.apk
[00:10:02][DEBUG]<airtest.core.android.adb> D:\Programs\anaconda\envs\dev\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s 127.0.0.1:62001 install D:\Download\audio-visual\saas\data\indiehackerebooks\indie\download\installer.apk
2022-05-22 00:10:09,021 - flybirds_log - INFO - fail to install app
HOOK-ERROR in before_all: Exception: Traceback (most recent call last):
  File "D:\Programs\anaconda\envs\dev\lib\site-packages\flybirds\core\plugin/event\app_prepare.py", line 102, in run
    app.install_app(installer)
  File "D:\Programs\anaconda\envs\dev\lib\site-packages\flybirds\core\driver\app.py", line 43, in install_app
    return g_context.app.install_app(package_path, wait_time)
  File "D:\Programs\anaconda\envs\dev\lib\site-packages\flybirds\core\plugin\plugins/default/android\app.py", line 40, in install_app
    i_result = install(package_path)
  File "D:\Programs\anaconda\envs\dev\lib\site-packages\airtest\utils\logwraper.py", line 90, in wrapper
    res = f(*args, **kwargs)
  File "D:\Programs\anaconda\envs\dev\lib\site-packages\airtest\core\api.py", line 229, in install
    return G.DEVICE.install_app(filepath, **kwargs)
  File "D:\Programs\anaconda\envs\dev\lib\site-packages\airtest\core\android\android.py", line 363, in install_app
    return self.adb.install_app(filepath, replace=replace, install_options=install_options)
  File "D:\Programs\anaconda\envs\dev\lib\site-packages\airtest\core\android\adb.py", line 584, in install_app
    out = self.cmd(cmds)
  File "D:\Programs\anaconda\envs\dev\lib\site-packages\airtest\core\android\adb.py", line 197, in cmd
    raise AdbError(stdout, stderr)
airtest.core.error.AdbError: stdout[] stderr[adb: failed to install D:\Download\audio-visual\saas\data\indiehackerebooks\indie\download\installer.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]
]

ABORTED: By user.
0 features passed, 0 failed, 0 skipped, 16 untested
0 scenarios passed, 0 failed, 0 skipped, 30 untested
0 steps passed, 0 failed, 0 skipped, 0 undefined, 132 untested
Took 0m0.000s
2022-05-22 00:10:09,104 - flybirds_log - INFO - Feature sum_count rerun after creation failure <= 0 or fail_count <= 0
2022-05-22 00:10:09,104 - flybirds_log - INFO - True
2022-05-22 00:10:09,110 - flybirds_log - INFO - Do you need to rerun the task: False, the failed retry task was not executed
2022-05-22 00:10:09,110 - flybirds_log - INFO - Start processing the json report. report_dir_path: [report\24663315-63d7-40da-b16a-c309866701d0],rerun_report_dir_path:[None]   
2022-05-22 00:10:09,112 - flybirds_log - INFO - start generate report
2022-05-22 00:10:09,112 - flybirds_log - INFO - report cmd:node D:\Programs\anaconda\envs\dev\lib\site-packages\flybirds\report\node_report\report.js report\24663315-63d7-40da-b16a-c309866701d0 report\24663315-63d7-40da-b16a-c309866701d0 android
multiple-cucumber-html-reporter platform: android
xiaoxiaocaiiao commented 2 years ago

看日志运行的是android不是web 如果要运行web 请将平台配置成web

发自我的iPhone

------------------ Original ------------------ From: HeisenBerg? @.> Date: Sun,May 22,2022 0:13 AM To: ctripcorp/flybirds @.> Cc: Subscribed @.***> Subject: Re: [ctripcorp/flybirds] flybirds create flybirds run -Pfeatures/test/web (Issue #34)

问题描述 / Describe the bug A clear and concise description of what the bug is.

问题复现步骤 / To Reproduce

Go to '...'

Click on '....'

Scroll down to '....'

See error

预期结果 / Expected behavior A clear and concise description of what you expected to happen.

截图 / Screenshots If applicable, add screenshots to help explain your problem.

环境信息 / Environment (please complete the following information):

Device: [e.g. iPhone6]

OS: [e.g. iOS8.1]

Browser [e.g. stock browser, safari]

Version [e.g. 22]

Additional context Add any other context about the problem here.

我先执行了 $ flybirds run -P features/test/android 由于我模拟器没配置好,提示有问题, 我想直接试下web好了 先playwright install了各种浏览器 $ flybirds run -P features/test/web 2022-05-22 00:10:00,501 - flybirds_log - INFO - flybirds cmd info: features/test/web None --format=json report\24663315-63d7-40da-b16a-c309866701d0\report.json () True None True local 2022-05-22 00:10:00,502 - flybirds_log - INFO - report path: -o report\24663315-63d7-40da-b16a-c309866701d0\report.json 2022-05-22 00:10:00,504 - flybirds_log - INFO - screenshot path: report\24663315-63d7-40da-b16a-c309866701d0\screenshot 2022-05-22 00:10:00,504 - flybirds_log - INFO - the assembled behave execution command: behave features/test/web --format=json -o report\24663315-63d7-40da-b16a-c309866701d0\report.json --define screenShotDir=cmVwb3J0XDI0NjYzMzE1LTYzZDctNDBkYS1iMTZhLWMzMDk4NjY3MDFkMFxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr 2022-05-22 00:10:00,504 - flybirds_log - INFO - ============last run_args: {'cmd_str': 'behave features/test/web --format=json -o report\24663315-63d7-40da-b16a-c309866701d0\report.json --define screenShotDir=cmVwb3J0XDI0NjYzMzE1LTYzZDctNDBkYS1iMTZhLWMzMDk4NjY3MDFkMFxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr', 'need_rerun': True, 'report_dir_path': 'report\24663315-63d7-40da-b16a-c309866701d0', 'use_define': ['--define', 'screenShotDir=cmVwb3J0XDI0NjYzMzE1LTYzZDctNDBkYS1iMTZhLWMzMDk4NjY3MDFkMFxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw='], 'env_config': None, 'report_format': '--format=json', 'html': True, 'run_at': 'local', 'processes': 4, 'feature_path': 'features/test/web', 'parsed_tags': []} 2022-05-22 00:10:00,505 - flybirds_log - INFO - received run_args: {'cmd_str': 'behave features/test/web --format=json -o report\24663315-63d7-40da-b16a-c309866701d0\report.json --define screenShotDir=cmVwb3J0XDI0NjYzMzE1LTYzZDctNDBkYS1iMTZhLWMzMDk4NjY3MDFkMFxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr', 'need_rerun': True, 'report_dir_path': 'report\24663315-63d7-40da-b16a-c309866701d0', 'use_define': ['--define', 'screenShotDir=cmVwb3J0XDI0NjYzMzE1LTYzZDctNDBkYS1iMTZhLWMzMDk4NjY3MDFkMFxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw='], 'env_config': None, 'report_format': '--format=json', 'html': True, 'run_at': 'local', 'processes': 4, 'feature_path': 'features/test/web', 'parsed_tags': []} 2022-05-22 00:10:00,514 - flybirds_log - INFO - find extend pkg 2022-05-22 00:10:00,549 - flybirds_log - INFO - use_define: ['--define', 'screenShotDir=cmVwb3J0XDI0NjYzMzE1LTYzZDctNDBkYS1iMTZhLWMzMDk4NjY3MDFkMFxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw='] 2022-05-22 00:10:00,931 - flybirds_log - INFO - change behave json format feature to flybirds feature 2022-05-22 00:10:00,932 - flybirds_log - INFO - change behave add_step_definition to flybirds add_step_definition 2022-05-22 00:10:00,979 - flybirds_log - INFO - [before_all_hook] user_data:{'screenShotDir': 'cmVwb3J0XDI0NjYzMzE1LTYzZDctNDBkYS1iMTZhLWMzMDk4NjY3MDFkMFxzY3JlZW5zaG90', 'run_at': 'bG9jYWw='} 2022-05-22 00:10:00,980 - flybirds_log - INFO - [loader] user_data: {'screenShotDir': 'report\24663315-63d7-40da-b16a-c309866701d0\screenshot', 'run_at': 'local'} 2022-05-22 00:10:00,981 - flybirds_log - INFO - [loader] run platform: android 2022-05-22 00:10:01,336 - flybirds_log - INFO - start on before hook 2022-05-22 00:10:01,337 - flybirds_log - INFO - [event config] user_data: {'screenShotDir': 'report\24663315-63d7-40da-b16a-c309866701d0\screenshot', 'run_at': 'local'} 2022-05-22 00:10:01,337 - flybirds_log - INFO - user data,count:2 2022-05-22 00:10:01,338 - flybirds_log - INFO - run_config 2022-05-22 00:10:01,338 - flybirds_log - INFO - {'is_rerun': False, 'run_at': 'local'} 2022-05-22 00:10:01,339 - flybirds_log - INFO - Logging configuration information 2022-05-22 00:10:01,339 - flybirds_log - INFO - {'level': 'info'} 2022-05-22 00:10:01,340 - flybirds_log - INFO - APP configuration information 2022-05-22 00:10:01,340 - flybirds_log - INFO - {'package_name': 'ctrip.android.view', 'unique_tag': '', 'default_user': None, 'default_password': None, 'user_group': 1, 'package_path': 'https://download2.ctrip.com/html5/Ctrip_V8.43.0_SIT4-100053_Product_9725895.apk', 'overwrite_installation': False, 'run_id': None, 'build_id': None, 'pkg_version': None} 2022-05-22 00:10:01,341 - flybirds_log - INFO - Device configuration information 2022-05-22 00:10:01,341 - flybirds_log - INFO - {'device_id': '127.0.0.1:62001', 'platform': 'android', 'web_driver_agent': 'com.fd.test.WebDriverAgentLib.xctrunner', 'screen_size': None} 2022-05-22 00:10:01,342 - flybirds_log - INFO - Web configuration information 2022-05-22 00:10:01,343 - flybirds_log - INFO - {'headless': False, 'browser_type': ['chromium'], 'default_time_out': 30} 2022-05-22 00:10:01,343 - flybirds_log - INFO - Frame parameter configuration information 2022-05-22 00:10:01,344 - flybirds_log - INFO - {'wait_ele_timeout': 35, 'wait_ele_disappear': 10, 'click_verify_timeout': 15, 'use_swipe_duration': False, 'swipe_duration': 6, 'use_poco_input': True, 'after_input_wait': 1, 'use_search_swipe_duration': False, 'search_swipe_duration': 1, 'swipe_search_count': 5, 'swipe_search_distance': 0.3, 'page_render_timeout': 65, 'app_start_time': 6, 'swipe_ready_time': 3, 'verify_pos_not_change_count': 5, 'screen_record_time': 90, 'use_snap': True, 'use_airtest_record': False} 2022-05-22 00:10:01,345 - flybirds_log - INFO - Test report configuration information 2022-05-22 00:10:01,345 - flybirds_log - INFO - {'screen_shot_dir': 'report\24663315-63d7-40da-b16a-c309866701d0\screenshot'} 2022-05-22 00:10:01,345 - flybirds_log - INFO - Process control configuration information 2022-05-22 00:10:01,345 - flybirds_log - INFO - {'before_run_page': 'restartApp', 'scenario_fail_page': 'restartApp', 'scenario_success_page': 'None', 'before_run_login': False, 'fail_screen_record': True, 'scenario_screen_record_time': 120, 'fail_rerun': False, 'max_fail_rerun_count': 1.0, 'max_retry_count': 1} 2022-05-22 00:10:01,347 - flybirds_log - INFO - configuration file read completed 2022-05-22 00:10:01,348 - flybirds_log - INFO - Logging configuration information 2022-05-22 00:10:01,348 - flybirds_log - INFO - {'level': 'info'} 2022-05-22 00:10:01,353 - flybirds_log - INFO - the python script in the project is read 2022-05-22 00:10:01,353 - flybirds_log - INFO - [active_before_all] user_data:{'screenShotDir': 'report\24663315-63d7-40da-b16a-c309866701d0\screenshot', 'run_at': 'local'} 2022-05-22 00:10:01,353 - flybirds_log - INFO - default_active_tag_provider :android chromium 2022-05-22 00:10:01,354 - flybirds_log - INFO - [active_before_all] active_tag_provider:{'python2': 'false', 'python3': 'true', 'os': 'win32', 'platform': 'android', 'deviceType': 'ivd', 'cur_browser': 'chromium'} 2022-05-22 00:10:01,354 - flybirds_log - INFO - device prepare 2022-05-22 00:10:01,354 - flybirds_log - INFO - device_id information:127.0.0.1:62001 [00:10:01][DEBUG]<airtest.core.android.adb> D:\Programs\anaconda\envs\dev\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s 127.0.0.1:62001 get-state [00:10:01][DEBUG]<airtest.core.android.adb> D:\Programs\anaconda\envs\dev\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s 127.0.0.1:62001 wait-for-device [00:10:01][DEBUG]<airtest.core.android.adb> D:\Programs\anaconda\envs\dev\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s 127.0.0.1:62001 shell getprop ro.build.version.sdk 2022-05-22 00:10:01,500 - flybirds_log - INFO - device connect info:<airtest.core.android.android.Android object at 0x0000024BA01731F0> 2022-05-22 00:10:01,501 - flybirds_log - INFO - initialize the device complete:127.0.0.1:62001 [00:10:01][DEBUG]<airtest.core.android.adb> D:\Programs\anaconda\envs\dev\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s 127.0.0.1:62001 shell pm list packages 2022-05-22 00:10:02,016 - flybirds_log - INFO - install app start, path:D:\Download\audio-visual\saas\data\indiehackerebooks\indie\download\installer.apk [00:10:02][DEBUG]<airtest.core.android.adb> D:\Programs\anaconda\envs\dev\Lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s 127.0.0.1:62001 install D:\Download\audio-visual\saas\data\indiehackerebooks\indie\download\installer.apk 2022-05-22 00:10:09,021 - flybirds_log - INFO - fail to install app HOOK-ERROR in before_all: Exception: Traceback (most recent call last): File "D:\Programs\anaconda\envs\dev\lib\site-packages\flybirds\core\plugin/event\app_prepare.py", line 102, in run app.install_app(installer) File "D:\Programs\anaconda\envs\dev\lib\site-packages\flybirds\core\driver\app.py", line 43, in install_app return g_context.app.install_app(package_path, wait_time) File "D:\Programs\anaconda\envs\dev\lib\site-packages\flybirds\core\plugin\plugins/default/android\app.py", line 40, in install_app i_result = install(package_path) File "D:\Programs\anaconda\envs\dev\lib\site-packages\airtest\utils\logwraper.py", line 90, in wrapper res = f(*args, kwargs) File "D:\Programs\anaconda\envs\dev\lib\site-packages\airtest\core\api.py", line 229, in install return G.DEVICE.install_app(filepath, kwargs) File "D:\Programs\anaconda\envs\dev\lib\site-packages\airtest\core\android\android.py", line 363, in install_app return self.adb.install_app(filepath, replace=replace, install_options=install_options) File "D:\Programs\anaconda\envs\dev\lib\site-packages\airtest\core\android\adb.py", line 584, in install_app out = self.cmd(cmds) File "D:\Programs\anaconda\envs\dev\lib\site-packages\airtest\core\android\adb.py", line 197, in cmd raise AdbError(stdout, stderr) airtest.core.error.AdbError: stdout[] stderr[adb: failed to install D:\Download\audio-visual\saas\data\indiehackerebooks\indie\download\installer.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113] ] ABORTED: By user. 0 features passed, 0 failed, 0 skipped, 16 untested 0 scenarios passed, 0 failed, 0 skipped, 30 untested 0 steps passed, 0 failed, 0 skipped, 0 undefined, 132 untested Took 0m0.000s 2022-05-22 00:10:09,104 - flybirds_log - INFO - Feature sum_count rerun after creation failure <= 0 or fail_count <= 0 2022-05-22 00:10:09,104 - flybirds_log - INFO - True 2022-05-22 00:10:09,110 - flybirds_log - INFO - Do you need to rerun the task: False, the failed retry task was not executed 2022-05-22 00:10:09,110 - flybirds_log - INFO - Start processing the json report. report_dir_path: [report\24663315-63d7-40da-b16a-c309866701d0],rerun_report_dir_path:[None] 2022-05-22 00:10:09,112 - flybirds_log - INFO - start generate report 2022-05-22 00:10:09,112 - flybirds_log - INFO - report cmd:node D:\Programs\anaconda\envs\dev\lib\site-packages\flybirds\report\node_report\report.js report\24663315-63d7-40da-b16a-c309866701d0 report\24663315-63d7-40da-b16a-c309866701d0 android multiple-cucumber-html-reporter platform: android
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

clgwlg commented 2 years ago

具体有以下两种方法

方法1

  1. 配置flybirds_config.json,修改platform=web
  2. 执行命令
    # Web端演示用例目录:features/test/web
    flybirds run -P features/test/web    

    方法2:

    通过命令行切换环境

    # 切换到Web环境执行用例
    flybirds run -D platform=web -P features/test/web
shopconan commented 2 years ago

我重新create了一个 用了 -D的命令


2022-05-23 13:35:36,481 - flybirds_log - INFO - flybirds cmd info: features/test/web None --format=json report\c1223659-9a17-4922-ae95-66f6773cd299\report.json ('platform=web',) True None True local    
2022-05-23 13:35:36,482 - flybirds_log - INFO - report path: -o report\c1223659-9a17-4922-ae95-66f6773cd299\report.json
2022-05-23 13:35:36,494 - flybirds_log - INFO - screenshot path: report\c1223659-9a17-4922-ae95-66f6773cd299\screenshot
2022-05-23 13:35:36,494 - flybirds_log - INFO - the assembled behave execution command: behave features/test/web --format=json -o report\c1223659-9a17-4922-ae95-66f6773cd299\report.json --define platform=d2Vi --define screenShotDir=cmVwb3J0XGMxMjIzNjU5LTlhMTctNDkyMi1hZTk1LTY2ZjY3NzNjZDI5OVxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr
2022-05-23 13:35:36,495 - flybirds_log - INFO - ============last run_args: {'cmd_str': 'behave features/test/web --format=json -o report\\c1223659-9a17-4922-ae95-66f6773cd299\\report.json --define platform=d2Vi --define screenShotDir=cmVwb3J0XGMxMjIzNjU5LTlhMTctNDkyMi1hZTk1LTY2ZjY3NzNjZDI5OVxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr', 'need_rerun': True, 'report_dir_path': 'report\\c1223659-9a17-4922-ae95-66f6773cd299', 'use_define': ['--define', 'platform=d2Vi', '--define', 'screenShotDir=cmVwb3J0XGMxMjIzNjU5LTlhMTctNDkyMi1hZTk1LTY2ZjY3NzNjZDI5OVxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw='], 'env_config': None, 'report_format': '--format=json', 'html': True, 'run_at': 'local', 'processes': 4, 'feature_path': 'features/test/web', 'parsed_tags': []}       
2022-05-23 13:35:36,496 - flybirds_log - INFO - received run_args: {'cmd_str': 'behave features/test/web --format=json -o report\\c1223659-9a17-4922-ae95-66f6773cd299\\report.json --define platform=d2Vi --define screenShotDir=cmVwb3J0XGMxMjIzNjU5LTlhMTctNDkyMi1hZTk1LTY2ZjY3NzNjZDI5OVxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr', 'need_rerun': True, 'report_dir_path': 'report\\c1223659-9a17-4922-ae95-66f6773cd299', 'use_define': ['--define', 'platform=d2Vi', '--define', 'screenShotDir=cmVwb3J0XGMxMjIzNjU5LTlhMTctNDkyMi1hZTk1LTY2ZjY3NzNjZDI5OVxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw='], 'env_config': None, 'report_format': '--format=json', 'html': True, 'run_at': 'local', 'processes': 4, 'feature_path': 'features/test/web', 'parsed_tags': []}
2022-05-23 13:35:36,504 - flybirds_log - INFO - find extend pkg
2022-05-23 13:35:36,708 - flybirds_log - INFO - use_define: ['--define', 'platform=d2Vi', '--define', 'screenShotDir=cmVwb3J0XGMxMjIzNjU5LTlhMTctNDkyMi1hZTk1LTY2ZjY3NzNjZDI5OVxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw=']
Error processing line 1 of D:\Programs\anaconda\lib\site-packages\distutils-precedence.pth:

  Traceback (most recent call last):
    File "D:\Programs\anaconda\lib\site.py", line 169, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  ModuleNotFoundError: No module named '_distutils_hack'

Remainder of file ignored
2022-05-23 13:35:38,205 - flybirds_log - INFO - change behave json format feature to flybirds feature

2022-05-23 13:35:38,205 - flybirds_log - INFO - change behave add_step_definition to flybirds add_step_definition
2022-05-23 13:35:38,315 - flybirds_log - ERROR - behave task execute error: Traceback (most recent call last):
  File "D:\Programs\anaconda\lib\site-packages\flybirds\core\launch_cycle\run_manage.py", line 74, in exe
    parallel_run(context)
  File "D:\Programs\anaconda\lib\site-packages\flybirds\report\parallel_runner.py", line 58, in parallel_run
    features = get_features_num(cmd)
  File "D:\Programs\anaconda\lib\site-packages\flybirds\report\parallel_runner.py", line 136, in get_features_num
    parsed_output = dry_run_parsed_cmd(cmd)
  File "D:\Programs\anaconda\lib\site-packages\flybirds\report\parallel_runner.py", line 132, in dry_run_parsed_cmd
    return json.loads(out.decode())
  File "D:\Programs\anaconda\lib\json\__init__.py", line 335, in loads
    raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)

2022-05-23 13:35:38,317 - flybirds_log - INFO - start generate report
2022-05-23 13:35:38,317 - flybirds_log - INFO - report cmd:node D:\Programs\anaconda\lib\site-packages\flybirds\report\node_report\report.js report\c1223659-9a17-4922-ae95-66f6773cd299 report\c1223659-9a17-4922-ae95-66f6773cd299 web
multiple-cucumber-html-reporter platform: web
WARNING: No JSON files found in 'report\c1223659-9a17-4922-ae95-66f6773cd299'. NO REPORT CAN BE CREATED!
lodash.templateSources[1]:10
 _.each(suite.features[0].metadata, function(metadatum, metadatumIndex) { ;
                          ^

TypeError: Cannot read properties of undefined (reading 'metadata')
    at eval (lodash.templateSources[1]:10:27)
    at _createFeaturesOverviewIndexPage (D:\Programs\anaconda\lib\site-packages\flybirds\report\node_report\node_modules\multiple-cucumber-html-reporter\lib\generate-report.js:455:84)
    at Object.generateReport [as generate] (D:\Programs\anaconda\lib\site-packages\flybirds\report\node_report\node_modules\multiple-cucumber-html-reporter\lib\generate-report.js:139:3)
    at Object.<anonymous> (D:\Programs\anaconda\lib\site-packages\flybirds\report\node_report\report.js:46:8)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47
DHpie commented 2 years ago

可以检查一下你的命令,大概率是命令行的路径不正确。

shopconan commented 2 years ago

@DHpie 好像不是 我给你完整看一下

$ flybirds create
Welcome to flybirds cli. Please enter any information to continue.
Please input your project name>>: flytest
Please input your test platform? (Android/IOS/Web): web
Please enter the number represented by the browserType you want to test? Multiple browsers are separated by commas(,).(1:chromium  2:firefox  3:webkit): 2
Do you want to launch browser in headless mode? [y/N]: n
Cloning into 'flytest'...
Processing  [####################################]  100%
Done it! Create Project flytest has success!
You can find it at: D:\Download\audio-visual\saas\flytest

dubo@LAPTOP-I2R9VG58 MINGW64 /d/Download/audio-visual/saas
$ cd flytest/

dubo@LAPTOP-I2R9VG58 MINGW64 /d/Download/audio-visual/saas/flytest
$ ls
__pycache__/  config/  features/  pscript/

dubo@LAPTOP-I2R9VG58 MINGW64 /d/Download/audio-visual/saas/flytest
$ flybirds run -D platform=web -P features/test/web
2022-05-23 14:22:44,724 - flybirds_log - INFO - flybirds cmd info: features/test/web None --format=json report\30a9f415-b723-4f4a-bcd3-ee288fae92c5\report.json ('platform=web',) True None True local    
2022-05-23 14:22:44,726 - flybirds_log - INFO - report path: -o report\30a9f415-b723-4f4a-bcd3-ee288fae92c5\report.json
2022-05-23 14:22:44,727 - flybirds_log - INFO - screenshot path: report\30a9f415-b723-4f4a-bcd3-ee288fae92c5\screenshot
2022-05-23 14:22:44,727 - flybirds_log - INFO - the assembled behave execution command: behave features/test/web --format=json -o report\30a9f415-b723-4f4a-bcd3-ee288fae92c5\report.json --define platform=d2Vi --define screenShotDir=cmVwb3J0XDMwYTlmNDE1LWI3MjMtNGY0YS1iY2QzLWVlMjg4ZmFlOTJjNVxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr
2022-05-23 14:22:44,728 - flybirds_log - INFO - ============last run_args: {'cmd_str': 'behave features/test/web --format=json -o report\\30a9f415-b723-4f4a-bcd3-ee288fae92c5\\report.json --define platform=d2Vi --define screenShotDir=cmVwb3J0XDMwYTlmNDE1LWI3MjMtNGY0YS1iY2QzLWVlMjg4ZmFlOTJjNVxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr', 'need_rerun': True, 'report_dir_path': 'report\\30a9f415-b723-4f4a-bcd3-ee288fae92c5', 'use_define': ['--define', 'platform=d2Vi', '--define', 'screenShotDir=cmVwb3J0XDMwYTlmNDE1LWI3MjMtNGY0YS1iY2QzLWVlMjg4ZmFlOTJjNVxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw='], 'env_config': None, 'report_format': '--format=json', 'html': True, 'run_at': 'local', 'processes': 4, 'feature_path': 'features/test/web', 'parsed_tags': []}       
2022-05-23 14:22:44,729 - flybirds_log - INFO - received run_args: {'cmd_str': 'behave features/test/web --format=json -o report\\30a9f415-b723-4f4a-bcd3-ee288fae92c5\\report.json --define platform=d2Vi --define screenShotDir=cmVwb3J0XDMwYTlmNDE1LWI3MjMtNGY0YS1iY2QzLWVlMjg4ZmFlOTJjNVxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr', 'need_rerun': True, 'report_dir_path': 'report\\30a9f415-b723-4f4a-bcd3-ee288fae92c5', 'use_define': ['--define', 'platform=d2Vi', '--define', 'screenShotDir=cmVwb3J0XDMwYTlmNDE1LWI3MjMtNGY0YS1iY2QzLWVlMjg4ZmFlOTJjNVxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw='], 'env_config': None, 'report_format': '--format=json', 'html': True, 'run_at': 'local', 'processes': 4, 'feature_path': 'features/test/web', 'parsed_tags': []}
2022-05-23 14:22:44,737 - flybirds_log - INFO - find extend pkg
2022-05-23 14:22:44,949 - flybirds_log - INFO - use_define: ['--define', 'platform=d2Vi', '--define', 'screenShotDir=cmVwb3J0XDMwYTlmNDE1LWI3MjMtNGY0YS1iY2QzLWVlMjg4ZmFlOTJjNVxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw=']
2022-05-23 14:22:46,387 - flybirds_log - INFO - change behave json format feature to flybirds feature

2022-05-23 14:22:46,388 - flybirds_log - INFO - change behave add_step_definition to flybirds add_step_definition
2022-05-23 14:22:46,498 - flybirds_log - ERROR - behave task execute error: Traceback (most recent call last):
  File "D:\Programs\anaconda\lib\site-packages\flybirds\core\launch_cycle\run_manage.py", line 74, in exe
    parallel_run(context)
  File "D:\Programs\anaconda\lib\site-packages\flybirds\report\parallel_runner.py", line 58, in parallel_run
    features = get_features_num(cmd)
  File "D:\Programs\anaconda\lib\site-packages\flybirds\report\parallel_runner.py", line 136, in get_features_num
    parsed_output = dry_run_parsed_cmd(cmd)
  File "D:\Programs\anaconda\lib\site-packages\flybirds\report\parallel_runner.py", line 132, in dry_run_parsed_cmd
    return json.loads(out.decode())
  File "D:\Programs\anaconda\lib\json\__init__.py", line 335, in loads
    raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)

2022-05-23 14:22:46,500 - flybirds_log - INFO - start generate report
2022-05-23 14:22:46,500 - flybirds_log - INFO - report cmd:node D:\Programs\anaconda\lib\site-packages\flybirds\report\node_report\report.js report\30a9f415-b723-4f4a-bcd3-ee288fae92c5 report\30a9f415-b723-4f4a-bcd3-ee288fae92c5 web
multiple-cucumber-html-reporter platform: web
WARNING: No JSON files found in 'report\30a9f415-b723-4f4a-bcd3-ee288fae92c5'. NO REPORT CAN BE CREATED!
lodash.templateSources[1]:10
 _.each(suite.features[0].metadata, function(metadatum, metadatumIndex) { ;
                          ^

TypeError: Cannot read properties of undefined (reading 'metadata')
    at eval (lodash.templateSources[1]:10:27)
    at _createFeaturesOverviewIndexPage (D:\Programs\anaconda\lib\site-packages\flybirds\report\node_report\node_modules\multiple-cucumber-html-reporter\lib\generate-report.js:455:84)
    at Object.generateReport [as generate] (D:\Programs\anaconda\lib\site-packages\flybirds\report\node_report\node_modules\multiple-cucumber-html-reporter\lib\generate-report.js:139:3)
    at Object.<anonymous> (D:\Programs\anaconda\lib\site-packages\flybirds\report\node_report\report.js:46:8)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47

$ flybirds run  -P features/test/web/web_en_record.feature 
2022-05-23 14:26:30,418 - flybirds_log - INFO - flybirds cmd info: features/test/web/web_en_record.feature None --format=json report\ada5a6bc-238f-47a8-8bac-6fbbdf529625\report.json () True None True local
2022-05-23 14:26:30,420 - flybirds_log - INFO - report path: -o report\ada5a6bc-238f-47a8-8bac-6fbbdf529625\report.json
2022-05-23 14:26:30,421 - flybirds_log - INFO - screenshot path: report\ada5a6bc-238f-47a8-8bac-6fbbdf529625\screenshot
2022-05-23 14:26:30,421 - flybirds_log - INFO - the assembled behave execution command: behave features/test/web/web_en_record.feature --format=json -o report\ada5a6bc-238f-47a8-8bac-6fbbdf529625\report.json --define screenShotDir=cmVwb3J0XGFkYTVhNmJjLTIzOGYtNDdhOC04YmFjLTZmYmJkZjUyOTYyNVxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr
2022-05-23 14:26:30,422 - flybirds_log - INFO - ============last run_args: {'cmd_str': 'behave features/test/web/web_en_record.feature --format=json -o report\\ada5a6bc-238f-47a8-8bac-6fbbdf529625\\report.json --define screenShotDir=cmVwb3J0XGFkYTVhNmJjLTIzOGYtNDdhOC04YmFjLTZmYmJkZjUyOTYyNVxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr', 'need_rerun': True, 'report_dir_path': 'report\\ada5a6bc-238f-47a8-8bac-6fbbdf529625', 'use_define': ['--define', 'screenShotDir=cmVwb3J0XGFkYTVhNmJjLTIzOGYtNDdhOC04YmFjLTZmYmJkZjUyOTYyNVxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw='], 'env_config': None, 'report_format': '--format=json', 'html': True, 'run_at': 'local', 'processes': 4, 'feature_path': 'features/test/web/web_en_record.feature', 'parsed_tags': []}
2022-05-23 14:26:30,423 - flybirds_log - INFO - received run_args: {'cmd_str': 'behave features/test/web/web_en_record.feature --format=json -o report\\ada5a6bc-238f-47a8-8bac-6fbbdf529625\\report.json --define screenShotDir=cmVwb3J0XGFkYTVhNmJjLTIzOGYtNDdhOC04YmFjLTZmYmJkZjUyOTYyNVxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr', 'need_rerun': True, 'report_dir_path': 'report\\ada5a6bc-238f-47a8-8bac-6fbbdf529625', 'use_define': ['--define', 'screenShotDir=cmVwb3J0XGFkYTVhNmJjLTIzOGYtNDdhOC04YmFjLTZmYmJkZjUyOTYyNVxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw='], 'env_config': None, 'report_format': '--format=json', 'html': True, 'run_at': 'local', 'processes': 4, 'feature_path': 'features/test/web/web_en_record.feature', 'parsed_tags': []}
2022-05-23 14:26:30,429 - flybirds_log - INFO - find extend pkg
2022-05-23 14:26:30,622 - flybirds_log - INFO - use_define: ['--define', 'screenShotDir=cmVwb3J0XGFkYTVhNmJjLTIzOGYtNDdhOC04YmFjLTZmYmJkZjUyOTYyNVxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw=']
2022-05-23 14:26:32,108 - flybirds_log - INFO - change behave json format feature to flybirds feature

2022-05-23 14:26:32,109 - flybirds_log - INFO - change behave add_step_definition to flybirds add_step_definition
2022-05-23 14:26:32,165 - flybirds_log - ERROR - behave task execute error: Traceback (most recent call last):
  File "D:\Programs\anaconda\lib\site-packages\flybirds\core\launch_cycle\run_manage.py", line 74, in exe
    parallel_run(context)
  File "D:\Programs\anaconda\lib\site-packages\flybirds\report\parallel_runner.py", line 58, in parallel_run
    features = get_features_num(cmd)
  File "D:\Programs\anaconda\lib\site-packages\flybirds\report\parallel_runner.py", line 136, in get_features_num
    parsed_output = dry_run_parsed_cmd(cmd)
  File "D:\Programs\anaconda\lib\site-packages\flybirds\report\parallel_runner.py", line 132, in dry_run_parsed_cmd
    return json.loads(out.decode())
  File "D:\Programs\anaconda\lib\json\__init__.py", line 335, in loads
    raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)

2022-05-23 14:26:32,168 - flybirds_log - INFO - start generate report
2022-05-23 14:26:32,168 - flybirds_log - INFO - report cmd:node D:\Programs\anaconda\lib\site-packages\flybirds\report\node_report\report.js report\ada5a6bc-238f-47a8-8bac-6fbbdf529625 report\ada5a6bc-238f-47a8-8bac-6fbbdf529625 web
multiple-cucumber-html-reporter platform: web
WARNING: No JSON files found in 'report\ada5a6bc-238f-47a8-8bac-6fbbdf529625'. NO REPORT CAN BE CREATED!
lodash.templateSources[1]:10
 _.each(suite.features[0].metadata, function(metadatum, metadatumIndex) { ;
                          ^

TypeError: Cannot read properties of undefined (reading 'metadata')
    at eval (lodash.templateSources[1]:10:27)
    at _createFeaturesOverviewIndexPage (D:\Programs\anaconda\lib\site-packages\flybirds\report\node_report\node_modules\multiple-cucumber-html-reporter\lib\generate-report.js:455:84)
    at Object.generateReport [as generate] (D:\Programs\anaconda\lib\site-packages\flybirds\report\node_report\node_modules\multiple-cucumber-html-reporter\lib\generate-report.js:139:3)
    at Object.<anonymous> (D:\Programs\anaconda\lib\site-packages\flybirds\report\node_report\report.js:46:8)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47
$
DHpie commented 2 years ago

你本地 behave安装成功了吗

shopconan commented 2 years ago

没看到文档步骤有behave这个?

shopconan commented 2 years ago

似乎并没有关系

$ pip install behave
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: behave in d:\programs\anaconda\lib\site-packages (1.2.6)
Requirement already satisfied: six>=1.11 in d:\programs\anaconda\lib\site-packages (from behave) (1.16.0)
Requirement already satisfied: parse-type>=0.4.2 in d:\programs\anaconda\lib\site-packages (from behave) (0.6.0)
Requirement already satisfied: parse>=1.8.2 in d:\programs\anaconda\lib\site-packages (from behave) (1.19.0)

dubo@LAPTOP-I2R9VG58 MINGW64 /d/Download/audio-visual/saas/flytest
$  flybirds run -D platform=web -P features/test/web
2022-05-23 14:45:40,245 - flybirds_log - INFO - flybirds cmd info: features/test/web None --format=json report\2074cf94-e39b-4b84-88a9-461ceff5085a\report.json ('platform=web',) True None True local    
2022-05-23 14:45:40,247 - flybirds_log - INFO - report path: -o report\2074cf94-e39b-4b84-88a9-461ceff5085a\report.json
2022-05-23 14:45:40,248 - flybirds_log - INFO - screenshot path: report\2074cf94-e39b-4b84-88a9-461ceff5085a\screenshot
2022-05-23 14:45:40,249 - flybirds_log - INFO - the assembled behave execution command: behave features/test/web --format=json -o report\2074cf94-e39b-4b84-88a9-461ceff5085a\report.json --define platform=d2Vi --define screenShotDir=cmVwb3J0XDIwNzRjZjk0LWUzOWItNGI4NC04OGE5LTQ2MWNlZmY1MDg1YVxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr
2022-05-23 14:45:40,249 - flybirds_log - INFO - ============last run_args: {'cmd_str': 'behave features/test/web --format=json -o report\\2074cf94-e39b-4b84-88a9-461ceff5085a\\report.json --define platform=d2Vi --define screenShotDir=cmVwb3J0XDIwNzRjZjk0LWUzOWItNGI4NC04OGE5LTQ2MWNlZmY1MDg1YVxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr', 'need_rerun': True, 'report_dir_path': 'report\\2074cf94-e39b-4b84-88a9-461ceff5085a', 'use_define': ['--define', 'platform=d2Vi', '--define', 'screenShotDir=cmVwb3J0XDIwNzRjZjk0LWUzOWItNGI4NC04OGE5LTQ2MWNlZmY1MDg1YVxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw='], 'env_config': None, 'report_format': '--format=json', 'html': True, 'run_at': 'local', 'processes': 4, 'feature_path': 'features/test/web', 'parsed_tags': []}       
2022-05-23 14:45:40,250 - flybirds_log - INFO - received run_args: {'cmd_str': 'behave features/test/web --format=json -o report\\2074cf94-e39b-4b84-88a9-461ceff5085a\\report.json --define platform=d2Vi --define screenShotDir=cmVwb3J0XDIwNzRjZjk0LWUzOWItNGI4NC04OGE5LTQ2MWNlZmY1MDg1YVxzY3JlZW5zaG90 --define run_at=bG9jYWw= --no-color --no-capture --no-capture-stderr', 'need_rerun': True, 'report_dir_path': 'report\\2074cf94-e39b-4b84-88a9-461ceff5085a', 'use_define': ['--define', 'platform=d2Vi', '--define', 'screenShotDir=cmVwb3J0XDIwNzRjZjk0LWUzOWItNGI4NC04OGE5LTQ2MWNlZmY1MDg1YVxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw='], 'env_config': None, 'report_format': '--format=json', 'html': True, 'run_at': 'local', 'processes': 4, 'feature_path': 'features/test/web', 'parsed_tags': []}
2022-05-23 14:45:40,257 - flybirds_log - INFO - find extend pkg
2022-05-23 14:45:40,452 - flybirds_log - INFO - use_define: ['--define', 'platform=d2Vi', '--define', 'screenShotDir=cmVwb3J0XDIwNzRjZjk0LWUzOWItNGI4NC04OGE5LTQ2MWNlZmY1MDg1YVxzY3JlZW5zaG90', '--define', 'run_at=bG9jYWw=']
2022-05-23 14:45:41,959 - flybirds_log - INFO - change behave json format feature to flybirds feature

2022-05-23 14:45:41,959 - flybirds_log - INFO - change behave add_step_definition to flybirds add_step_definition
2022-05-23 14:45:42,076 - flybirds_log - ERROR - behave task execute error: Traceback (most recent call last):
  File "D:\Programs\anaconda\lib\site-packages\flybirds\core\launch_cycle\run_manage.py", line 74, in exe
    parallel_run(context)
  File "D:\Programs\anaconda\lib\site-packages\flybirds\report\parallel_runner.py", line 58, in parallel_run
    features = get_features_num(cmd)
  File "D:\Programs\anaconda\lib\site-packages\flybirds\report\parallel_runner.py", line 136, in get_features_num
    parsed_output = dry_run_parsed_cmd(cmd)
  File "D:\Programs\anaconda\lib\site-packages\flybirds\report\parallel_runner.py", line 132, in dry_run_parsed_cmd
    return json.loads(out.decode())
  File "D:\Programs\anaconda\lib\json\__init__.py", line 335, in loads
    raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)

2022-05-23 14:45:42,078 - flybirds_log - INFO - start generate report
2022-05-23 14:45:42,078 - flybirds_log - INFO - report cmd:node D:\Programs\anaconda\lib\site-packages\flybirds\report\node_report\report.js report\2074cf94-e39b-4b84-88a9-461ceff5085a report\2074cf94-e39b-4b84-88a9-461ceff5085a web
multiple-cucumber-html-reporter platform: web
WARNING: No JSON files found in 'report\2074cf94-e39b-4b84-88a9-461ceff5085a'. NO REPORT CAN BE CREATED!
lodash.templateSources[1]:10
 _.each(suite.features[0].metadata, function(metadatum, metadatumIndex) { ;
                          ^

TypeError: Cannot read properties of undefined (reading 'metadata')
    at eval (lodash.templateSources[1]:10:27)
    at _createFeaturesOverviewIndexPage (D:\Programs\anaconda\lib\site-packages\flybirds\report\node_report\node_modules\multiple-cucumber-html-reporter\lib\generate-report.js:455:84)
    at Object.generateReport [as generate] (D:\Programs\anaconda\lib\site-packages\flybirds\report\node_report\node_modules\multiple-cucumber-html-reporter\lib\generate-report.js:139:3)
    at Object.<anonymous> (D:\Programs\anaconda\lib\site-packages\flybirds\report\node_report\report.js:46:8)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47
DHpie commented 2 years ago

检查一下这个里面的包是否都已经正确安装了: 依赖包列表

shopconan commented 2 years ago

dev.txt

pocoui>=1.0.85

airtest>=1.2.3

setuptools~=47.1.0

behave==1.2.6

jsonpath==0.82

typer==0.4.0

tidevice==0.5.9

pyasn1==0.4.8

pyOpenSSL==19.1.0

playwright>=1.19.0

$ pip install -r dev.txt Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Requirement already satisfied: pocoui>=1.0.85 in d:\programs\anaconda\lib\site-packages (from -r dev.txt (line 3)) (1.0.87) Requirement already satisfied: airtest>=1.2.3 in d:\programs\anaconda\lib\site-packages (from -r dev.txt (line 5)) (1.2.6) Requirement already satisfied: setuptools~=47.1.0 in d:\programs\anaconda\lib\site-packages (from -r dev.txt (line 7)) (47.1.1) Requirement already satisfied: behave==1.2.6 in d:\programs\anaconda\lib\site-packages (from -r dev.txt (line 9)) (1.2.6) Requirement already satisfied: jsonpath==0.82 in d:\programs\anaconda\lib\site-packages (from -r dev.txt (line 11)) (0.82) Requirement already satisfied: typer==0.4.0 in d:\programs\anaconda\lib\site-packages (from -r dev.txt (line 13)) (0.4.0) Requirement already satisfied: tidevice==0.5.9 in d:\programs\anaconda\lib\site-packages (from -r dev.txt (line 15)) (0.5.9) Requirement already satisfied: pyasn1==0.4.8 in d:\programs\anaconda\lib\site-packages (from -r dev.txt (line 17)) (0.4.8) Requirement already satisfied: pyOpenSSL==19.1.0 in d:\programs\anaconda\lib\site-packages (from -r dev.txt (line 19)) (19.1.0) Requirement already satisfied: playwright>=1.19.0 in d:\programs\anaconda\lib\site-packages\playwright-1.22.0-py3.9-win-amd64.egg (from -r dev.txt (line 21)) (1.22.0) Requirement already satisfied: parse>=1.8.2 in d:\programs\anaconda\lib\site-packages (from behave==1.2.6->-r dev.txt (line 9)) (1.19.0) Requirement already satisfied: six>=1.11 in d:\programs\anaconda\lib\site-packages (from behave==1.2.6->-r dev.txt (line 9)) (1.16.0) Requirement already satisfied: parse-type>=0.4.2 in d:\programs\anaconda\lib\site-packages (from behave==1.2.6->-r dev.txt (line 9)) (0.6.0) Requirement already satisfied: click<9.0.0,>=7.1.1 in d:\programs\anaconda\lib\site-packages (from typer==0.4.0->-r dev.txt (line 13)) (8.0.3) Requirement already satisfied: retry in d:\programs\anaconda\lib\site-packages (from tidevice==0.5.9->-r dev.txt (line 15)) (0.9.2) Requirement already satisfied: tornado in d:\programs\anaconda\lib\site-packages (from tidevice==0.5.9->-r dev.txt (line 15)) (6.1) Requirement already satisfied: packaging in d:\programs\anaconda\lib\site-packages (from tidevice==0.5.9->-r dev.txt (line 15)) (21.3) Requirement already satisfied: requests in d:\programs\anaconda\lib\site-packages (from tidevice==0.5.9->-r dev.txt (line 15)) (2.27.1) Requirement already satisfied: colored in d:\programs\anaconda\lib\site-packages (from tidevice==0.5.9->-r dev.txt (line 15)) (1.4.3) Requirement already satisfied: simplejson in d:\programs\anaconda\lib\site-packages (from tidevice==0.5.9->-r dev.txt (line 15)) (3.17.6) Requirement already satisfied: simple-tornado>=0.2.2 in d:\programs\anaconda\lib\site-packages (from tidevice==0.5.9->-r dev.txt (line 15)) (0.2.2) Requirement already satisfied: cached-property in d:\programs\anaconda\lib\site-packages (from tidevice==0.5.9->-r dev.txt (line 15)) (1.5.2) Requirement already satisfied: logzero in d:\programs\anaconda\lib\site-packages (from tidevice==0.5.9->-r dev.txt (line 15)) (1.7.0) Requirement already satisfied: Pillow in d:\programs\anaconda\lib\site-packages (from tidevice==0.5.9->-r dev.txt (line 15)) (9.0.1) Requirement already satisfied: cryptography>=2.8 in d:\programs\anaconda\lib\site-packages (from pyOpenSSL==19.1.0->-r dev.txt (line 19)) (37.0.2) Requirement already satisfied: websocket-client==0.48.0 in d:\programs\anaconda\lib\site-packages (from pocoui>=1.0.85->-r dev.txt (line 3)) (0.48.0) Requirement already satisfied: hrpc>=1.0.9 in d:\programs\anaconda\lib\site-packages (from pocoui>=1.0.85->-r dev.txt (line 3)) (1.0.9) Requirement already satisfied: opencv-contrib-python in d:\programs\anaconda\lib\site-packages (from airtest>=1.2.3->-r dev.txt (line 5)) (4.5.5.64) Requirement already satisfied: numpy in d:\programs\anaconda\lib\site-packages (from airtest>=1.2.3->-r dev.txt (line 5)) (1.21.5) Requirement already satisfied: mss==6.1.0 in d:\programs\anaconda\lib\site-packages (from airtest>=1.2.3->-r dev.txt (line 5)) (6.1.0) Requirement already satisfied: pywin32 in d:\programs\anaconda\lib\site-packages (from airtest>=1.2.3->-r dev.txt (line 5)) (302) Requirement already satisfied: facebook-wda>=1.3.3 in d:\programs\anaconda\lib\site-packages (from airtest>=1.2.3->-r dev.txt (line 5)) (1.4.6) Requirement already satisfied: pywinauto==0.6.3 in d:\programs\anaconda\lib\site-packages (from airtest>=1.2.3->-r dev.txt (line 5)) (0.6.3) Requirement already satisfied: Jinja2>=2.8 in d:\programs\anaconda\lib\site-packages (from airtest>=1.2.3->-r dev.txt (line 5)) (2.11.3) Requirement already satisfied: comtypes in d:\programs\anaconda\lib\site-packages (from pywinauto==0.6.3->airtest>=1.2.3->-r dev.txt (line 5)) (1.1.10) Requirement already satisfied: websockets==10.1 in d:\programs\anaconda\lib\site-packages (from playwright>=1.19.0->-r dev.txt (line 21)) (10.1) Requirement already satisfied: greenlet==1.1.2 in d:\programs\anaconda\lib\site-packages (from playwright>=1.19.0->-r dev.txt (line 21)) (1.1.2) Requirement already satisfied: pyee==8.1.0 in d:\programs\anaconda\lib\site-packages\pyee-8.1.0-py3.9.egg (from playwright>=1.19.0->-r dev.txt (line 21)) (8.1.0) Requirement already satisfied: colorama in d:\programs\anaconda\lib\site-packages (from click<9.0.0,>=7.1.1->typer==0.4.0->-r dev.txt (line 13)) (0.4.4) Requirement already satisfied: cffi>=1.12 in d:\programs\anaconda\lib\site-packages (from cryptography>=2.8->pyOpenSSL==19.1.0->-r dev.txt (line 19)) (1.15.0) Requirement already satisfied: pycparser in d:\programs\anaconda\lib\site-packages (from cffi>=1.12->cryptography>=2.8->pyOpenSSL==19.1.0->-r dev.txt (line 19)) (2.21) Requirement already satisfied: Deprecated~=1.2.6 in d:\programs\anaconda\lib\site-packages (from facebook-wda>=1.3.3->airtest>=1.2.3->-r dev.txt (line 5)) (1.2.13) Requirement already satisfied: wrapt<2,>=1.10 in d:\programs\anaconda\lib\site-packages (from Deprecated~=1.2.6->facebook-wda>=1.3.3->airtest>=1.2.3->-r dev.txt (line 5)) (1.12.1) Requirement already satisfied: MarkupSafe>=0.23 in d:\programs\anaconda\lib\site-packages (from Jinja2>=2.8->airtest>=1.2.3->-r dev.txt (line 5)) (2.0.1) Requirement already satisfied: charset-normalizer~=2.0.0 in d:\programs\anaconda\lib\site-packages (from requests->tidevice==0.5.9->-r dev.txt (line 15)) (2.0.4) Requirement already satisfied: certifi>=2017.4.17 in d:\programs\anaconda\lib\site-packages (from requests->tidevice==0.5.9->-r dev.txt (line 15)) (2021.10.8) Requirement already satisfied: idna<4,>=2.5 in d:\programs\anaconda\lib\site-packages (from requests->tidevice==0.5.9->-r dev.txt (line 15)) (2.10) Requirement already satisfied: urllib3<1.27,>=1.21.1 in d:\programs\anaconda\lib\site-packages (from requests->tidevice==0.5.9->-r dev.txt (line 15)) (1.26.9) Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in d:\programs\anaconda\lib\site-packages (from packaging->tidevice==0.5.9->-r dev.txt (line 15)) (3.0.4) Requirement already satisfied: py<2.0.0,>=1.4.26 in d:\programs\anaconda\lib\site-packages (from retry->tidevice==0.5.9->-r dev.txt (line 15)) (1.11.0) Requirement already satisfied: decorator>=3.4.2 in d:\programs\anaconda\lib\site-packages (from retry->tidevice==0.5.9->-r dev.txt (line 15)) (4.4.2)

@DHpie 没有问题

python3.9.12

clgwlg commented 2 years ago

@shopconan 抛出下面错误的原因,是数据中出现了BOM值导致的解码失败,猜测和运行环境有关。 计划本周发布一个小版本,增加解码时对应的处理,非常感谢你的反馈。

raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
DHpie commented 2 years ago

@shopconan 目前没办法重现此种错误,出现 UTF-8 BOM 的错误可能和编辑器有关。你试试flybirds create后,用IDE 运行项目看看。

shopconan commented 2 years ago

@DHpie
ide 我用的vscode window10系统 我主要没明白要《用IDE 运行项目看看。》看啥。。。

wanghaisheng commented 2 years ago

我简单在云端测了一下 https://github.com/wanghaisheng/flybirds-test/actions

三种系统都没有问题 那么就是我本机的环境问题 google一番以后只有这里疑似 但实际上改无可改 flybirds-windows-debug

wanghaisheng commented 2 years ago

我用这个重现了更多信息

"""
        Description: A simple GUI tool to execute Behave tests
        Business Function: EOS Test Automation
        Author: Máté Gál
        Date-of-creation: 10-May-2022
        Contact: mate.gal@schindler.com

        Not implemented features:
            - Loading sign while "scanning files"

        Known bugs:
            -
"""

import os
import subprocess
import sys
import parse
import logging
import threading
import tkinter as tk
from datetime import datetime
from tkinter import filedialog
logging.basicConfig(level=logging.INFO)

class MainFrame(tk.Frame):

    def __init__(self, *args, **kwargs):
        tk.Frame.__init__(self, *args, **kwargs)
        self.screen_width = root.winfo_screenwidth()
        self.screen_height = root.winfo_screenheight()
        # Set main frame resolution
        self.res_width = '854'
        self.res_height = '480'
        # Set MainFrame size and top left coordinates ( relative to whole screen size )
        root.geometry(str(self.res_width) + 'x' + str(self.res_height) + '+' +
                      str(int(0.1 * self.screen_width)) + '+' + str(int(0.1 * self.screen_height)))
        # Set MainFrame non-resizable
        root.resizable(False, False)
        # Set MainFrame title
        root.title('Behave Executor')
        # Set MainFrame icon
        # root.iconbitmap('schindler.ico')
        #
        self.display_menus()
        #
        self.features_folder = None
        #
        self.feature_names = []
        self.selected_features = []
        self.undefined_steps = {}
        self.filter_features_label = tk.Label(root, text="Features")
        self.filter_features_listbox = tk.Listbox(root, selectmode='extended', exportselection=False)
        #
        self.tag_names = []
        self.filtered_tags = []
        self.selected_tags = []
        self.filter_tags_label = tk.Label(root, text="Tags")
        self.filter_tags_listbox = tk.Listbox(root, selectmode='extended', exportselection=True)
        #
        self.scenario_names = []
        self.filtered_scenarios = []
        self.selected_scenarios = []
        self.filter_scenarios_label = tk.Label(root, text="Scenarios")
        self.filter_scenarios_listbox = tk.Listbox(root, selectmode="extended", exportselection=True)
        #
        self.behave_command = tk.StringVar()
        self.behave_command_label = tk.Label(root, text="Behave Command")
        self.behave_command_text = tk.Text(root)
        #
        self.instructions_label = tk.Label(root)
        self.display_instructions_label(state=True)
        #
        self.execute_test_button = tk.Button(root)
        #
        self.reset_button = tk.Button(root)
        #
        self.report_path_label = tk.Label(root)
        self.report_path = tk.StringVar()
        self.report_button = tk.Button(root)
        #
        self.report_path_entry = tk.Entry(root)
        self.report_checkbox_var = tk.BooleanVar()
        self.report_checkbox = tk.Checkbutton(root, variable=self.report_checkbox_var)
        self.is_json_added = False
        #
        self.about_window = None
        self.about_window_is_open = False
        #
        self.incomplete_feature_indexes = []

    """
            WIDGET METHODS
    """

    def display_menus(self):
        # Create Menubar
        menu_bar = tk.Menu(root)
        # Create PullDown Menu in Menubar
        file_menu = tk.Menu(menu_bar, tearoff=0, font=("Helvetica", 10))
        file_menu.add_command(label="Open", command=self.browse_features_path)
        file_menu.add_command(label="About", command=self.display_about_window)
        file_menu.add_separator()
        file_menu.add_command(label="Exit", command=self.close)
        menu_bar.add_cascade(label="File", menu=file_menu)
        # display the menu
        root.config(menu=menu_bar)

    def display_instructions_label(self, state):
        if state:
            self.instructions_label.config(text='Please browse the behave "features" folder !', font=("Helvetica", 16))
            self.instructions_label.place(x=int(self.res_width) * 0.23, y=int(self.res_height) * 0.4)
        if not state:
            self.instructions_label.place_forget()

    def display_warning_label(self, state):
        warning_label = tk.Label(root)
        if state:
            warning_label.config(text='WARNING! One or more feature files contain undefined steps!',
                                 font=("Helvetica", 16), fg="red")
            warning_label.place(x=int(self.res_width) * 0.16, y=int(self.res_height) * 0.4)
        if not state:
            warning_label.place_forget()

    def display_scanning_label(self, state):
        scanning_label = tk.Label(root)
        if state:
            scanning_label.config(text='Scanning files ...', font=("Helvetica", 16))
            scanning_label.place(x=int(self.res_width) * 0.2, y=int(self.res_height) * 0.4)
        if not state:
            scanning_label.place_forget()

    def check_undefined_steps(self):
        MainFrame.clear_frame()
        self.display_scanning_label(state=True)
        self.incomplete_feature_indexes = []
        for i in range(0, len(self.feature_names)):
            amount_of_undefined_steps = self.has_undefined_steps(self.feature_names[i])
            if str(amount_of_undefined_steps) > str(0):
                self.incomplete_feature_indexes.extend(str(i))

    def browse_features_path(self):
        """ Open the File Explorer and select the features folder """
        self.features_folder = filedialog.askdirectory()
        if self.features_folder:
            logging.info("Features Folder Selected: '" + str(self.features_folder) + "'")
            self.feature_names = MainFrame.list_feature_file_names(folder=self.features_folder)
            if self.feature_names:
                # t1 = threading.Thread(target=self.check_undefined_steps)
                # t2 = threading.Thread(target=lambda state=True: self.display_warning_label(state=state))
                # t1.start()
                self.check_undefined_steps()
                if self.incomplete_feature_indexes:
                    MainFrame.clear_frame()
                    self.display_warning_label(state=True)
                    self.tk_wait(3000)
                    self.display_warning_label(state=False)
                #
                MainFrame.clear_frame()
                self.display_features_listbox(state=True, listbox_content=self.feature_names)
                for index in self.incomplete_feature_indexes:
                    self.filter_features_listbox.itemconfig(index, {'fg': 'red'})
                self.filtered_tags = []
                self.display_tags_listbox(state=False, listbox_content=None)
                self.filtered_scenarios = []
                self.display_scenarios_listbox(state=False, listbox_content=None)
                self.display_instructions_label(state=False)
                self.display_behave_command(state=False, command="")
                self.display_reset_button(state=False)
                self.display_path_browser(state=False)
            else:
                logging.warning("Selected folder contains no feature files!")
                MainFrame.clear_frame()
                self.display_instructions_label(state=True)
        if self.features_folder == '':
            logging.warning("No features folder selected!")
            MainFrame.clear_frame()
            self.display_instructions_label(state=True)

    def display_features_listbox(self, state, listbox_content):
        if state:
            self.filter_features_label.place(x=int(self.res_width) * 0.025, y=int(self.res_height) * 0.05)
            self.filter_features_listbox.place(
                x=int(self.res_width) * 0.025,
                y=int(self.res_height) * 0.1,
                height=300,
                width=260,
            )
            self.filter_features_listbox.delete(0, tk.END)
            listbox_content.sort()
            self.filter_features_listbox.insert(tk.END, *listbox_content)
            self.filter_features_listbox.bind('<<ListboxSelect>>',
                                              lambda event: self.on_select_features(event))
        if not state:
            self.filter_features_listbox.place_forget()
            self.filter_features_label.place_forget()
            self.filter_features_listbox.delete(0, tk.END)

    def display_tags_listbox(self, state, listbox_content):
        if state:
            self.filter_tags_label.place(x=int(self.res_width) * 0.347, y=int(self.res_height) * 0.05)
            self.filter_tags_listbox.place(
                x=int(self.res_width) * 0.347,
                y=int(self.res_height) * 0.1,
                height=300,
                width=260,
            )
            self.filter_tags_listbox.delete(0, tk.END)
            listbox_content.sort()
            self.filter_tags_listbox.insert(tk.END, *listbox_content)
            self.filter_tags_listbox.bind('<<ListboxSelect>>',
                                          lambda event: self.on_select_tags(event))
        if not state:
            self.filter_tags_listbox.place_forget()
            self.filter_tags_label.place_forget()
            self.filter_tags_listbox.delete(0, tk.END)

    def display_scenarios_listbox(self, state, listbox_content):
        if state:
            self.filter_scenarios_label.place(x=int(self.res_width) * 0.67, y=int(self.res_height) * 0.05)
            self.filter_scenarios_listbox.place(
                x=int(self.res_width) * 0.67,
                y=int(self.res_height) * 0.1,
                height=300,
                width=260,
            )
            self.filter_scenarios_listbox.delete(0, tk.END)
            listbox_content.sort()
            self.filter_scenarios_listbox.insert(tk.END, *listbox_content)
            self.filter_scenarios_listbox.bind('<<ListboxSelect>>',
                                               lambda event: self.on_select_scenarios(event))
        if not state:
            self.filter_scenarios_listbox.place_forget()
            self.filter_scenarios_label.place_forget()
            self.filter_scenarios_listbox.delete(0, tk.END)

    def on_select_features(self, event):
        # Get Selected Features
        self.selected_features = MainFrame.get_selected_listbox_items(self.filter_features_listbox)
        # Get Tags for selected Features
        self.filtered_tags = []
        for feature_file_name in self.selected_features:
            feature_file_path = os.path.join(self.features_folder, feature_file_name).replace('\\', '/')
            self.filtered_tags.extend(MainFrame.list_feature_file_tags(feature_file_path=feature_file_path))
        self.filtered_tags = MainFrame.remove_redundancies(self.filtered_tags)
        self.display_tags_listbox(state=True, listbox_content=self.filtered_tags)
        # Get Scenarios for selected Features
        self.filtered_scenarios = []
        for feature_file_name in self.selected_features:
            feature_file_path = os.path.join(self.features_folder, feature_file_name).replace('\\', '/')
            self.filtered_scenarios.extend(MainFrame.list_scenario_names(feature_file_path=feature_file_path))
        self.filtered_scenarios = MainFrame.remove_redundancies(self.filtered_scenarios)
        self.filtered_scenarios = MainFrame.reformat_scenario_names(self.filtered_scenarios)
        self.display_scenarios_listbox(state=True, listbox_content=self.filtered_scenarios)
        # Set Behave Command
        if self.selected_features:
            command = self.selection_to_behave_command(command_type="Features")
            self.display_behave_command(state=True, command=command)
            self.display_path_browser(state=True)
            self.display_reset_button(state=True)
            self.report_checkbox_var.set(False)
            self.json_switch()

    def on_select_tags(self, event):
        self.selected_tags = MainFrame.get_selected_listbox_items(self.filter_tags_listbox)
        self.selected_tags.sort()
        if self.selected_tags:
            command = self.selection_to_behave_command(command_type="Tags")
            self.display_behave_command(state=True, command=command)
            self.display_path_browser(state=True)
            self.display_reset_button(state=True)
            self.report_checkbox_var.set(False)
            self.json_switch()

    def on_select_scenarios(self, event):
        self.selected_scenarios = MainFrame.get_selected_listbox_items(self.filter_scenarios_listbox)
        self.selected_scenarios.sort()
        if self.selected_scenarios:
            command = self.selection_to_behave_command(command_type="Scenarios")
            self.display_behave_command(state=True, command=command)
            self.display_path_browser(state=True)
            self.display_reset_button(state=True)
            self.report_checkbox_var.set(False)
            self.json_switch()

    def display_behave_command(self, state, command):
        if state:
            # Place Textbox
            self.behave_command_label.place(x=int(self.res_width) * 0.025, y=int(self.res_height) * 0.75)
            self.behave_command_text.place(x=int(self.res_width) * 0.025, y=int(self.res_height) * 0.8)
            self.behave_command_text.config(state='normal', width=40, height=3)
            self.behave_command_text.delete('1.0', tk.END)
            self.behave_command_text.insert(tk.END, str(command))
            # Place Button
            self.execute_test_button.place(x=int(self.res_width) * 0.42, y=int(self.res_height) * 0.857)
            self.execute_test_button.config(text="Execute", command=self.execute_behave_command, bg="green", fg="white")
        if not state:
            self.behave_command_text.delete('1.0', tk.END)
            self.behave_command_text.place_forget()
            self.behave_command_label.place_forget()
            self.execute_test_button.place_forget()

    def display_reset_button(self, state):
        if state:
            self.reset_button.place(x=int(self.res_width) * 0.5, y=int(self.res_height) * 0.857)
            self.reset_button.config(text="Reset System", command=self.execute_behave_backgrounds)
        if not state:
            self.reset_button.place_forget()

    def display_path_browser(self, state):
        if state:
            #
            self.report_path_label.config(text="Report Path")
            self.report_path_label.place(x=int(self.res_width) * 0.5, y=int(self.res_height) * 0.75)
            #
            self.report_path_entry.insert(0, str(self.features_folder))
            #
            self.report_path_entry.place(x=int(self.res_width) * 0.505, y=int(self.res_height) * 0.8)
            self.report_path_entry.config(width=65, state='readonly')
            #
            self.report_button.place(x=int(self.res_width) * 0.91, y=int(self.res_height) * 0.86)
            self.report_button.config(text="Browse", command=self.browse_report_path)
            #
            self.report_checkbox.place(x=int(self.res_width) * 0.7, y=int(self.res_height) * 0.86)
            self.report_checkbox.config(text='Generate Test Report', command=self.json_switch)
        if not state:
            self.report_button.place_forget()
            self.report_path_label.place_forget()
            self.report_path_entry.place_forget()
            self.report_checkbox.place_forget()

    def browse_report_path(self):
        self.report_path = filedialog.askdirectory()
        self.report_path_entry.config(state='normal')
        self.report_path_entry.delete(0, tk.END)
        self.report_path_entry.insert(0, str(self.report_path))
        self.report_path_entry.config(state='readonly')

    def destroy_about_window(self):
        self.about_window.destroy()
        self.about_window_is_open = False

    def display_about_window(self):
        if not self.about_window_is_open:
            self.about_window = tk.Toplevel(root)
            self.about_window.geometry('220x120+' + str(root.winfo_x() + 100) + '+' + str(root.winfo_y() + 100))
            # Change directory to Script's path
            abspath = os.path.abspath(__file__)
            script_folder = os.path.dirname(abspath)
            os.chdir(script_folder)
            # self.about_window.iconbitmap('schindler.ico')
            self.about_window.title('About')
            label = tk.Label(self.about_window,
                             text="\nAll rights reserved by:\n©Schindler Aufzüge AG\n"
                                  "Contact: mate.gal@schindler.com\nVersion: Alpha")
            label.pack()
            button = tk.Button(self.about_window, text='OK', command=lambda: self.destroy_about_window())
            button.pack()
            self.about_window.wm_attributes("-topmost", 1)
            self.about_window_is_open = True

    @staticmethod
    def get_selected_listbox_items(listbox):
        selected_items = []
        for element in listbox.curselection():
            selected_items.append(listbox.get(element))
        return selected_items

    @staticmethod
    def clear_frame():
        logging.info("Destroying all widgets")
        try:
            for widget in MainFrame.winfo_children(root):
                widget.place_forget()
        except Exception as e:
            logging.info("Could not clear frame. Exception:\n" + str(e))

    """
            LISTING METHODS
    """

    @staticmethod
    def list_scenario_names(feature_file_path):
        """ List all scenario names of a feature file """
        scenario_names = []
        try:
            with open(feature_file_path) as file:
                for line in file:
                    if 'Scenario' in line:
                        scenario_names.append(line[:-1])
            return scenario_names
        except Exception as e:
            logging.error("The following exception occurred: " + str(e))
            logging.error("Could not open file: '" + str(feature_file_path) + "'")

    @staticmethod
    def list_feature_file_tags(feature_file_path):
        """ List all tags of a feature file """
        tags = []
        try:
            with open(feature_file_path) as file:
                for line in file:
                    words = line.split()
                    for word in words:
                        if word.startswith('@'):
                            tags.append(word)
            return tags
        except Exception as e:
            logging.error("The following exception occurred: " + str(e))
            logging.error("Could not open file: '" + str(feature_file_path) + "'")

    @staticmethod
    def list_feature_file_names(folder):
        """ List all feature file names in a given folder """
        features = []
        try:
            for file in os.listdir(folder):
                if file.endswith('.feature'):
                    features.append(file)
            return features
        except Exception as e:
            logging.error("The following exception occurred: " + str(e))
            logging.error("Could not open folder: '" + str(folder) + "'")

    """
            MISCELLANEOUS METHODS 
    """

    def execute_behave_backgrounds(self):
        os.chdir(self.features_folder)
        command = 'behave --tags @BehaveResetProcedure --no-skipped'
        os.system("start /B start cmd.exe @cmd /k " + str(command))

    def tk_wait(self, timeout):
        var = tk.IntVar()
        root.after(timeout, var.set, 1)
        print("Waiting " + str(timeout) + " milliseconds ...")
        root.wait_variable(var)

    def has_undefined_steps(self, feature_name):
        """ Receives a feature name and
            returns and integer that represents
            the amount of undefined steps """
        command = 'behave -k --dry-run --summary "' + str(feature_name) + '"'
        os.chdir(self.features_folder)
        try:
            output = subprocess.check_output(command, universal_newlines=True)
            words = output.split(' ')
            for i in range(0, len(words)):
                if 'undefined' in words[i]:
                    return words[i - 1]
        except Exception as e:
            logging.warning('The following exception occurred: ' + str(e))

    @staticmethod
    def pretty_print_the_dict(dictionary):
        """ Printing a dictionary readably """
        for key in dictionary:
            value = dictionary[key]
            print(key)
            for i in range(0, len(value)):
                print('\t' + value[i])

    @staticmethod
    def reformat_scenario_names(scenario_names):
        split_names = []
        for scenario_name in scenario_names:
            # split_names.extend(str(scenario_name).split('Scenario: ')[1:])
            if 'Scenario:' in scenario_name:
                split_names.extend(str(scenario_name).split('Scenario:')[1:])
            if 'Scenario Outline:' in scenario_name:
                split_names.extend(str(scenario_name).split('Scenario Outline:')[1:])
        formatted_names = []
        for name in split_names:
            formatted_names.append(name[1:])
        return formatted_names

    @staticmethod
    def subtract_lists(list1, list2):
        """ This method will remove the elements of the second list from the first list and return it """
        return [item for item in list1 if item not in list2]

    def json_switch(self):
        box_checked = self.report_checkbox_var.get()
        command = self.behave_command_text.get('1.0', tk.END)
        if box_checked and not self.is_json_added:
            self.is_json_added = True
            # add json switch
            now = datetime.now().strftime('%Y_%B_%d_%H%M%S')
            report_path = self.report_path_entry.get()
            json_extension = ' -f html -o ' + str(os.path.join(report_path, now).replace('\\', '/')) + '.html'
            command += json_extension
            command = command.rstrip()
            command = command.replace('\n', '')
            self.behave_command_text.delete('1.0', tk.END)
            self.behave_command_text.insert(tk.END, str(command))
        if not box_checked and self.is_json_added:
            self.is_json_added = False
            # remove json switch
            start_word = ' -f'
            end_word = '.html'
            start_index = command.find(start_word)
            end_index = command.find(end_word)
            json_switch = command[:start_index] + command[end_index+len(end_word):]
            command = json_switch.rstrip()
            self.behave_command_text.delete('1.0', tk.END)
            self.behave_command_text.insert(tk.END, str(command))

    def selection_to_behave_command(self, command_type):
        command = "behave -k"
        for feature_name in self.selected_features:
            command += ' "' + str(feature_name) + '"'
        if command_type == 'Features':
            pass
        if command_type == "Tags":
            command += ' --tags='
            for item in self.selected_tags:
                command += item + ','
            command = command[:-1]
        if command_type == "Scenarios":
            for item in self.selected_scenarios:
                command += ' --name="' + item + '"'
        return command

    def execute_behave_command(self):
        command = self.behave_command_text.get('1.0', tk.END)
        report_path = self.report_path_entry.get()
        is_report_generated = self.report_checkbox_var.get()
        now = datetime.now().strftime('%Y_%B_%d_%H%M%S')
        if is_report_generated:
            # os.chdir(report_path)
            # os.mkdir(now)
            os.chdir(self.features_folder)
            command += '-f json.pretty -o ' + str(os.path.join(report_path, now).replace('\\', '/')) + '.json'
            os.system("start /B start cmd.exe @cmd /k " + str(command))
        if not is_report_generated:
            os.system("start /B start cmd.exe @cmd /k " + str(command))

    @staticmethod
    def remove_redundancies(my_list):
        """ Remove duplicate list items and return the list """
        return list(dict.fromkeys(my_list))

    @staticmethod
    def close():
        sys.exit(0)

if __name__ == "__main__":
    root = tk.Tk()
    MainFrame(root).pack(side="bottom", fill="both", expand=True)
    root.mainloop()

eature 2022-05-26 07:41:02,065 - flybirds_log - INFO - change behave add_step_definition to flybirds add_step_definition Traceback (most recent call last): File "D:\Programs\anaconda\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\Programs\anaconda\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "D:\Programs\anaconda\Scripts\behave.exe__main.py", line 7, in File "D:\Programs\anaconda\lib\site-packages\behave__main.py", line 183, in main return run_behave(config) File "D:\Programs\anaconda\lib\site-packages\behave__main.py", line 127, in run_behave
failed = runner.run() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 804, in run return self.run_with_paths() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 809, in run_with_paths
self.load_step_definitions() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 796, in load_step_definitions load_step_modules(step_paths) File "D:\Programs\anaconda\lib\site-packages\behave\runner_util.py", line 412, in load_step_modules exec_file(os.path.join(path, name), step_module_globals) File "D:\Programs\anaconda\lib\site-packages\behave\runner_util.py", line 386, in execfile
exec(code, globals
, locals_) File "....\steps\steps.py", line 10, in import pscript.dsl.step.custom_test ModuleNotFoundError: No module named 'pscript.dsl' WARNING:root:The following exception occurred: Command 'behave -k --dry-run --summary "web_cn_page.feature"' returned non-zero exit status 1. 2022-05-26 07:41:03,661 - flybirds_log - INFO - change behave json format feature to flybirds feature 2022-05-26 07:41:03,661 - flybirds_log - INFO - change behave add_step_definition to flybirds add_step_definition Traceback (most recent call last): File "D:\Programs\anaconda\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\Programs\anaconda\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "D:\Programs\anaconda\Scripts\behave.exe__main.py", line 7, in File "D:\Programs\anaconda\lib\site-packages\behave__main.py", line 183, in main return run_behave(config) File "D:\Programs\anaconda\lib\site-packages\behave__main.py", line 127, in run_behave
failed = runner.run() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 804, in run return self.run_with_paths() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 809, in run_with_paths
self.load_step_definitions() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 796, in load_step_definitions load_step_modules(step_paths) File "D:\Programs\anaconda\lib\site-packages\behave\runner_util.py", line 412, in load_step_modules exec_file(os.path.join(path, name), step_module_globals) File "D:\Programs\anaconda\lib\site-packages\behave\runner_util.py", line 386, in execfile
exec(code, globals
, locals_) File "....\steps\steps.py", line 10, in import pscript.dsl.step.custom_test ModuleNotFoundError: No module named 'pscript.dsl' WARNING:root:The following exception occurred: Command 'behave -k --dry-run --summary "web_cn_record.feature"' returned non-zero exit status 1. 2022-05-26 07:41:05,286 - flybirds_log - INFO - change behave json format feature to flybirds feature 2022-05-26 07:41:05,286 - flybirds_log - INFO - change behave add_step_definition to flybirds add_step_definition Traceback (most recent call last): File "D:\Programs\anaconda\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\Programs\anaconda\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "D:\Programs\anaconda\Scripts\behave.exe__main.py", line 7, in File "D:\Programs\anaconda\lib\site-packages\behave__main__.py", line 183, in main return run_behave(config) File "D:\Programs\anaconda\lib\site-packages\behave\main__.py", line 127, in run_behave
failed = runner.run() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 804, in run return self.run_with_paths() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 809, in run_with_paths
self.load_step_definitions() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 796, in load_step_definitions load_step_modules(step_paths) File "D:\Programs\anaconda\lib\site-packages\behave\runner_util.py", line 412, in load_step_modules exec_file(os.path.join(path, name), step_module_globals) File "D:\Programs\anaconda\lib\site-packages\behave\runner_util.py", line 386, in execfile
exec(code, globals
, locals_) File "....\steps\steps.py", line 10, in import pscript.dsl.step.custom_test ModuleNotFoundError: No module named 'pscript.dsl' WARNING:root:The following exception occurred: Command 'behave -k --dry-run --summary "web_cn_select.feature"' returned non-zero exit status 1. 2022-05-26 07:41:06,864 - flybirds_log - INFO - change behave json format feature to flybirds feature 2022-05-26 07:41:06,864 - flybirds_log - INFO - change behave add_step_definition to flybirds add_step_definition Traceback (most recent call last): File "D:\Programs\anaconda\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\Programs\anaconda\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "D:\Programs\anaconda\Scripts\behave.exe\
main.py", line 7, in File "D:\Programs\anaconda\lib\site-packages\behave\main__.py", line 183, in main return run_behave(config) File "D:\Programs\anaconda\lib\site-packages\behave\
main__.py", line 127, in run_behave
failed = runner.run() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 804, in run return self.run_with_paths() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 809, in run_with_paths
self.load_step_definitions() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 796, in load_step_definitions load_step_modules(step_paths) File "D:\Programs\anaconda\lib\site-packages\behave\runner_util.py", line 412, in load_step_modules exec_file(os.path.join(path, name), step_module_globals) File "D:\Programs\anaconda\lib\site-packages\behave\runner_util.py", line 386, in execfile
exec(code, globals
, locals_) File "....\steps\steps.py", line 10, in import pscript.dsl.step.custom_test ModuleNotFoundError: No module named 'pscript.dsl' WARNING:root:The following exception occurred: Command 'behave -k --dry-run --summary "web_cn_swipe.feature"' returned non-zero exit status 1. 2022-05-26 07:41:08,470 - flybirds_log - INFO - change behave json format feature to flybirds feature 2022-05-26 07:41:08,470 - flybirds_log - INFO - change behave add_step_definition to flybirds add_step_definition Traceback (most recent call last): File "D:\Programs\anaconda\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\Programs\anaconda\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "D:\Programs\anaconda\Scripts\behave.exe\main.py", line 7, in File "D:\Programs\anaconda\lib\site-packages\behave\main__.py", line 183, in main return run_behave(config) File "D:\Programs\anaconda\lib\site-packages\behave\main__.py", line 127, in run_behave
failed = runner.run() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 804, in run return self.run_with_paths() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 809, in run_with_paths
self.load_step_definitions() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 796, in load_step_definitions load_step_modules(step_paths) File "D:\Programs\anaconda\lib\site-packages\behave\runner_util.py", line 412, in load_step_modules exec_file(os.path.join(path, name), step_module_globals) File "D:\Programs\anaconda\lib\site-packages\behave\runner_util.py", line 386, in execfile
exec(code, globals
, locals_) File "....\steps\steps.py", line 10, in import pscript.dsl.step.custom_test ModuleNotFoundError: No module named 'pscript.dsl' WARNING:root:The following exception occurred: Command 'behave -k --dry-run --summary "web_cn_verify.feature"' returned non-zero exit status 1. 2022-05-26 07:41:10,049 - flybirds_log - INFO - change behave json format feature to flybirds feature 2022-05-26 07:41:10,049 - flybirds_log - INFO - change behave add_step_definition to flybirds add_step_definition Traceback (most recent call last): File "D:\Programs\anaconda\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\Programs\anaconda\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "D:\Programs\anaconda\Scripts\behave.exe\main.py", line 7, in File "D:\Programs\anaconda\lib\site-packages\behave\main__.py", line 183, in main return run_behave(config) File "D:\Programs\anaconda\lib\site-packages\behave\main__.py", line 127, in run_behave
failed = runner.run() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 804, in run return self.run_with_paths() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 809, in run_with_paths
self.load_step_definitions() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 796, in load_step_definitions load_step_modules(step_paths) File "D:\Programs\anaconda\lib\site-packages\behave\runner_util.py", line 412, in load_step_modules exec_file(os.path.join(path, name), step_module_globals) File "D:\Programs\anaconda\lib\site-packages\behave\runner_util.py", line 386, in execfile
exec(code, globals
, locals_) File "....\steps\steps.py", line 10, in import pscript.dsl.step.custom_test ModuleNotFoundError: No module named 'pscript.dsl' WARNING:root:The following exception occurred: Command 'behave -k --dry-run --summary "web_en_click.feature"' returned non-zero exit status 1. self.load_step_definitions() File "D:\Programs\anaconda\lib\site-packages\behave\runner.py", line 796, in load_step_definitions load_step_modules(step_paths) File "D:\Programs\anaconda\lib\site-packages\behave\runner_util.py", line 412, in load_step_modules exec_file(os.path.join(path, name), step_module_globals) File "D:\Programs\anaconda\lib\site-packages\behave\runner_util.py", line 386, in execfile
exec(code, globals
, locals_) File "....\steps\steps.py", line 10, in import pscript.dsl.step.custom_test ModuleNotFoundError: No module named 'pscript.dsl' Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8-sig'>
OSError: [Errno 22] Invalid argument $

这个是什么引入的 Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8-sig'>

wanghaisheng commented 2 years ago

https://github.com/behave/behave/commit/f5d7a5b97c1df8f800dd165bd5a56cbd42e5e719

从这里看 behave本身应该没有问题才对 那是我们调用的问题?

clgwlg commented 2 years ago

这个错误是flybirds内部对json解码时抛出的异常,v0.2.3版本,本周会上线,增加了BOM值解码的处理逻辑。 由于我们本地暂时无法重现,麻烦你到时试一下,是否还存在这个异常。

wanghaisheng commented 2 years ago

@clgwlg 你们的windows 10 机器没有出现过这种问题吗 也不是vscode引入的 powershell测试了

那就是windows系统环境了

chase001 commented 2 years ago

昨天试用你们项目,也存在同样的问题

2022-06-09 14:58:46,534 - flybirds_log - INFO - report cmd:node E:\chase_code\AutoTestPC\gsol-pc_-auto-test\venv\lib\site-packages\flybirds\report\nodereport\report.js report\18767f45-9780-4f4d-98bc-decdfca54c95 report\18767f45-9 780-4f4d-98bc-decdfca54c95 web multiple-cucumber-html-reporter platform: web lodash.templateSources[1]:10 .each(suite.features[0].metadata, function(metadatum, metadatumIndex) { ; ^

TypeError: Cannot read property 'metadata' of undefined at eval (lodash.templateSources[1]:10:27) at _createFeaturesOverviewIndexPage (E:\chase_code\AutoTestPC\gsol-pc_-auto-test\venv\lib\site-packages\flybirds\report\node_report\node_modules\multiple-cucumber-html-reporter\lib\generate-report.js:455:84) at Object.generateReport [as generate] (E:\chase_code\AutoTestPC\gsol-pc_-auto-test\venv\lib\site-packages\flybirds\report\node_report\node_modules\multiple-cucumber-html-reporter\lib\generate-report.js:139:3) at Object. (E:\chase_code\AutoTestPC\gsol-pc_-auto-test\venv\lib\site-packages\flybirds\report\node_report\report.js:46:8) at Module._compile (internal/modules/cjs/loader.js:1068:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10) at Module.load (internal/modules/cjs/loader.js:933:32) at Function.Module._load (internal/modules/cjs/loader.js:774:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47 (venv) PS E:\chase_code\AutoTestPC\gsol-pc_-auto-test> flybirds run -D platform=web -P features/test/web

wanghaisheng commented 2 years ago

windows吗 换虚拟机

clgwlg commented 2 years ago

v0.2.4 版本,增加了对应的处理,请问你的版本是? 比较尴尬的是,我们本地的windows10, 没有复现这个问题。