From bfaae7a5cee4af51d22ce69036e2908f837da6c2 Mon Sep 17 00:00:00 2001 From: Maxime Noel Date: Fri, 28 Feb 2025 10:54:24 +1300 Subject: [PATCH] Click refresh when minion is down --- testsuite/features/step_definitions/common_steps.rb | 2 +- testsuite/features/step_definitions/navigation_steps.rb | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/testsuite/features/step_definitions/common_steps.rb b/testsuite/features/step_definitions/common_steps.rb index deeca2261881..9903c320ef3c 100644 --- a/testsuite/features/step_definitions/common_steps.rb +++ b/testsuite/features/step_definitions/common_steps.rb @@ -180,7 +180,7 @@ And I follow first "#{event}" And I wait until I see "This action will be executed after" text And I wait until I see "#{event}" text - And I wait at most #{complete_timeout} seconds until the event is completed, refreshing the page + And I wait at most #{complete_timeout} seconds until the "#{event}" is completed, refreshing the page ) end diff --git a/testsuite/features/step_definitions/navigation_steps.rb b/testsuite/features/step_definitions/navigation_steps.rb index 26ebdaaebf8d..3f5d6eed2389 100644 --- a/testsuite/features/step_definitions/navigation_steps.rb +++ b/testsuite/features/step_definitions/navigation_steps.rb @@ -81,12 +81,17 @@ end end -When(/^I wait at most (\d+) seconds until the event is completed, refreshing the page$/) do |timeout| +When(/^I wait at most (\d+) seconds until the "([^"]*)" is completed, refreshing the page$/) do |timeout, event| last = Time.now next if has_content?('This action\'s status is: Completed.', wait: 3) repeat_until_timeout(timeout: timeout.to_i, message: 'Event not yet completed') do break if has_content?('This action\'s status is: Completed.', wait: 3) + + if has_content?('Minion is down or could not be contacted.', wait: 3) + find(:xpath, "//input[@value='Reschedule']").click + step %(I wait 30 seconds until the event is picked up and #{timeout} seconds until the event "#{event}" is completed) + end raise SystemCallError, 'Event failed' if has_content?('This action\'s status is: Failed.', wait: 3) current = Time.now