Skip to content

Commit eb947fe

Browse files
committed
core(ard) add ard smoke tests
1 parent 6aac294 commit eb947fe

6 files changed

Lines changed: 157 additions & 0 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"specVersion": "1.0",
3+
"entries": [
4+
{
5+
"identifier": "invalid-urn-format",
6+
"displayName": "Invalid Service",
7+
"type": "application/json",
8+
"url": "http://example.com/insecure-api"
9+
}
10+
]
11+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"specVersion": "1.0",
3+
"entries": [
4+
{
5+
"identifier": "urn:air:google:search:web-search",
6+
"displayName": "Web Search API",
7+
"type": "application/ai-catalog+json",
8+
"url": "https://example.com/api/search",
9+
"representativeQueries": [
10+
"search the web",
11+
"find latest news"
12+
]
13+
}
14+
]
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<!--
3+
Copyright 2026 Google LLC
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
<html>
7+
<head>
8+
<title>ARD Tester</title>
9+
<link rel="ai-catalog" href="/agentic/ai-catalog.json">
10+
</head>
11+
<body>
12+
<h1>ARD Tester</h1>
13+
<p>This page is used to test ARD E2E.</p>
14+
</body>
15+
</html>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<!--
3+
Copyright 2026 Google LLC
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
<html>
7+
<head>
8+
<title>ARD Invalid Tester</title>
9+
<link rel="ai-catalog" href="/agentic/ai-catalog-invalid.json">
10+
</head>
11+
<body>
12+
<h1>ARD Invalid Tester</h1>
13+
<p>This page is used to test ARD invalid schema E2E.</p>
14+
</body>
15+
</html>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/**
2+
* @license
3+
* Copyright 2026 Google LLC
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/** @type {LH.Config} */
8+
const config = {
9+
extends: 'lighthouse:default',
10+
settings: {
11+
onlyAudits: [
12+
'ard-schema',
13+
],
14+
},
15+
};
16+
17+
/**
18+
* @type {Smokehouse.ExpectedRunnerResult}
19+
*/
20+
const expectations = {
21+
lhr: {
22+
requestedUrl: 'http://localhost:10200/agentic/ard_tester_invalid.html',
23+
finalDisplayedUrl: 'http://localhost:10200/agentic/ard_tester_invalid.html',
24+
audits: {
25+
'ard-schema': {
26+
score: 0,
27+
scoreDisplayMode: 'binary',
28+
details: {
29+
type: 'table',
30+
items: [
31+
{
32+
element: 'Invalid Service',
33+
issue: /Identifier 'invalid-urn-format' does not match RFC 8141 URN pattern/,
34+
severity: 'Error',
35+
},
36+
{
37+
element: 'Invalid Service',
38+
issue: /Media type 'application\/json' is not one of standard discovery types/,
39+
severity: 'Warning',
40+
},
41+
{
42+
element: 'Invalid Service',
43+
issue: /Insecure HTTP URL found in 'url'/,
44+
severity: 'Error',
45+
},
46+
{
47+
element: 'Invalid Service',
48+
issue: /Missing 'representativeQueries'/,
49+
severity: 'Warning',
50+
},
51+
],
52+
},
53+
},
54+
},
55+
},
56+
};
57+
58+
/** @type {Smokehouse.TestDfn} */
59+
export default {
60+
id: 'ard-invalid',
61+
config,
62+
expectations,
63+
};
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* @license
3+
* Copyright 2026 Google LLC
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/** @type {LH.Config} */
8+
const config = {
9+
extends: 'lighthouse:default',
10+
settings: {
11+
onlyAudits: [
12+
'ard-schema',
13+
],
14+
},
15+
};
16+
17+
/**
18+
* @type {Smokehouse.ExpectedRunnerResult}
19+
*/
20+
const expectations = {
21+
lhr: {
22+
requestedUrl: 'http://localhost:10200/agentic/ard_tester.html',
23+
finalDisplayedUrl: 'http://localhost:10200/agentic/ard_tester.html',
24+
audits: {
25+
'ard-schema': {
26+
score: 1,
27+
scoreDisplayMode: 'binary',
28+
},
29+
},
30+
},
31+
};
32+
33+
/** @type {Smokehouse.TestDfn} */
34+
export default {
35+
id: 'ard',
36+
config,
37+
expectations,
38+
};

0 commit comments

Comments
 (0)