Thanks for the suggestions, many ways to skin a cat! Oscar, I understand
your point about an element existing but can still be not visible.
Interestingly, both 'should_be present' method caused problems:
undefined method `present?' for []:Array (NoMethodError)
Both "on(LoginPage).signout_eleme
The page object gem automatically creates a method for checking existence -
see the docs
http://rubydoc.info/github/cheezy/page-object/master/PageObject/Accessors#link-instance_method.
So for:
link(:signout, :text => 'Sign Out')
There should be able to do:
signout?
- Justin Ko
On Friday, N
Try this:
Then /^I should have access to my account$/ do
on(LoginPage).signout_element.should exist
end
Explanation:
on(LoginPage).signout # clicks the link
on(LoginPage).signout_element # returns the link
More information:
https://github.com/cheezy/page-object/wiki/Elements
Željko
--
filip
this kind of test honestly confuses me
I understand you want to check to see if the link exists
so why not do that instead of calling a method to check to see if it exists
and then checking to see if that method returns true
I dont use page_object but I think this is the right syntax
(on(LoginPag
Hi,
I can't figure this out. I am trying to verify a links exists on a page,
after user logs in, using .exists? method. It works when I
use @browser.link(:text => "Sign Out") . to define the element but i want
define link using PageObjedt gem using link(:signout, :text => 'Sign Out')
Any ideas