2018-11-21 03:34:57 +00:00
|
|
|
/**
|
|
|
|
* Copyright 2018 Google Inc. All rights reserved.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2020-06-23 05:18:46 +00:00
|
|
|
import expect from 'expect';
|
|
|
|
import {
|
2020-05-07 10:54:55 +00:00
|
|
|
getTestState,
|
|
|
|
setupTestPageAndContextHooks,
|
|
|
|
setupTestBrowserHooks,
|
2020-06-23 05:18:46 +00:00
|
|
|
itFailsFirefox,
|
2020-07-13 09:22:26 +00:00
|
|
|
} from './mocha-utils'; // eslint-disable-line import/extensions
|
|
|
|
import utils from './utils.js';
|
2018-11-21 03:34:57 +00:00
|
|
|
|
2020-05-07 10:54:55 +00:00
|
|
|
describe('Page.click', function () {
|
2020-04-09 05:56:25 +00:00
|
|
|
setupTestBrowserHooks();
|
|
|
|
setupTestPageAndContextHooks();
|
2020-05-07 10:54:55 +00:00
|
|
|
it('should click the button', async () => {
|
|
|
|
const { page, server } = getTestState();
|
2019-04-19 22:33:06 +00:00
|
|
|
|
2020-04-09 05:56:25 +00:00
|
|
|
await page.goto(server.PREFIX + '/input/button.html');
|
|
|
|
await page.click('button');
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await page.evaluate(() => globalThis.result)).toBe('Clicked');
|
2020-04-09 05:56:25 +00:00
|
|
|
});
|
2020-06-12 13:55:51 +00:00
|
|
|
it('should click svg', async () => {
|
2020-05-07 10:54:55 +00:00
|
|
|
const { page } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
|
|
|
await page.setContent(`
|
2019-05-18 09:49:55 +00:00
|
|
|
<svg height="100" width="100">
|
|
|
|
<circle onclick="javascript:window.__CLICKED=42" cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
|
|
|
|
</svg>
|
|
|
|
`);
|
2020-04-09 05:56:25 +00:00
|
|
|
await page.click('circle');
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await page.evaluate(() => globalThis.__CLICKED)).toBe(42);
|
2020-04-09 05:56:25 +00:00
|
|
|
});
|
2020-05-07 10:54:55 +00:00
|
|
|
itFailsFirefox(
|
|
|
|
'should click the button if window.Node is removed',
|
|
|
|
async () => {
|
|
|
|
const { page, server } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
2020-05-07 10:54:55 +00:00
|
|
|
await page.goto(server.PREFIX + '/input/button.html');
|
|
|
|
await page.evaluate(() => delete window.Node);
|
|
|
|
await page.click('button');
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await page.evaluate(() => globalThis.result)).toBe('Clicked');
|
2020-05-07 10:54:55 +00:00
|
|
|
}
|
|
|
|
);
|
2020-04-09 05:56:25 +00:00
|
|
|
// @see https://github.com/puppeteer/puppeteer/issues/4281
|
2020-06-12 13:55:51 +00:00
|
|
|
it('should click on a span with an inline element inside', async () => {
|
|
|
|
const { page } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
2020-06-12 13:55:51 +00:00
|
|
|
await page.setContent(`
|
2019-04-13 04:10:48 +00:00
|
|
|
<style>
|
|
|
|
span::before {
|
|
|
|
content: 'q';
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<span onclick='javascript:window.CLICKED=42'></span>
|
|
|
|
`);
|
2020-06-12 13:55:51 +00:00
|
|
|
await page.click('span');
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await page.evaluate(() => globalThis.CLICKED)).toBe(42);
|
2020-06-12 13:55:51 +00:00
|
|
|
});
|
2020-05-07 10:54:55 +00:00
|
|
|
it('should not throw UnhandledPromiseRejection when page closes', async () => {
|
|
|
|
const { page } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
|
|
|
const newPage = await page.browser().newPage();
|
2021-05-12 14:48:30 +00:00
|
|
|
await Promise.all([newPage.close(), newPage.mouse.click(1, 2)]).catch(
|
|
|
|
() => {}
|
|
|
|
);
|
2020-04-09 05:56:25 +00:00
|
|
|
});
|
2020-05-07 10:54:55 +00:00
|
|
|
it('should click the button after navigation ', async () => {
|
|
|
|
const { page, server } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
|
|
|
await page.goto(server.PREFIX + '/input/button.html');
|
|
|
|
await page.click('button');
|
|
|
|
await page.goto(server.PREFIX + '/input/button.html');
|
|
|
|
await page.click('button');
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await page.evaluate(() => globalThis.result)).toBe('Clicked');
|
2020-04-09 05:56:25 +00:00
|
|
|
});
|
2020-05-07 10:54:55 +00:00
|
|
|
itFailsFirefox('should click with disabled javascript', async () => {
|
|
|
|
const { page, server } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
|
|
|
await page.setJavaScriptEnabled(false);
|
|
|
|
await page.goto(server.PREFIX + '/wrappedlink.html');
|
2020-05-07 10:54:55 +00:00
|
|
|
await Promise.all([page.click('a'), page.waitForNavigation()]);
|
2020-04-09 05:56:25 +00:00
|
|
|
expect(page.url()).toBe(server.PREFIX + '/wrappedlink.html#clicked');
|
|
|
|
});
|
2020-06-12 13:55:51 +00:00
|
|
|
it('should click when one of inline box children is outside of viewport', async () => {
|
|
|
|
const { page } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
2020-06-12 13:55:51 +00:00
|
|
|
await page.setContent(`
|
2019-04-12 01:11:20 +00:00
|
|
|
<style>
|
|
|
|
i {
|
|
|
|
position: absolute;
|
|
|
|
top: -1000px;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<span onclick='javascript:window.CLICKED = 42;'><i>woof</i><b>doggo</b></span>
|
|
|
|
`);
|
2020-06-12 13:55:51 +00:00
|
|
|
await page.click('span');
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await page.evaluate(() => globalThis.CLICKED)).toBe(42);
|
2020-06-12 13:55:51 +00:00
|
|
|
});
|
2020-05-07 10:54:55 +00:00
|
|
|
it('should select the text by triple clicking', async () => {
|
|
|
|
const { page, server } = getTestState();
|
2018-11-21 03:34:57 +00:00
|
|
|
|
2020-04-09 05:56:25 +00:00
|
|
|
await page.goto(server.PREFIX + '/input/textarea.html');
|
|
|
|
await page.focus('textarea');
|
2020-05-07 10:54:55 +00:00
|
|
|
const text =
|
|
|
|
"This is the text that we are going to try to select. Let's see how it goes.";
|
2020-04-09 05:56:25 +00:00
|
|
|
await page.keyboard.type(text);
|
|
|
|
await page.click('textarea');
|
2020-05-07 10:54:55 +00:00
|
|
|
await page.click('textarea', { clickCount: 2 });
|
|
|
|
await page.click('textarea', { clickCount: 3 });
|
|
|
|
expect(
|
|
|
|
await page.evaluate(() => {
|
|
|
|
const textarea = document.querySelector('textarea');
|
|
|
|
return textarea.value.substring(
|
|
|
|
textarea.selectionStart,
|
|
|
|
textarea.selectionEnd
|
|
|
|
);
|
|
|
|
})
|
|
|
|
).toBe(text);
|
2020-04-09 05:56:25 +00:00
|
|
|
});
|
2021-02-11 11:54:45 +00:00
|
|
|
it('should click offscreen buttons', async () => {
|
2020-05-07 10:54:55 +00:00
|
|
|
const { page, server } = getTestState();
|
2018-11-21 03:34:57 +00:00
|
|
|
|
2020-04-09 05:56:25 +00:00
|
|
|
await page.goto(server.PREFIX + '/offscreenbuttons.html');
|
|
|
|
const messages = [];
|
2020-05-07 10:54:55 +00:00
|
|
|
page.on('console', (msg) => messages.push(msg.text()));
|
2020-04-09 05:56:25 +00:00
|
|
|
for (let i = 0; i < 11; ++i) {
|
|
|
|
// We might've scrolled to click a button - reset to (0, 0).
|
|
|
|
await page.evaluate(() => window.scrollTo(0, 0));
|
|
|
|
await page.click(`#btn${i}`);
|
|
|
|
}
|
|
|
|
expect(messages).toEqual([
|
|
|
|
'button #0 clicked',
|
|
|
|
'button #1 clicked',
|
|
|
|
'button #2 clicked',
|
|
|
|
'button #3 clicked',
|
|
|
|
'button #4 clicked',
|
|
|
|
'button #5 clicked',
|
|
|
|
'button #6 clicked',
|
|
|
|
'button #7 clicked',
|
|
|
|
'button #8 clicked',
|
|
|
|
'button #9 clicked',
|
2020-05-07 10:54:55 +00:00
|
|
|
'button #10 clicked',
|
2020-04-09 05:56:25 +00:00
|
|
|
]);
|
|
|
|
});
|
2018-11-21 03:34:57 +00:00
|
|
|
|
2020-05-07 10:54:55 +00:00
|
|
|
it('should click wrapped links', async () => {
|
|
|
|
const { page, server } = getTestState();
|
2018-11-21 03:34:57 +00:00
|
|
|
|
2020-04-09 05:56:25 +00:00
|
|
|
await page.goto(server.PREFIX + '/wrappedlink.html');
|
|
|
|
await page.click('a');
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await page.evaluate(() => globalThis.__clicked)).toBe(true);
|
2020-04-09 05:56:25 +00:00
|
|
|
});
|
|
|
|
|
2020-05-07 10:54:55 +00:00
|
|
|
it('should click on checkbox input and toggle', async () => {
|
|
|
|
const { page, server } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
|
|
|
await page.goto(server.PREFIX + '/input/checkbox.html');
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await page.evaluate(() => globalThis.result.check)).toBe(null);
|
2020-04-09 05:56:25 +00:00
|
|
|
await page.click('input#agree');
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await page.evaluate(() => globalThis.result.check)).toBe(true);
|
|
|
|
expect(await page.evaluate(() => globalThis.result.events)).toEqual([
|
2020-04-09 05:56:25 +00:00
|
|
|
'mouseover',
|
|
|
|
'mouseenter',
|
|
|
|
'mousemove',
|
|
|
|
'mousedown',
|
|
|
|
'mouseup',
|
|
|
|
'click',
|
|
|
|
'input',
|
|
|
|
'change',
|
|
|
|
]);
|
|
|
|
await page.click('input#agree');
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await page.evaluate(() => globalThis.result.check)).toBe(false);
|
2020-04-09 05:56:25 +00:00
|
|
|
});
|
|
|
|
|
2020-05-07 10:54:55 +00:00
|
|
|
itFailsFirefox('should click on checkbox label and toggle', async () => {
|
|
|
|
const { page, server } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
|
|
|
await page.goto(server.PREFIX + '/input/checkbox.html');
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await page.evaluate(() => globalThis.result.check)).toBe(null);
|
2020-04-09 05:56:25 +00:00
|
|
|
await page.click('label[for="agree"]');
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await page.evaluate(() => globalThis.result.check)).toBe(true);
|
|
|
|
expect(await page.evaluate(() => globalThis.result.events)).toEqual([
|
2020-04-09 05:56:25 +00:00
|
|
|
'click',
|
|
|
|
'input',
|
|
|
|
'change',
|
|
|
|
]);
|
|
|
|
await page.click('label[for="agree"]');
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await page.evaluate(() => globalThis.result.check)).toBe(false);
|
2020-04-09 05:56:25 +00:00
|
|
|
});
|
|
|
|
|
2020-05-07 10:54:55 +00:00
|
|
|
it('should fail to click a missing button', async () => {
|
|
|
|
const { page, server } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
|
|
|
await page.goto(server.PREFIX + '/input/button.html');
|
|
|
|
let error = null;
|
2020-05-07 10:54:55 +00:00
|
|
|
await page
|
|
|
|
.click('button.does-not-exist')
|
|
|
|
.catch((error_) => (error = error_));
|
|
|
|
expect(error.message).toBe(
|
|
|
|
'No node found for selector: button.does-not-exist'
|
|
|
|
);
|
2020-04-09 05:56:25 +00:00
|
|
|
});
|
|
|
|
// @see https://github.com/puppeteer/puppeteer/issues/161
|
2020-05-07 10:54:55 +00:00
|
|
|
it('should not hang with touch-enabled viewports', async () => {
|
|
|
|
const { page, puppeteer } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
|
|
|
await page.setViewport(puppeteer.devices['iPhone 6'].viewport);
|
|
|
|
await page.mouse.down();
|
|
|
|
await page.mouse.move(100, 10);
|
|
|
|
await page.mouse.up();
|
|
|
|
});
|
2020-05-07 10:54:55 +00:00
|
|
|
it('should scroll and click the button', async () => {
|
|
|
|
const { page, server } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
|
|
|
await page.goto(server.PREFIX + '/input/scrollable.html');
|
|
|
|
await page.click('#button-5');
|
2020-05-07 10:54:55 +00:00
|
|
|
expect(
|
|
|
|
await page.evaluate(() => document.querySelector('#button-5').textContent)
|
|
|
|
).toBe('clicked');
|
2020-04-09 05:56:25 +00:00
|
|
|
await page.click('#button-80');
|
2020-05-07 10:54:55 +00:00
|
|
|
expect(
|
|
|
|
await page.evaluate(
|
|
|
|
() => document.querySelector('#button-80').textContent
|
|
|
|
)
|
|
|
|
).toBe('clicked');
|
2020-04-09 05:56:25 +00:00
|
|
|
});
|
2021-11-19 07:50:31 +00:00
|
|
|
it('should double click the button', async () => {
|
2020-05-07 10:54:55 +00:00
|
|
|
const { page, server } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
|
|
|
await page.goto(server.PREFIX + '/input/button.html');
|
|
|
|
await page.evaluate(() => {
|
2020-06-23 05:18:46 +00:00
|
|
|
globalThis.double = false;
|
2020-04-09 05:56:25 +00:00
|
|
|
const button = document.querySelector('button');
|
2020-06-23 05:18:46 +00:00
|
|
|
button.addEventListener('dblclick', () => {
|
|
|
|
globalThis.double = true;
|
2018-11-21 03:34:57 +00:00
|
|
|
});
|
|
|
|
});
|
2020-04-09 05:56:25 +00:00
|
|
|
const button = await page.$('button');
|
2020-05-07 10:54:55 +00:00
|
|
|
await button.click({ clickCount: 2 });
|
2020-04-09 05:56:25 +00:00
|
|
|
expect(await page.evaluate('double')).toBe(true);
|
|
|
|
expect(await page.evaluate('result')).toBe('Clicked');
|
|
|
|
});
|
2020-05-07 10:54:55 +00:00
|
|
|
it('should click a partially obscured button', async () => {
|
|
|
|
const { page, server } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
|
|
|
await page.goto(server.PREFIX + '/input/button.html');
|
|
|
|
await page.evaluate(() => {
|
|
|
|
const button = document.querySelector('button');
|
|
|
|
button.textContent = 'Some really long text that will go offscreen';
|
|
|
|
button.style.position = 'absolute';
|
|
|
|
button.style.left = '368px';
|
2018-11-21 03:34:57 +00:00
|
|
|
});
|
2020-04-09 05:56:25 +00:00
|
|
|
await page.click('button');
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await page.evaluate(() => globalThis.result)).toBe('Clicked');
|
2020-04-09 05:56:25 +00:00
|
|
|
});
|
2020-05-07 10:54:55 +00:00
|
|
|
it('should click a rotated button', async () => {
|
|
|
|
const { page, server } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
|
|
|
await page.goto(server.PREFIX + '/input/rotatedButton.html');
|
|
|
|
await page.click('button');
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await page.evaluate(() => globalThis.result)).toBe('Clicked');
|
2020-04-09 05:56:25 +00:00
|
|
|
});
|
2020-05-07 10:54:55 +00:00
|
|
|
it('should fire contextmenu event on right click', async () => {
|
|
|
|
const { page, server } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
|
|
|
await page.goto(server.PREFIX + '/input/scrollable.html');
|
2020-05-07 10:54:55 +00:00
|
|
|
await page.click('#button-8', { button: 'right' });
|
|
|
|
expect(
|
|
|
|
await page.evaluate(() => document.querySelector('#button-8').textContent)
|
|
|
|
).toBe('context menu');
|
2020-04-09 05:56:25 +00:00
|
|
|
});
|
2022-04-27 21:00:07 +00:00
|
|
|
it('should fire aux event on middle click', async () => {
|
|
|
|
const { page, server } = getTestState();
|
|
|
|
|
|
|
|
await page.goto(server.PREFIX + '/input/scrollable.html');
|
|
|
|
await page.click('#button-8', { button: 'middle' });
|
|
|
|
expect(
|
|
|
|
await page.evaluate(() => document.querySelector('#button-8').textContent)
|
|
|
|
).toBe('aux click');
|
|
|
|
});
|
|
|
|
it('should fire back click', async () => {
|
|
|
|
const { page, server } = getTestState();
|
|
|
|
|
|
|
|
await page.goto(server.PREFIX + '/input/scrollable.html');
|
|
|
|
await page.click('#button-8', { button: 'back' });
|
|
|
|
expect(
|
|
|
|
await page.evaluate(() => document.querySelector('#button-8').textContent)
|
|
|
|
).toBe('back click');
|
|
|
|
});
|
|
|
|
it('should fire forward click', async () => {
|
|
|
|
const { page, server } = getTestState();
|
|
|
|
|
|
|
|
await page.goto(server.PREFIX + '/input/scrollable.html');
|
|
|
|
await page.click('#button-8', { button: 'forward' });
|
|
|
|
expect(
|
|
|
|
await page.evaluate(() => document.querySelector('#button-8').textContent)
|
|
|
|
).toBe('forward click');
|
|
|
|
});
|
2020-04-09 05:56:25 +00:00
|
|
|
// @see https://github.com/puppeteer/puppeteer/issues/206
|
2020-06-12 13:55:51 +00:00
|
|
|
it('should click links which cause navigation', async () => {
|
2020-05-07 10:54:55 +00:00
|
|
|
const { page, server } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
|
|
|
await page.setContent(`<a href="${server.EMPTY_PAGE}">empty.html</a>`);
|
|
|
|
// This await should not hang.
|
|
|
|
await page.click('a');
|
|
|
|
});
|
2021-11-19 07:50:31 +00:00
|
|
|
it('should click the button inside an iframe', async () => {
|
2020-05-07 10:54:55 +00:00
|
|
|
const { page, server } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
|
|
|
await page.goto(server.EMPTY_PAGE);
|
|
|
|
await page.setContent('<div style="width:100px;height:100px">spacer</div>');
|
2020-05-07 10:54:55 +00:00
|
|
|
await utils.attachFrame(
|
|
|
|
page,
|
|
|
|
'button-test',
|
|
|
|
server.PREFIX + '/input/button.html'
|
|
|
|
);
|
2020-04-09 05:56:25 +00:00
|
|
|
const frame = page.frames()[1];
|
|
|
|
const button = await frame.$('button');
|
|
|
|
await button.click();
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await frame.evaluate(() => globalThis.result)).toBe('Clicked');
|
2020-04-09 05:56:25 +00:00
|
|
|
});
|
|
|
|
// @see https://github.com/puppeteer/puppeteer/issues/4110
|
2020-05-07 10:54:55 +00:00
|
|
|
xit('should click the button with fixed position inside an iframe', async () => {
|
|
|
|
const { page, server } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
|
|
|
await page.goto(server.EMPTY_PAGE);
|
2020-05-07 10:54:55 +00:00
|
|
|
await page.setViewport({ width: 500, height: 500 });
|
|
|
|
await page.setContent(
|
|
|
|
'<div style="width:100px;height:2000px">spacer</div>'
|
|
|
|
);
|
|
|
|
await utils.attachFrame(
|
|
|
|
page,
|
|
|
|
'button-test',
|
|
|
|
server.CROSS_PROCESS_PREFIX + '/input/button.html'
|
|
|
|
);
|
2020-04-09 05:56:25 +00:00
|
|
|
const frame = page.frames()[1];
|
2020-07-02 09:09:34 +00:00
|
|
|
await frame.$eval('button', (button: HTMLElement) =>
|
2020-05-07 10:54:55 +00:00
|
|
|
button.style.setProperty('position', 'fixed')
|
|
|
|
);
|
2020-04-09 05:56:25 +00:00
|
|
|
await frame.click('button');
|
2020-06-23 05:18:46 +00:00
|
|
|
expect(await frame.evaluate(() => globalThis.result)).toBe('Clicked');
|
2020-04-09 05:56:25 +00:00
|
|
|
});
|
2021-11-19 07:50:31 +00:00
|
|
|
it('should click the button with deviceScaleFactor set', async () => {
|
|
|
|
const { page, server } = getTestState();
|
2020-04-09 05:56:25 +00:00
|
|
|
|
2021-11-19 07:50:31 +00:00
|
|
|
await page.setViewport({ width: 400, height: 400, deviceScaleFactor: 5 });
|
|
|
|
expect(await page.evaluate(() => window.devicePixelRatio)).toBe(5);
|
|
|
|
await page.setContent('<div style="width:100px;height:100px">spacer</div>');
|
|
|
|
await utils.attachFrame(
|
|
|
|
page,
|
|
|
|
'button-test',
|
|
|
|
server.PREFIX + '/input/button.html'
|
|
|
|
);
|
|
|
|
const frame = page.frames()[1];
|
|
|
|
const button = await frame.$('button');
|
|
|
|
await button.click();
|
|
|
|
expect(await frame.evaluate(() => globalThis.result)).toBe('Clicked');
|
|
|
|
});
|
2020-04-09 05:56:25 +00:00
|
|
|
});
|