Skip to content

Commit

Permalink
QE: Fix Recurring Actions test
Browse files Browse the repository at this point in the history
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 <dominik.gedon@suse.com>
  • Loading branch information
nodeg committed Oct 5, 2023
1 parent 67c5856 commit b16cf4b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions testsuite/features/secondary/min_recurring_action.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion testsuite/features/step_definitions/datepicker_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
4 changes: 2 additions & 2 deletions testsuite/features/step_definitions/navigation_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down

0 comments on commit b16cf4b

Please sign in to comment.