From b16cf4b61d3b715bde3f6e4dc776711a820e97f9 Mon Sep 17 00:00:00 2001 From: Dominik Gedon Date: Thu, 5 Oct 2023 13:37:29 +0200 Subject: [PATCH] QE: Fix Recurring Actions test The events have to be scheduled a bit more in the future, otherwise they will not get picked up because they were created at the same time they will get executed, which does not work. Furthermore, I adjusted the get_future_time() method according to the following: ```bash Time (Hour, Minute, Second, Subsecond): %H - Hour of the day, 24-hour clock, zero-padded (00..23) %k - Hour of the day, 24-hour clock, blank-padded ( 0..23) ``` This method was only used in package installation tests, which I tested with my new changes. I also make use of this method in one of the steps used in our Recurring Actions tests to prevent code duplication. Signed-off-by: Dominik Gedon --- .../features/secondary/min_recurring_action.feature | 12 ++++++------ .../features/step_definitions/datepicker_steps.rb | 2 +- .../features/step_definitions/navigation_steps.rb | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/testsuite/features/secondary/min_recurring_action.feature b/testsuite/features/secondary/min_recurring_action.feature index 98611848f188..d5c649091a49 100644 --- a/testsuite/features/secondary/min_recurring_action.feature +++ b/testsuite/features/secondary/min_recurring_action.feature @@ -29,7 +29,7 @@ Feature: Recurring Actions And I select "Custom state" from "actionTypeDescription" And I wait until I see "Configure states to execute" text And I check radio button "schedule-daily" - And I enter 1 minutes from now as "time-daily_time" + And I enter 2 minutes from now as "time-daily_time" And I check "statechannel-recurring-cbox" And I click on "Save Changes" And I wait until I see "Edit State Ranks" text @@ -50,7 +50,7 @@ Feature: Recurring Actions When I click the "IP forwarding custom state recurring action" item edit button And I wait until I see "Update Schedule" text And I enter "custom_state_schedule_name_changed" as "scheduleName" - And I enter 1 minutes from now as "time-daily_time" + And I enter 2 minutes from now as "time-daily_time" And I uncheck "statechannel-recurring-cbox" And I check "Sync States-cbox" And I click on "Save Changes" @@ -94,7 +94,7 @@ Feature: Recurring Actions And I enter "Minion Highstate Recurring Action" as "scheduleName" And I select "Highstate" from "actionTypeDescription" And I check radio button "schedule-daily" - And I enter 1 minutes from now as "time-daily_time" + And I enter 2 minutes from now as "time-daily_time" And I click on the "disabled" toggler And I click on "Create Schedule" Then I wait until I see "Schedule successfully created" text @@ -180,7 +180,7 @@ Feature: Recurring Actions And I select "Custom state" from "actionTypeDescription" And I wait until I see "Configure states to execute" text And I check radio button "schedule-daily" - And I enter 1 minutes from now as "time-daily_time" + And I enter 2 minutes from now as "time-daily_time" And I check "Update System-cbox" And I click on "Save Changes" And I wait until I see "Edit State Ranks" text @@ -245,7 +245,7 @@ Feature: Recurring Actions And I select "Custom state" from "actionTypeDescription" And I wait until I see "Configure states to execute" text And I check radio button "schedule-daily" - And I enter 1 minutes from now as "time-daily_time" + And I enter 2 minutes from now as "time-daily_time" And I click on the "disabled" toggler And I check "Package Profile Update-cbox" And I click on "Save Changes" @@ -303,7 +303,7 @@ Feature: Recurring Actions And I wait until I see "Configure states to execute" text And I enter "schedule_name" as "scheduleName" And I check radio button "schedule-daily" - And I enter 1 minutes from now as "time-daily_time" + And I enter 2 minutes from now as "time-daily_time" And I click on the "disabled" toggler And I check "Hardware Profile Update-cbox" And I click on "Save Changes" diff --git a/testsuite/features/step_definitions/datepicker_steps.rb b/testsuite/features/step_definitions/datepicker_steps.rb index 9561b2b88bae..d41d9cd10340 100644 --- a/testsuite/features/step_definitions/datepicker_steps.rb +++ b/testsuite/features/step_definitions/datepicker_steps.rb @@ -12,7 +12,7 @@ def get_future_time(minutes_to_add) now = Time.new future_time = now + 60 * minutes_to_add.to_i - future_time.strftime('%k:%M').to_s.strip + future_time.strftime('%H:%M').to_s.strip end Given(/^I pick "([^"]*)" as date$/) do |desired_date| diff --git a/testsuite/features/step_definitions/navigation_steps.rb b/testsuite/features/step_definitions/navigation_steps.rb index 3cef134e6af2..982196c30de5 100644 --- a/testsuite/features/step_definitions/navigation_steps.rb +++ b/testsuite/features/step_definitions/navigation_steps.rb @@ -248,9 +248,9 @@ end When(/^I enter (\d+) minutes from now as "([^"]*)"$/) do |minutes_to_add, field| - future_time = Time.now + 60 * minutes_to_add.to_i - future_time.strftime('%H:%M').to_s.strip + future_time = get_future_time(minutes_to_add) fill_in(field, with: future_time, fill_options: { clear: :backspace }) + log "Execution time: #{future_time}" end When(/^I enter "([^"]*)" as "([^"]*)" text area$/) do |arg1, arg2|