diff --git a/src/support/results/expectedResultsDesktop.json b/src/support/results/expectedResultsDesktop.json
index da3c37ac..4c815f95 100644
--- a/src/support/results/expectedResultsDesktop.json
+++ b/src/support/results/expectedResultsDesktop.json
@@ -184,6 +184,7 @@
"enabled": true
},
"lcp_single_double": {
+ "comment": "LCP on this template is from an tag which is not handled by default. Hence, we expect no LCP to be identified.",
"lcp": [],
"viewport": [],
"enabled": true
@@ -311,6 +312,7 @@
"enabled": true
},
"lcp_6647_svgbg_template": {
+ "comment": "Contains only SVG and background-image styles starting with data:image. Those are not captured by our OCI feature.",
"lcp": [],
"viewport": [],
"enabled": true
diff --git a/src/support/results/expectedResultsMobile.json b/src/support/results/expectedResultsMobile.json
index 978242f3..d2b5d715 100644
--- a/src/support/results/expectedResultsMobile.json
+++ b/src/support/results/expectedResultsMobile.json
@@ -175,6 +175,7 @@
"enabled": true
},
"lcp_single_double": {
+ "comment": "LCP on this template is from an tag which is not handled by default. Hence, we expect no LCP to be identified.",
"lcp": [
],
"viewport": [],
@@ -306,6 +307,7 @@
"enabled": true
},
"lcp_6647_svgbg_template": {
+ "comment": "Contains only SVG and background-image styles starting with data:image. Those are not captured by our OCI feature.",
"lcp": [],
"viewport": [],
"enabled": true
diff --git a/src/support/steps/lcp-beacon-script.ts b/src/support/steps/lcp-beacon-script.ts
index fc6c124f..cd7508b4 100644
--- a/src/support/steps/lcp-beacon-script.ts
+++ b/src/support/steps/lcp-beacon-script.ts
@@ -21,7 +21,7 @@ import fs from 'fs/promises';
let data: string,
truthy: boolean = true,
failMsg: string,
- jsonData: Record,
+ jsonData: Record,
isDbResultAvailable: boolean = true;
const actual: LcpData = {};
@@ -71,7 +71,7 @@ When('I visit the urls for {string}', async function (this: ICustomWorld, formFa
await this.page.waitForFunction(() => {
const beacon = document.querySelector('[data-name="wpr-wpr-beacon"]');
return beacon && beacon.getAttribute('beacon-completed') === 'true';
- });
+ }, { timeout: 900000 });
if (formFactor !== 'desktop') {
isMobile = 1;
@@ -95,7 +95,8 @@ When('I visit the urls for {string}', async function (this: ICustomWorld, formFa
actual[key] = {
url: url,
lcp: resultFromStdout[0].lcp,
- viewport: resultFromStdout[0].viewport
+ viewport: resultFromStdout[0].viewport,
+ comment: jsonData[key].comment ?? ''
}
}
}
@@ -125,7 +126,8 @@ Then('lcp and atf should be as expected for {string}', async function (this: ICu
// Check if expected lcp is present in actual lcp.
if (!actual[key].lcp.includes(lcp)) {
truthy = false;
- failMsg += `Expected LCP for ${formFactor} - ${lcp} for ${actual[key].url} is not present in actual - ${actual[key].lcp}\n\n\n`;
+ failMsg += `Expected LCP for ${formFactor} - ${lcp} for ${actual[key].url} is not present in actual - ${actual[key].lcp}
+ more info -- ( ${actual[key].comment} )\n\n\n`;
}
}
@@ -134,7 +136,8 @@ Then('lcp and atf should be as expected for {string}', async function (this: ICu
for (const viewport of expected.viewport) {
if (!actual[key].viewport.includes(viewport)) {
truthy = false;
- failMsg += `Expected Viewport for ${formFactor} - ${viewport} for ${actual[key].url} is not present in actual - ${actual[key].viewport}\n\n\n`;
+ failMsg += `Expected Viewport for ${formFactor} - ${viewport} for ${actual[key].url} is not present in actual - ${actual[key].viewport}
+ more info -- ( ${actual[key].comment} )\n\n\n`;
}
}
}
diff --git a/utils/types.ts b/utils/types.ts
index 64dddf39..d03be64b 100644
--- a/utils/types.ts
+++ b/utils/types.ts
@@ -104,7 +104,8 @@ export interface LcpData {
[key: string]: {
url: string,
lcp: string,
- viewport: string
+ viewport: string,
+ comment: string
}
}