puppeteer/third_party/phantomjs/test/module/webpage/prompt.js
Andrey Lushnikov dbac6788ae Plumb default prompt value to the dialog (#243)
This patch:
- plumbs default prompt value to the dialog
- enables one more phantom test
2017-08-11 12:17:43 -07:00

17 lines
404 B
JavaScript

test(function () {
var page = require('webpage').create();
var msg = "message",
value = "value",
result,
expected = "extra-value";
page.onPrompt = function(msg, value) {
return "extra-"+value;
};
result = page.evaluate(function(m, v) {
return window.prompt(m, v);
}, msg, value);
assert_equals(result, expected);
}, "page.onPrompt");