-
Notifications
You must be signed in to change notification settings - Fork 0
/
playwright-companion.html
38 lines (35 loc) · 1.16 KB
/
playwright-companion.html
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
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html>
<head>
<title>Playwright companion</title>
<style>
</style>
</head>
<body>
<h1>Hello World!</h1>
<div>To run this website, install http-server:</div>
<pre>npm install --global http-server</pre>
<div>Then start the server:</div>
<pre>http-server</pre>
<div>Finally, point your test to:</div>
<pre>http://127.0.0.1:8080/playwright-companion.html</pre>
<div id="progress-bar">Loading ...</div>
<button data-testid="cancel-button">Cancel</button>
<button data-testid="accept-button">Accept</button>
<script>
let progress = 0;
let intervalId = setInterval(() => {
if (progress < 100) {
document.getElementById("progress-bar").innerHTML = `Loading ${progress}%`;
document.querySelector('[data-testid="cancel-button"]').focus();
progress += 10;
}
else {
document.getElementById("progress-bar").innerHTML = `Done!`;
document.querySelector('[data-testid="accept-button"]').focus();
clearInterval(intervalId);
}
}, 333);
</script>
</body>
</html>