Sha256: b7cc43ce7d1f4e937b011c65bda6fae1093c317cdc65fcc680dda05719712114

Contents?: true

Size: 1.26 KB

Versions: 4

Compression:

Stored size: 1.26 KB

Contents

base = File.expand_path(File.dirname(__FILE__))
require "#{$qa_observer_client}/lib/system_test"

class DemoFlows < SystemTest
  # provide a means for the flow instance to access the elements.
  # this is handy from the test case perspective as it will have
  # access to the flow's but not the elements directly
  attr_reader :home_page
  def initialize
    # NOTE: Define an instance of an element page 
    # in order for flow methods to be able to access
    # elements.  @login_page is an example the demo
    # login method below utilizes.  It's also a good idea
    # to include in the attr_reader list so that the flows 
    # instance defined in a test class can access the element
    # objects without the need to re-instantiate from the test

    @home_page = Demo::HomePage.new
  end

=begin
  Best Practice: Anytime arriving at a page it's a best practice to wait for
  the last element on the page to load(wait_for).  
=end
  def home
    $browser.goto($test_data[:base_urls][$test_environment][:demo_home])
    wait_for(5) { @home_page.submit_create_file.exists? }
  end

  def create_file(file_name='')
    home
    @home_page.create_file_text_field.set(file_name)
    @home_page.submit_create_file.click
    wait_for(2) { @home_page.file_status.text != '' }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
qa_robusta-0.1.8 qa_observer/sites/demo/flows/demo_flows.rb
qa_robusta-0.1.5 qa_observer/sites/demo/flows/demo_flows.rb
qa_robusta-0.1.4 qa_observer/sites/demo/flows/demo_flows.rb
qa_robusta-0.1.3 qa_observer/sites/demo/flows/demo_flows.rb