mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
Implement Basic input API
This patch implements Basic Input api: - Page.focus(selector) - focuses element with selector - Page.click(selector) - clicks element with selector - Page.type(text) - types text into a focused element Fixed #43.
This commit is contained in:
committed by
Andrey Lushnikov
parent
3d90ea38a9
commit
d5a91650ae
15
test/assets/input/button.html
Normal file
15
test/assets/input/button.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Button test</title>
|
||||
</head>
|
||||
<body>
|
||||
<button onclick="clicked();">Click target</button>
|
||||
<script>
|
||||
window.result = 'Was not clicked';
|
||||
function clicked() {
|
||||
result = 'Clicked';
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
14
test/assets/input/textarea.html
Normal file
14
test/assets/input/textarea.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Textarea test</title>
|
||||
</head>
|
||||
<body>
|
||||
<textarea></textarea>
|
||||
<script>
|
||||
window.result = '';
|
||||
let textarea = document.querySelector('textarea');
|
||||
textarea.addEventListener('input', () => result = textarea.value, false);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user