Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions spec/features/projects/create_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,13 @@
# Step 1: Select workspace type
click_on "Continue"

# Step 2: Fill in project details
# Step 2: Fill in project details; wait to ensure Turbo has fully rendered step 2
expect(page).to have_text("2 of") # rubocop:disable RSpec/ExpectInHook
Comment on lines +395 to +396

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely the right strategy for dealing with timing issues.. my only issue is the actual expectation. Can we not scope the text to a particular element or region..

Suggested change
# Step 2: Fill in project details; wait to ensure Turbo has fully rendered step 2
expect(page).to have_text("2 of") # rubocop:disable RSpec/ExpectInHook
expect(page).to have_role(:progressbar, text: "2 of") # rubocop:disable RSpec/ExpectInHook

or (if using a <progress> element itself):

Suggested change
# Step 2: Fill in project details; wait to ensure Turbo has fully rendered step 2
expect(page).to have_text("2 of") # rubocop:disable RSpec/ExpectInHook
expect(page).to have_element(:progress, value: "2") # rubocop:disable RSpec/ExpectInHook

fill_in "Name", with: "Foo bar"
click_on "Continue"

# Step 3: Fill in required custom field
# Step 3: Fill in required custom field; wait to ensure Turbo has fully rendered step 3
expect(page).to have_text("3 of") # rubocop:disable RSpec/ExpectInHook
fill_in "Required Foo", with: "Required value"
end

Expand Down
1 change: 0 additions & 1 deletion spec/features/work_packages/table/switch_types_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ def req_text_field

# Now switch back to a type without the required CF
type_field.activate!
type_field.openSelectField

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not fix the issue. The problem is a race condition in the production code where the schema is expected to be there, but sometimes isn't, on the required custom field.

There is an attempted fix in the form of a PR but I wanted to dig deeper if time permits to find out if the schema access can be safeguarded instead of attempting to address the issue on accessing the schema. But my proposal might already be good enough for now.

type_field.set_value type_task.name

wp_table.expect_and_dismiss_toaster(
Expand Down
Loading