When(/^I enter nothing for the required fields$/) do
  # do nothing
end

Then(/^I should get (\d+) errors for all of the required fields missing information$/) do |error_count|
  actual_errors = on(Workstation::CreateMusicVideoModal).errors

  err_string = ""
  actual_errors.each do |err|
    err_string += "#{err.text}, \n"
  end

  puts "The following #{actual_errors.size} errors found: #{err_string}"
  expect(actual_errors.size).to eql error_count.to_i
end

When(/^I add music video basics$/) do
  on(Workstation::CreateMusicVideoModal).populate_music_video_basics(@release_data)
end

Given(/^I have valid music video data( except P-line)?$/) do |p_line|
  exceptions = p_line ? [:p_line] : []
  @release_data = DataHelpers::ReleaseBuilderData.music_video(except: exceptions)
end

Then(/^I should get P\-line error "(.*?)"$/) do |error|
  on(Workstation::CreateMusicVideoModal).verify_first_error(error)
end

Then(/^I should close the Create Release modal$/) do
  on(Workstation::CreateMusicVideoModal).close_create_release_modal_element.click
end
