-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
65 lines (57 loc) · 1.78 KB
/
index.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Cypress example</title>
<link rel="stylesheet" type="text/css" href="./assets/style.css">
<script>
window.addEventListener('load', function () {
document.getElementById('js-fetch-data').addEventListener('click', function (e) {
e.preventDefault();
fetch('https://jsonplaceholder.typicode.com/comments')
.then(function () {
document.getElementById('js-fetch-alert').style.display = 'block'
})
.catch(function (error) {
console.warn(error);
})
})
})
</script>
</head>
<body>
<div class="container">
<h1>Details</h1>
<details>
<summary data-cy="details-trigger">Detail example</summary>
<div data-cy="details-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Itaque earum rerum hic
tenetur a
sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores
repellat.
</div>
</details>
<hr>
<h2>Form</h2>
<form method="get" data-cy="form">
<table>
<tr>
<td>Name</td>
<td><input type="text" name="name" required data-cy="form-name"></td>
</tr>
<tr>
<td>Surname</td>
<td><input type="text" name="surname" required data-cy="form-surname"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Submit"></td>
</tr>
</table>
</form>
<hr>
<h2>Ajax</h2>
<a href="#" id="js-fetch-data" data-cy="ajax-fetch-data">Click me</a>
<div id="js-fetch-alert" data-cy="ajax-fetch-alert" style="display: none;" class="alert">Ajax call: ok</div>
</div>
</body>
</html>