Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions examples/tests/cases/case_before_after_case.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ TestBeforeCaseError:
Role: command1
Value: echo $VAR_1

TestAfterCaseDoubleError:
ParallelRoles: true
Roles:
- Role: desktopChrome
App: desktop
- Role: command1
App: command
Vars:
TEST_VAR: "var_greater"
TEST_VAR_NUMBERS: 5
Aftercases:
- DesktopCaseError2
Actions:
- Type: case
Value: DesktopCaseError
Role: $AND_CLI_MAINROLE$

# HELPER CASES

DesktopPreCaseError:
Expand All @@ -30,6 +47,10 @@ DesktopPreCaseError:
Role: $AND_CLI_MAINROLE$

DesktopCaseError:
Roles:
- Role: desktopChrome
App: desktop
Step: case with an error
ParallelRoles: true
Actions:
- Type: navigate
Expand All @@ -51,6 +72,32 @@ DesktopCaseError:
Value: DesktopCaseError
Role: $AND_CLI_MAINROLE$

DesktopCaseError2:
Roles:
- Role: desktopChrome
App: desktop
Step: case with an error
ParallelRoles: true
Actions:
- Type: navigate
Role: desktopChrome
Value: http://google.com
- Type: click
Role: desktopChrome
Condition:
- Value: 3
Operation: visible
Result: true
Raise: true
Strategy: id
CheckTime: 5
Id: false_id_2
- Type: sleep
Time: 2
- Type: case
Value: DesktopCaseError
Role: $AND_CLI_MAINROLE$

AfterCase:
Actions:
- Type: navigate
Expand Down
4 changes: 2 additions & 2 deletions lib/core/case_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def run(case_name, parent_params = {})
steps["Aftercases"].each do |after_case|
begin
run(convert_value(after_case))
rescue => e
log_warn("After Case '#{after_case}' Error: #{e.message}")
rescue => e_after
log_warn("After Case '#{after_case}' Error: #{e_after.message}")
end
end
end
Expand Down