Skip to content

Commit e6b2674

Browse files
authored
Merge pull request opf#18132 from opf/fix-flaky-spec
Update the toggle_scheduling_mode to wait until the Manual/Automatic toggle reloads the page.
2 parents d145c1d + 5c1787f commit e6b2674

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec/features/work_packages/scheduling/scheduling_mode_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,14 @@ def expect_dates(work_package, start_date, due_date)
137137
end
138138

139139
it "can toggle the scheduling mode through the date modal" do
140-
pending "disable this spec until it's being fixed"
141140
expect(wp.schedule_manually).to be_falsey
142141

143142
# Editing the start/due dates of a parent work package is possible if the
144143
# work package is manually scheduled
145144
combined_field.activate!(expect_open: false)
146145
combined_field.expect_active!
147146
combined_field.toggle_scheduling_mode # toggle to manual mode
147+
combined_field.expect_manual_scheduling_mode
148148
combined_field.update(%w[2016-01-05 2016-01-10], save: false)
149149
combined_field.expect_duration 6
150150
combined_field.save!
@@ -184,6 +184,7 @@ def expect_dates(work_package, start_date, due_date)
184184
combined_field.activate!(expect_open: false)
185185
combined_field.expect_active!
186186
combined_field.toggle_scheduling_mode # toggle to automatic mode
187+
combined_field.expect_automatic_scheduling_mode
187188
combined_field.save!
188189

189190
work_packages_page.expect_and_dismiss_toaster message: "Successful update."
@@ -214,9 +215,7 @@ def expect_dates(work_package, start_date, due_date)
214215
combined_field.activate!(expect_open: false)
215216
combined_field.expect_active!
216217
combined_field.toggle_scheduling_mode # toggle to manual mode
217-
218-
# The calendar needs some time to get initialized.
219-
sleep 2
218+
combined_field.expect_manual_scheduling_mode
220219
combined_field.expect_calendar
221220

222221
# Increasing the duration while at it
@@ -254,6 +253,7 @@ def expect_dates(work_package, start_date, due_date)
254253
combined_field.activate!(expect_open: false)
255254
combined_field.expect_active!
256255
combined_field.toggle_scheduling_mode
256+
combined_field.expect_automatic_scheduling_mode
257257
combined_field.save!
258258

259259
work_packages_page.expect_and_dismiss_toaster message: "Successful update."

0 commit comments

Comments
 (0)