MCPcopy
hub / github.com/ampproject/amphtml / submitForm

Function submitForm

test/integration/test-amp-recaptcha-input.js:300–321  ·  view source on GitHub ↗
(doc)

Source from the content-addressed store, hash-verified

298}
299
300function submitForm(doc) {
301 return waitForBootstrapFrameOnLoad(doc)
302 .then(() => {
303 const searchInputElement = doc.querySelector('input[type="search"]');
304 const submitElement = doc.querySelector('input[type="submit"]');
305
306 searchInputElement.value = 'recaptcha-search';
307 submitElement.click();
308
309 return poll(
310 'Polling for hidden input',
311 () => {
312 return doc.querySelector('input[hidden]');
313 },
314 undefined,
315 5000
316 );
317 })
318 .then(() => {
319 return doc.querySelector('input[hidden]');
320 });
321}

Callers 1

Calls 4

pollFunction · 0.90
thenMethod · 0.45
clickMethod · 0.45

Tested by

no test coverage detected