/
index.html
103 lines (91 loc) · 2.11 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Cypress example</title>
<style>
* {
box-sizing: border-box;
}
body {
padding: 0;
margin: 0;
font-family: Arial, 'sans-serif';
font-size: 15px;
}
a {
display: block;
padding: 10px 0;
color: black;
}
h1, h2 {
padding: 0;
margin: 0 0 20px 0;
font-size: 22px;
}
hr {
border: 0;
border-bottom: 1px dashed #DDD;
}
.container {
width: 980px;
margin: 30px auto 0 auto;
}
.alert {
background: green;
color: white;
padding: 10px;
margin: 10px 0 0 0;
}
</style>
<script>
window.addEventListener('load', function () {
document.getElementById('js-fetch-data').addEventListener('click', function (e) {
e.preventDefault();
fetch('example.json')
.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>