master
 1require_relative "../page_model.rb"
 2
 3class EditWorkoutPage < PageModel
 4  def initialize(workout)
 5    super edit_workout_path(workout)
 6  end
 7
 8  def open_section(exercise)
 9    #click_link(exercise.name)
10  end
11
12  def complete(set:, repetitions: 5)
13    click_map = { 5 => 1, 4 => 2, 3 => 3, 2 => 4, 1 => 5 }
14    click_map[repetitions].times do
15      find_by_id(set.id).click
16      wait_for_ajax
17    end
18  end
19end