-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathadvanced.html
244 lines (222 loc) · 10.1 KB
/
advanced.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="Sample Web Application for Test Automation">
<meta name="author" content="Dinesh Velhal">
<title>Advanced Topics</title>
<!-- Font Awesome -->
<link rel="stylesheet" href="css/all.css">
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.css" rel="stylesheet">
<!-- Material Design Bootstrap
<link href="css/mdb.min.css" rel="stylesheet">-->
<!-- Your custom styles (optional)
<link href="css/style.css" rel="stylesheet">-->
</head>
<body>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<!-- Brand/logo -->
<a class="navbar-brand abs" href="index.html">The Playground</a>
</nav>
<br><br>
<div class="container align-items-center text-center">
<br>
<div class="card text-center shadow border-success">
<div class="card-header">
<h2>Challenge 1</h2>
<div class="col-sm-12 text-center">
Using Selenium (or any other tool) - read the * Rating of the book, enter it in the text box and
click "Check Rating"
button. You should see "Well done!" message.
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-sm-6">
<table class="table table-bordered">
<thead class="thead thead-light">
<tr>
<th scope="col">#</th>
<th scope="col">
Book
</th>
<th scope="col">
* Rating
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>
<label class="font-weight-bold">Sapiens: A Brief History of the
Humankind</label>
</td>
<td>
<label class="star-rating"></label>
</td>
</tr>
</tbody>
</table>
</div>
<div class=" col-sm-6">
<form class="form">
<div class="row">
<div class="col">
<div class="form-group">
<input class="form-control shadow-sm" type="text"
placeholder="Enter the * Rating of the book. E.g. ****" id="txt_rating">
</div>
</div>
</div>
<div class="row">
<div class="col">
<button type="button" class="btn btn-primary shadow-sm" id="check_rating">Check
Rating</button>
</div>
<div class="col">
<h5><span class="badge badge-success" id="validate_rating"></span></h5>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<br>
<!--<div class="card text-center shadow border-success">
<div class="card-header text-success">
<h2>Challenge 2</h2>
<div class="col-sm-12 text-center">
Using Selenium (or any other tool) - read the * Rating of the book, enter it in the text box and
click "Check Rating"
button. You should see "Well done!" message.
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-sm-6">
<table class="table table-bordered">
<thead class="thead thead-light">
<tr>
<th scope="col">#</th>
<th scope="col">
Book
</th>
<th scope="col">
* Rating
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>
<label class="font-weight-bold">Sapiens: A Brief History of the
Humankind</label>
</td>
<td>
<label class="star-rating"></label>
</td>
</tr>
</tbody>
</table>
</div>
<div class=" col-sm-6">
<form class="form">
<div class="row">
<div class="col">
<div class="form-group">
<input class="form-control shadow-sm" type="text"
placeholder="Enter the * Rating of the book. E.g. ****" id="txt_rating">
</div>
</div>
</div>
<div class="row">
<div class="col">
<button type="button" class="btn btn-primary shadow-sm" id="check_rating">Check
Rating</button>
</div>
<div class="col">
<h5><span class="badge badge-success" id="validate_rating"></span></h5>
</div>
</div>
</form>
</div>
</div>
</div>
</div> -->
<br>
</div>
<br><br><br><br>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-bottom" style="padding: 1px !important;">
<a class="navbar-brand" href="http://www.linkedin.com/in/dineshvelhal"><small class="font-weight-lighter">©
2019 Dinesh Velhal </small></a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<small class="font-weight-lighter text-light mr-3">Coordinates: </small>
</li>
<li class="nav-item active">
<a href="http://www.linkedin.com/in/dineshvelhal" class="mr-3 fab fa-linkedin-in"></a>
</li>
<li class="nav-item">
<a href="https://twitter.com/dinesh_velhal" class="fab fa-twitter"></a>
</li>
</ul>
</div>
<form class="form-inline my-2 my-lg-0">
<small><a class="btn btn-success btn-sm" href="attribution.html" role="button"><i class="fa fa-heart"></i>
Thanks
To</a>
<a class="btn btn-light btn-sm" href="index.html" role="button"><i class="fa fa-home"></i>
Home</a></small>
</form>
</nav>
<!-- SCRIPTS -->
<!-- JQuery -->
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript" src="js/popper.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<!-- MDB core JavaScript
<script type="text/javascript" src="js/mdb.min.js"></script>-->
<script>
// All functions
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
$(document).ready(function () {
var rr = "*".repeat(getRandomInt(5) + 1);
$("head").append(
'<style>label.star-rating::after {content: "' + rr + '"; ' +
'display: inline-block; ' +
'padding: 0.25em 0.3em 0.25em 0.3em; ' +
'font-size: 100%; font-weight: 700; ' +
'line-height: 1; text-align: center; ' +
'white-space: nowrap; vertical-align: baseline; ' +
'color: white; background-color: #3FB618;}</style>'
);
$("#check_rating").click(function () {
var content = window.getComputedStyle(
document.querySelector('label.star-rating'), ':after'
).getPropertyValue('content');
var rating = '"' + $("#txt_rating").val() + '"';
if (content == rating) {
$("#validate_rating")
.text("Well done!")
.attr("class", "badge badge-success");
} else {
$("#validate_rating")
.text("Try Again!")
.attr("class", "badge badge-danger");
}
});
});
</script>
</body>
</html>