Skip to content

Commit b7efa1d

Browse files
authored
tests(smoke): make oopif-requests assertions more specific (#14100)
1 parent eb313f6 commit b7efa1d

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

lighthouse-cli/test/smokehouse/test-definitions/oopif-requests.js

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,28 @@ const expectations = {
4747
'network-requests': {
4848
details: {
4949
items: {
50-
// We want to make sure we are finding the iframe's requests (paulirish.com) *AND*
51-
// the iframe's iframe's iframe's requests (youtube.com/doubleclick/etc).
52-
// - paulirish.com ~40-60 requests
53-
// - paulirish.com + all descendant iframes ~80-90 requests
54-
length: '>70',
50+
// We want to make sure we are finding the iframe's requests (paulirish.com) *AND*
51+
// the iframe's iframe's iframe's requests (youtube.com/doubleclick/etc).
52+
_includes: [
53+
{url: 'http://localhost:10200/oopif-requests.html', finished: true, statusCode: 200, resourceType: 'Document'},
54+
55+
// Paulirish iframe and subresource
56+
{url: 'https://www.paulirish.com/2012/why-moving-elements-with-translate-is-better-than-posabs-topleft/', finished: true, statusCode: 200, resourceType: 'Document'},
57+
{url: 'https://www.paulirish.com/avatar150.jpg', finished: true, statusCode: 200, resourceType: 'Image'},
58+
{url: 'https://www.googletagmanager.com/gtag/js?id=G-PGXNGYWP8E', finished: true, statusCode: 200, resourceType: 'Script'},
59+
{url: /^https:\/\/fonts\.googleapis\.com\/css/, finished: true, statusCode: 200, resourceType: 'Stylesheet'},
60+
61+
// Youtube iframe (OOPIF) and some subresources
62+
// FYI: Youtube has a ServiceWorker which sometimes cancels the document request. As a result, there will sometimes be multiple requests for this file.
63+
{url: 'https://www.youtube.com/embed/NZelrwd_iRs', finished: true, statusCode: 200, resourceType: 'Document'},
64+
{url: /^https:\/\/www\.youtube\.com\/.*?player.*?css/, finished: true, statusCode: 200, resourceType: 'Stylesheet'},
65+
{url: /^https:\/\/www\.youtube\.com\/.*?\/embed.js/, finished: true, statusCode: 200, resourceType: 'Script'},
66+
67+
// Disqus iframe (OOPIF)
68+
{url: /^https:\/\/disqus\.com\/embed\/comments\//, finished: true, statusCode: 200, resourceType: 'Document'},
69+
// Disqus subframe (that's a new OOPIF)
70+
{url: 'https://accounts.google.com/o/oauth2/iframe', finished: true, statusCode: 200, resourceType: 'Document'},
71+
],
5572
},
5673
},
5774
},

0 commit comments

Comments
 (0)