Got a button that changes state when clicked on. But, I cannot "find the button, even when in it's default state.:
Source code:
<div class="alert alert-warning" ng-hide="show_cd_only">
<div class="btn btn-inverse" ng-click="requestCD()">Only Disclose Via CD</div>
<p>Click here to specify that all future disclosures for this loan should be sent via CD instead of LE. If a CD has already been sent, no LEs will be sent regardless of this button action.</p>
</div>
Page Object Source:
class ClosingValidationsReportsPage < GenericBasePage
include DataHelper
element(:onlyDiscloseViaCD) {|b| b.button(xpath: "//div[@id='main']/div/div/div/div/div/div[2]/div/div/div/span/div/div")}
element(:allowLEDisclosures) {|b| b.button(xpath: "//div[@id='main']/div/div/div/div/div/div[2]/div/div/div/span/div[2]/div")}
element(:message) {|b| b.element(xpath: "(//div[@id='flash']/div)[2]")}
end
Selenium-Cucumber source:
And(/^you click on Only Disclose Via CD button$/) do
on(ClosingValidationsReportsPage).onlyDiscloseViaCD.when_present.hover
on(ClosingValidationsReportsPage).onlyDiscloseViaCD.when_present.click
end
Results:
Watir::Wait::TimeoutError: timed out after 30 seconds, waiting for {:xpath=>"//div[@id='main']/div/div/div/div/div/div[2]/div/div/div/span/div/div", :tag_name=>"button"} to become present
./features/step_definitions/closing_interaction.rb:91:in `/^you click on Only Disclose Via CD button$/'
./features/CTMWEB-5238-CTM Web - Closing Validation Screen - Disclosure Indicator.feature:9:in `And you click on Only Disclose Via CD button'
Button States:
Second state pops up a message that I would need to assert is present once buttons is clicked.
