require "selenium-webdriver"
require "test/unit"

driver = Selenium::WebDriver.for :firefox
driver.navigate.to "http://www.mspy.com/buynow.html"

 # Bas3m = driver.find_element(:xpath => "//*[@id='buyP']/aside[1]/div[1]/div[2]/form/div[1]/div/div[2]/div").text
 # puts Bas3m
 # p = "$59.99".eql? Bas3m
def verify(&blk)
  yield
  rescue MiniTest::Assertion => driver.find_element(:xpath => "//*[@id='buyP']/aside[1]/div[1]/div[2]/form/div[1]/div/div[2]/div").text
  @verification_errors << "$59.99"
end

driver.quit

#Asserting whether the registration success message is diaplyed
# SuccessMessage = driver.find_element(:css, "p.message")
# "Registration complete. Please check your e-mail.".eql? SuccessMessage.text
# puts "Successfully completed the user registration and validated the Success message"