Then(/^I should (|not )see the withhold royalties options$/) do |truth|
  # Non mech-admin vendors should not see the withold royalties options, mech admins should see them.
  eventually(timeout: 5) do
    expect(on(Project::ProductPublishingPage).withhold_royalties?).to be truth == "" ? true : false
  end
end

When(/^I choose to withhold publishing royalties$/) do
  on(Project::ProductPublishingPage).select_third_party_publisher_yes
end

Then(/^I should see publishers as a required field$/) do
  expect(on(Project::ProductPublishingPage).error_message?).to be true
  # Step below prevents JS popups from appearing if navigating to a different page after this scenario
  step "I am on the Project::ProductPublishingPage for the product #{@product_id}"
end
