Skip to content

Commit

Permalink
lets avoid text cuz fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Aug 1, 2023
1 parent 3134867 commit 12786db
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
3 changes: 2 additions & 1 deletion cli/test/fixtures/screenshot-nodes.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
margin: 10px;
padding: 5px;
}
/* Want a LCP, but not any image or text visible! */
img {
opacity: 0.001;
}
Expand All @@ -35,7 +36,7 @@
</head>

<body>
<p id="textEl">Screenshot tester 2</p>
<p id="textEl"></p>

<script>
const params = new URLSearchParams(document.location.search);
Expand Down
35 changes: 19 additions & 16 deletions core/test/gather/gatherers/full-page-screenshot-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ describe('FullPageScreenshot gatherer', () => {
if (!(node.id.includes('green') || node.id.includes('red'))) {
continue;
}
if (!node.id.includes('el-')) {
continue;
}

const expectedColor = hexToRgb(node.id.includes('green') ? '#427f36' : '#8a4343');
const result = {id: node.id, success: true};
Expand Down Expand Up @@ -430,15 +433,15 @@ describe('FullPageScreenshot gatherer', () => {
const rectExpectations = [
{
id: 'el-1-red',
top: 43,
bottom: 53,
top: 10,
bottom: 20,
left: 18,
right: 178,
},
{
id: 'el-2-green',
top: 93,
bottom: 153,
top: 60,
bottom: 120,
left: 48,
right: 108,
},
Expand All @@ -456,15 +459,15 @@ describe('FullPageScreenshot gatherer', () => {
const rectExpectations = [
{
id: 'el-1-red',
top: 61,
bottom: 71,
top: 10,
bottom: 20,
left: 18,
right: 178,
},
{
id: 'el-2-green',
top: 111,
bottom: 171,
top: 60,
bottom: 120,
left: 48,
right: 108,
},
Expand All @@ -482,15 +485,15 @@ describe('FullPageScreenshot gatherer', () => {
const rectExpectations = [
{
id: 'el-1-red',
top: 43,
bottom: 53,
top: 10,
bottom: 20,
left: 18,
right: 178,
},
{
id: 'el-2-green',
top: 93,
bottom: 153,
top: 60,
bottom: 120,
left: 48,
right: 108,
},
Expand All @@ -508,15 +511,15 @@ describe('FullPageScreenshot gatherer', () => {
const rectExpectations = [
{
id: 'el-1-red',
top: 43,
bottom: 53,
top: 10,
bottom: 20,
left: 18,
right: 178,
},
{
id: 'el-2-green',
top: 93,
bottom: 153,
top: 60,
bottom: 120,
left: 48,
right: 108,
},
Expand Down

0 comments on commit 12786db

Please sign in to comment.