Sha256: 0c3cae00a5db15f0a7b11864b865b742a40cea960641117b00b2608d83ee290e

Contents?: true

Size: 1.11 KB

Versions: 8

Compression:

Stored size: 1.11 KB

Contents

#!/usr/bin/env ruby
$LOAD_PATH << "./lib"

require "rspec"
# rubocop:disable Style/MixinUsage
include RSpec::Matchers
# rubocop:enable Style/MixinUsage

require "testable"
# rubocop:disable Style/MixinUsage
include Testable::Context
# rubocop:enable Style/MixinUsage

class Home
  include Testable

  url_is "https://veilus.herokuapp.com/"

  p          :login_form, id: "open", visible: true
  text_field :username,   id: "username"
  text_field :password
  button     :login,      id: "login-button"
  div        :message,    class: 'notice'

  def begin_with
    move_to(0, 0)
    resize_to(screen_width, screen_height)
  end
end

class WarpTravel
  include Testable

  url_is "https://veilus.herokuapp.com/warp"

  text_field :warp_factor, id: 'warpInput'
  text_field :velocity,    id: 'velocityInput'
  text_field :distance,    id: 'distInput'
end

Testable.start_browser :firefox

on_visit(Home) do
  @active.login_form.click
  @active.username.set "admin"
  @active.password(id: 'password').set "admin"
  @active.login.click
end

on_visit(WarpTravel).using_data("warp factor": 1, velocity: 1, distance: 4.3)

Testable.quit_browser

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
testable-1.0.0 examples/testable-watir-datasetter.rb
testable-0.10.0 examples/testable-watir-datasetter.rb
testable-0.9.0 examples/testable-watir-datasetter.rb
testable-0.8.0 examples/testable-watir-datasetter.rb
testable-0.7.0 examples/testable-watir-datasetter.rb
testable-0.6.0 examples/testable-watir-datasetter.rb
testable-0.5.0 examples/testable-watir-datasetter.rb
testable-0.4.0 examples/testable-watir-datasetter.rb