Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you add a way to test for a prompt? #20

Open
therubymug opened this issue Sep 22, 2010 · 1 comment
Open

Could you add a way to test for a prompt? #20

therubymug opened this issue Sep 22, 2010 · 1 comment

Comments

@therubymug
Copy link

In Selenium, it's like this:

selenium.get_alert.should eql("Are you sure?")

I would think it'd be more appropriate to have one for alert, prompt, and confirm.

@bernerdschaefer
Copy link
Owner

I've got a few ideas for this; but there are other ways of solving this sort of requirement, such as this step definition for testing confirmations:

Given /^I will press 'ok' for the "([^"]*)" confirmation$/ do |message|
  page.execute_script <<-JS
  window.confirm = function(msg) {
    if ( msg === #{message.to_json} )
      return true;
    else
      return false;
  }
  JS
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants