require 'capybara'
require 'capybara/cucumber'
require 'selenium-webdriver'
require 'site_prism'
require 'rspec'

class ProfileCharacterPage < SitePrism::Page

  element :page_header,                     :css, 'div.phrendHeader'
  element :intro_field,                     :id,  'user_character_greeting'
  element :character1_field,                :id,  'user_character_label_1'
  element :character2_field,                :id,  'user_character_label_2'
  element :character3_field,                :id,  'user_character_label_3'
  element :character4_field,                :id,  'user_character_label_4'
  element :re_take_quiz_link,               :css, "button[class='btn btn-link btn-lg retake font14']"
  element :basic_info_private_profile,      :css, "a.makeProfilePrivate"
  element :basis_info_profile_warning_msg,  :css, "div[role='alert']"
  element :basic_info_pending_profile,      :css, "a[href='/profile/basic_info/visibility/pending_profile']"
  element :basic_info_public_profile,       :css, "a.publishProfile"
  element :basic_info_birth_date_month,     :css, "select[id='user_basic_info_birth_date_month']"
  element :basic_info_birth_date_day,       :css, "input[id='user_basic_info_birth_date_day']"
  element :basic_info_birth_date_year,      :css, "input[id='user_basic_info_birth_date_year']"

  # slider1
  element :slider1_not_at_all,              :css, "a[data-slider='wslider1'][data-value='0']"
  element :slider1_a_little,                :css, "a[data-slider='wslider1'][data-value='1']"
  element :slider1_kind_of,                 :css, "a[data-slider='wslider1'][data-value='2']"
  element :slider1_mostly,                  :css, "a[data-slider='wslider1'][data-value='3']"
  element :slider1_totally,                 :css, "a[data-slider='wslider1'][data-value='4']"

  # slider2
  element :slider2_not_at_all,              :css, "a[data-slider='wslider2'][data-value='1']"
  element :slider2_a_little,                :css, "a[data-slider='wslider2'][data-value='1']"
  element :slider2_kind_of,                 :css, "a[data-slider='wslider2'][data-value='1']"
  element :slider2_mostly,                  :css, "a[data-slider='wslider2'][data-value='1']"
  element :slider2_totally,                 :css, "a[data-slider='wslider2'][data-value='1']"

  # slider3
  element :slider3_not_at_all,              :css, "a[data-slider='wslider3'][data-value='1']"
  element :slider3_a_little,                :css, "a[data-slider='wslider3'][data-value='1']"
  element :slider3_kind_of,                 :css, "a[data-slider='wslider3'][data-value='1']"
  element :slider3_mostly,                  :css, "a[data-slider='wslider3'][data-value='1']"
  element :slider3_totally,                 :css, "a[data-slider='wslider3'][data-value='1']"

  # slider4
  element :slider4_not_at_all,              :css, "a[data-slider='wslider4'][data-value='1']"
  element :slider4_a_little,                :css, "a[data-slider='wslider4'][data-value='1']"
  element :slider4_kind_of,                 :css, "a[data-slider='wslider4'][data-value='1']"
  element :slider4_mostly,                  :css, "a[data-slider='wslider4'][data-value='1']"
  element :slider4_totally,                 :css, "a[data-slider='wslider4'][data-value='1']"


  def describe_characters(character)
    character_fields = [character1_field, character2_field, character3_field, character4_field]
    character_fields.each do |field|
      field.set(character)
    end
  end

  def set_character_weight_by_drag_and_drop(weight)

  end

  def is_basic_info_date_of_birth_disabled
    (basic_info_birth_date_month)[:disabled]
    (basic_info_birth_date_day)[:disabled]
    (basic_info_birth_date_year)[:disabled]
  end

end
