-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathduo.js
30 lines (27 loc) · 1.04 KB
/
duo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// использовать генераторы - yield ??
// Потом ввести 3 неправильных ответа
function toLoseGame() {
const textarea = document.querySelector(`[data-test="challenge-translate-input"]`);
setNativeValue(textarea, 'i need cofe');
setTimeout(()=>{}, 500);
setTimeout(()=>{
textarea.dispatchEvent(new Event('input', { bubbles: true }));
}, 500);
setTimeout(()=>{
document.querySelector(`[data-test="player-next"]`).dispatchEvent(new Event('click', { bubbles: true }));
}, 500);
setNativeValue(textarea, 'Cofe');
setTimeout(()=>{
textarea.dispatchEvent(new Event('input', { bubbles: true }));
}, 500);
setTimeout(()=>{
document.querySelector(`[data-test="player-next"]`).dispatchEvent(new Event('click', { bubbles: true }));
}, 500);
setNativeValue(textarea, 'Cofe');
setTimeout(()=>{
textarea.dispatchEvent(new Event('input', { bubbles: true }));
}, 500);
setTimeout(()=>{
document.querySelector(`[data-test="player-next"]`).dispatchEvent(new Event('click', { bubbles: true }));
}, 500);
}