Skip to content

Commit 9c8cbdb

Browse files
committed
chore:add switch to screen link to behave
1 parent 3ee1845 commit 9c8cbdb

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: flybirds/core/plugin/plugins/default/screen.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def screen_shot(path):
4747
log.info("[screen_shot] screen shot end!")
4848

4949
@staticmethod
50-
def screen_link_to_behave(scenario, step_index, tag=None):
50+
def screen_link_to_behave(scenario, step_index, tag=None, link=True):
5151
"""
5252
screenshot address and linked to the <scr> tag
5353
The label information is placed in the description of the scene,
@@ -91,7 +91,8 @@ def screen_link_to_behave(scenario, step_index, tag=None):
9191
'embeddingsTags, stepIndex={}, <image class ="screenshot"'
9292
' width="375" src="{}" />'.format(step_index, src_path)
9393
)
94-
scenario.description.append(data)
94+
if link is True:
95+
scenario.description.append(data)
9596
screen_path = os.path.join(current_screen_dir, file_name)
9697
g_Context.screen.screen_shot(screen_path)
9798
return screen_path

Diff for: flybirds/core/plugin/plugins/default/step/common.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def screenshot(context):
2525

2626
def ocr(context):
2727
step_index = context.cur_step_index - 1
28-
image_path = BaseScreen.screen_link_to_behave(context.scenario, step_index, "screen_")
28+
image_path = BaseScreen.screen_link_to_behave(context.scenario, step_index, "screen_", False)
2929
BaseScreen.image_ocr(image_path)
3030

3131

@@ -91,7 +91,7 @@ def img_verify(context, search_image_path):
9191
verify image exist or not
9292
"""
9393
step_index = context.cur_step_index - 1
94-
source_image_path = BaseScreen.screen_link_to_behave(context.scenario, step_index, "screen_")
94+
source_image_path = BaseScreen.screen_link_to_behave(context.scenario, step_index, "screen_", False)
9595
result = BaseScreen.image_verify(source_image_path, search_image_path)
9696
return result
9797

0 commit comments

Comments
 (0)