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_element.should exist" and "on(LoginPage).signout?" work now. Thanks. On Saturday, November 3, 2012 2:25:03 AM UTC+11, Justin Ko wrote: > > 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, November 2, 2012 4:46:31 AM UTC-4, Željko Filipin wrote: >> >> 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 >> -- >> filipin.eu >> > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
