Skip to content

Commit 813e3b9

Browse files
committed
updating test website code
1 parent 873cbe4 commit 813e3b9

File tree

7 files changed

+108
-5
lines changed

7 files changed

+108
-5
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"accounts_endpoint": "accounts.json",
33
"client_metadata_endpoint": "client_metadata.json",
4-
"id_assertion_endpoint": "id_assertion",
5-
"signin_url": "/signin",
6-
"login_url": "/login"
4+
"id_assertion_endpoint": "id_assertion.json",
5+
"signin_url": "signin",
6+
"login_url": "login"
77
}

web/fedcm/fedcm.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<script>
33

4-
let configURL = `http://${location.host}/fedcm/fedcm.json`;
4+
let configURL = `http://${location.host}/fedcm/config.json`;
55
let promise = null;
66

77
function triggerFedCm() {
@@ -17,4 +17,4 @@
1717
return promise;
1818
}
1919

20-
</script>
20+
</script>

web/fedcm/fedcm_async.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>FedCM Example</title>
5+
</head>
6+
<body>
7+
<button id="triggerButton" onclick="triggerFedCm()">Trigger FedCM</button>
8+
<div id="result"></div>
9+
10+
<script>
11+
// Use a relative path for the configURL
12+
let configURL = `https://${location.host}/fedcm/config.json`;
13+
console.log(configURL)
14+
let result = null;
15+
16+
async function triggerFedCm() {
17+
console.log("Config URL:", configURL);
18+
try {
19+
let promise = await navigator.credentials.get({
20+
identity: {
21+
providers: [{
22+
configURL: configURL,
23+
clientId: '1',
24+
}]
25+
}
26+
});
27+
result = promise;
28+
document.getElementById('result').innerText = JSON.stringify(result);
29+
} catch (error) {
30+
console.error("FedCM Error:", error);
31+
result = { error: error.message };
32+
document.getElementById('result').innerText = JSON.stringify(result);
33+
}
34+
}
35+
</script>
36+
</body>
37+
</html>

web/fedcm/login.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Login</title>
5+
</head>
6+
<body>
7+
<h1>Login Page</h1>
8+
<p>Login successful! This is a placeholder for the login process.</p>
9+
<a href="/">Return to Home</a>
10+
</body>
11+
</html>

web/fedcm/signin.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Sign In</title>
5+
</head>
6+
<body>
7+
<h1>Sign In Page</h1>
8+
<p>This is a placeholder for the sign-in page.</p>
9+
<form action="/signin" method="post">
10+
<label for="username">Username:</label>
11+
<input type="text" id="username" name="username" required>
12+
<br><br>
13+
<label for="password">Password:</label>
14+
<input type="password" id="password" name="password" required>
15+
<br><br>
16+
<button type="submit">Sign In</button>
17+
</form>
18+
</body>
19+
</html>

web/formPage.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@
8080
<option value="oranges">Oranges</option>
8181
</select>
8282

83+
<select id="invisible_multi_select" multiple>
84+
<option selected="selected" value="apples" style="opacity: 0;">Apples</option>
85+
<option value="oranges">Oranges</option>
86+
<option selected="selected" value="lemons">Lemons</option>
87+
</select>
88+
8389
<select name="select-default">
8490
<option>One</option>
8591
<option>Two</option>

web/locators_tests/locators.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<html>
2+
<body>
3+
<style>
4+
.information {
5+
background-color: white;
6+
color: black;
7+
padding: 10px;
8+
}
9+
</style>
10+
<h2>Contact Selenium</h2>
11+
12+
<form>
13+
<input type="radio" name="gender" value="m" />Male &nbsp;
14+
<input type="radio" name="gender" value="f" />Female <br>
15+
<br>
16+
<label for="fname">First name:</label><br>
17+
<input class="information" type="text" id="fname" name="fname" value="Jane"><br><br>
18+
<label for="lname">Last name:</label><br>
19+
<input class="information" type="text" id="lname" name="lname" value="Doe"><br><br>
20+
<label for="newsletter">Newsletter:</label>
21+
<input type="checkbox" name="newsletter" value="1" /><br><br>
22+
<input type="submit" value="Submit">
23+
</form>
24+
25+
<p>To know more about Selenium, visit the official page
26+
<a href ="https://www.selenium.dev/">Selenium Official Page</a>
27+
</p>
28+
29+
</body>
30+
</html>

0 commit comments

Comments
 (0)