Sha256: 114acdce6ad1187f35a2ad485169980c967cda40360da90c2497a4ed496b88d0
Contents?: true
Size: 1.68 KB
Versions: 5
Compression:
Stored size: 1.68 KB
Contents
base = File.expand_path(File.dirname(__FILE__)) require "#{$qa_observer_client}/lib/system_test" class <%= app_name.camelize %>Flows < 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 :login_page, :user_header, :chat, :message_filter, :frames 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. # Example for accessing demo gmail elements #@login_page = Gmail::LoginPageElements.new #@user_header = Gmail::UserHeaderElements.new #@chat = Gmail::ChatElements.new #@message_filter = Gmail::MessageFilterElements.new #@frames = Gmail::CommonFrames.new end def home $browser.goto($test_data[:base_urls][$test_environment][:<%= app_name %>_home]) end # TODO: Add flow methods. Below is an example for gmail login/logout =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). def logout @user_header.logout_link.click if @user_header.logout_link.exists? end def login(params={}) # Direct the user to home page home wait_for(5) { @login_page.more_post_link.exists? } # if we are already logged in logout first logout if @frames.canvas.exists? @login_page.user_input.set(params[:user]) @login_page.password_input.set(params[:password]) @login_page.submit_button.click wait_for(5) { @chat.set_status_link.exists? } end =end end
Version data entries
5 entries across 5 versions & 1 rubygems