Sha256: 1486d0422bb961cfef223563f7a7bc864503c46dfbac330bd832b940b0af96bc

Contents?: true

Size: 998 Bytes

Versions: 2

Compression:

Stored size: 998 Bytes

Contents

module Assertions
	module Gmail

		def assert_logged_in(email,password)
    	visit "http://gmail/com"
    	fill_in "Email", :with => email
    	fill_in "Passwd", :with => password    
			assert_appears("#loading") do
    		click_button "Sign in"   
			end
			wait_until { has_no_css?("#loading") }
    	within_frame "canvas_frame" do			
      	wait_until { has_css?("#gbi4m1", :text => email) }
    	end
  	end

		def assert_logged_out			 
  		within_frame "canvas_frame" do
				find("#gbi4m1").click
				click_link "Sign out"
			end			
			switch_to_main_window
			wait_until { assert has_css?(".signin-box #gaia_loginform") }
		end

  	def assert_email_sent(subject,body,to)
			switch_to_main_window/
			find("div", :text => "Compose mail").click	
			within_frame "canvas_frame" do
      	wait_until { assert has_css?("textarea[name='to']") }
    	end
		end

		protected

		def switch_to_main_window
			page.driver.browser.switch_to.window page.driver.browser.window_handles.first
		end

	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gmail_test-0.0.5 lib/gmail_test/assertions/gmail.rb
gmail_test-0.0.4 lib/gmail_test/assertions/gmail.rb