Controller: Stop Actions - convio/watirmark GitHub Wiki

This feature allows the tester to stop the controller during a verify, edit, or create when a condition is met. These are available for the #create, #edit, and #verify methods.

For example:

c = DonationUser.new(DonationUserModel.new)
c.verify_until {  DonationUserBillingView.zip.present?  }
c.edit_until   {  DonationUserBillingView.zip.present?  }
c.create_until {  DonationUserBillingView.zip.present?  }

When the block, DonationUserBillingView.zip.present? evaluates to true, the controller will not populate_data or verify_data and will stay on the page.

After a page load, this checker will throw :stop_condition_met once the block evaluates to true. :stop_condition_met is then caught, which allows the method verify/edit/create_until to stop and the tester can continue testing with the current page.

If the block of code is either empty or never evaluates to true, then the method will raise Watirmark::TestError, "Expected a stop condition but no stop condition met!"