Skip to content

Commit

Permalink
Click refresh when minion is down
Browse files Browse the repository at this point in the history
  • Loading branch information
maximenoel8 committed Mar 4, 2025
1 parent 90b06e3 commit bfaae7a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion testsuite/features/step_definitions/common_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 6 additions & 1 deletion testsuite/features/step_definitions/navigation_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bfaae7a

Please sign in to comment.