Skip to content

Commit

Permalink
Merge pull request #24 from ctripcorp/feat_web_new
Browse files Browse the repository at this point in the history
fix: handle Uppercase and lowercase
  • Loading branch information
DHpie authored May 6, 2022
2 parents 92c4039 + 8365380 commit 4a8fc2c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion flybirds/core/config_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def __init__(self, user_data, config):
if device_info.__contains__("webDriverAgent"):
device_driver = device_info["webDriverAgent"]

self.platform = user_data.get("platform", platform)
self.platform = user_data.get("platform", platform).lower()
self.web_driver_agent = device_driver
self.screen_size = None

Expand Down
5 changes: 5 additions & 0 deletions flybirds/core/launch_cycle/run_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ def run_script(run_args):
def need_parallel_run(context):
user_data = get_use_define_param(context, 'platform')
platform = DeviceConfig(user_data, None).platform
# check platform
if platform not in ['ios', 'android', 'web']:
log.warn(f'flybirds is not supports to run on {platform} '
f'platform. It will now run on Android by default.')
platform = "android"
context['cur_platform'] = platform
if 'web' == platform.lower():
return True
Expand Down
4 changes: 2 additions & 2 deletions flybirds/core/plugin/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def run(context):
browser_types = browser_type.split(',')
browser_types = list(set(browser_types))
temp = []
[temp.append(i) for i in browser_types if
i in ['chromium', 'firefox', 'webkit']]
[temp.append(i.strip().lower()) for i in browser_types if
i.strip().lower() in ['chromium', 'firefox', 'webkit']]
if len(temp) == 0:
temp.append('chromium')
user_data['browserType'] = ",".join(temp)
Expand Down
4 changes: 2 additions & 2 deletions flybirds/report/parallel_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ def get_browser_types(context):
browser_types = browser_type.split(',')
browser_types = list(set(browser_types))
temp = []
[temp.append(i) for i in browser_types if
i in ['chromium', 'firefox', 'webkit']]
[temp.append(i.strip().lower()) for i in browser_types if
i.strip().lower() in ['chromium', 'firefox', 'webkit']]
# add default value
if len(temp) == 0:
log.warn(
Expand Down

0 comments on commit 4a8fc2c

Please sign in to comment.