Skip to content

Commit

Permalink
Fix CSS linting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sdoskich committed Dec 21, 2024
1 parent 681bc50 commit a9832ab
Show file tree
Hide file tree
Showing 23 changed files with 2,435 additions and 27 deletions.
54 changes: 54 additions & 0 deletions backstop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"id": "backstop_default",
"viewports": [
{
"label": "phone",
"width": 320,
"height": 480
},
{
"label": "tablet",
"width": 1024,
"height": 768
}
],
"onBeforeScript": "puppet/onBefore.js",
"onReadyScript": "puppet/onReady.js",
"scenarios": [
{
"label": "BackstopJS Homepage",
"cookiePath": "backstop_data/engine_scripts/cookies.json",
"url": "https://garris.github.io/BackstopJS/",
"referenceUrl": "",
"readyEvent": "",
"readySelector": "",
"delay": 0,
"hideSelectors": [],
"removeSelectors": [],
"hoverSelector": "",
"clickSelector": "",
"postInteractionWait": 0,
"selectors": [],
"selectorExpansion": true,
"expect": 0,
"misMatchThreshold" : 0.1,
"requireSameDimensions": true
}
],
"paths": {
"bitmaps_reference": "backstop_data/bitmaps_reference",
"bitmaps_test": "backstop_data/bitmaps_test",
"engine_scripts": "backstop_data/engine_scripts",
"html_report": "backstop_data/html_report",
"ci_report": "backstop_data/ci_report"
},
"report": ["browser"],
"engine": "puppeteer",
"engineOptions": {
"args": ["--no-sandbox"]
},
"asyncCaptureLimit": 5,
"asyncCompareLimit": 50,
"debug": false,
"debugWindow": false
}
2 changes: 1 addition & 1 deletion backstop_data/engine_scripts/cookies.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"httpOnly": false,
"secure": false,
"session": false,
"sameSite": "no_restriction"
"sameSite": "Lax"
}
]
14 changes: 8 additions & 6 deletions backstop_data/engine_scripts/puppet/clickAndHoverHelper.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = async (page, scenario) => {
var hoverSelector = scenario.hoverSelectors || scenario.hoverSelector;
var clickSelector = scenario.clickSelectors || scenario.clickSelector;
var keyPressSelector = scenario.keyPressSelectors || scenario.keyPressSelector;
var scrollToSelector = scenario.scrollToSelector;
var postInteractionWait = scenario.postInteractionWait; // selector [str] | ms [int]
const hoverSelector = scenario.hoverSelectors || scenario.hoverSelector;
const clickSelector = scenario.clickSelectors || scenario.clickSelector;
const keyPressSelector = scenario.keyPressSelectors || scenario.keyPressSelector;
const scrollToSelector = scenario.scrollToSelector;
const postInteractionWait = scenario.postInteractionWait; // selector [str] | ms [int]

if (keyPressSelector) {
for (const keyPressSelectorItem of [].concat(keyPressSelector)) {
Expand All @@ -27,7 +27,9 @@ module.exports = async (page, scenario) => {
}

if (postInteractionWait) {
await new Promise(resolve => setTimeout(resolve, postInteractionWait));
await new Promise(resolve => {
setTimeout(resolve, postInteractionWait);
});
}

if (scrollToSelector) {
Expand Down
12 changes: 8 additions & 4 deletions backstop_data/engine_scripts/puppet/loadCookies.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var fs = require('fs');
const fs = require('fs');

module.exports = async (page, scenario) => {
var cookies = [];
var cookiePath = scenario.cookiePath;
let cookies = [];
const cookiePath = scenario.cookiePath;

// READ COOKIES FROM FILE IF EXISTS
if (fs.existsSync(cookiePath)) {
Expand All @@ -11,7 +11,11 @@ module.exports = async (page, scenario) => {

// MUNGE COOKIE DOMAIN
cookies = cookies.map(cookie => {
cookie.url = 'https://' + cookie.domain;
if (cookie.domain.startsWith('http://') || cookie.domain.startsWith('https://')) {
cookie.url = cookie.domain;
} else {
cookie.url = 'https://' + cookie.domain;
}
delete cookie.domain;
return cookie;
});
Expand Down
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@mate-academy/linthtml-config": "latest",
"@mate-academy/scripts": "^1.9.12",
"@mate-academy/stylelint-config": "latest",
"backstopjs": "6.3.23",
"backstopjs": "^6.3.23",
"jest": "^29.7.0",
"parcel": "^2.12.0",
"prettier": "^3.3.2",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added reports/html_report/assets/fonts/Lato-Bold.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions reports/html_report/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
report({
"testSuite": "BackstopJS",
"tests": [
{
"pair": {
"reference": "../bitmaps_reference/backstop_default_BackstopJS_Homepage_0_document_0_phone.png",
"test": "../bitmaps_test/20241221-130037/backstop_default_BackstopJS_Homepage_0_document_0_phone.png",
"selector": "document",
"fileName": "backstop_default_BackstopJS_Homepage_0_document_0_phone.png",
"label": "BackstopJS Homepage",
"requireSameDimensions": true,
"misMatchThreshold": 0.1,
"url": "https://garris.github.io/BackstopJS/",
"referenceUrl": "",
"expect": 0,
"viewportLabel": "phone",
"error": "Reference file not found /Users/sergij/projects/layout_moyo-header/backstop_data/bitmaps_reference/backstop_default_BackstopJS_Homepage_0_document_0_phone.png"
},
"status": "fail"
},
{
"pair": {
"reference": "../bitmaps_reference/backstop_default_BackstopJS_Homepage_0_document_1_tablet.png",
"test": "../bitmaps_test/20241221-130037/backstop_default_BackstopJS_Homepage_0_document_1_tablet.png",
"selector": "document",
"fileName": "backstop_default_BackstopJS_Homepage_0_document_1_tablet.png",
"label": "BackstopJS Homepage",
"requireSameDimensions": true,
"misMatchThreshold": 0.1,
"url": "https://garris.github.io/BackstopJS/",
"referenceUrl": "",
"expect": 0,
"viewportLabel": "tablet",
"error": "Reference file not found /Users/sergij/projects/layout_moyo-header/backstop_data/bitmaps_reference/backstop_default_BackstopJS_Homepage_0_document_1_tablet.png"
},
"status": "fail"
}
],
"id": "backstop_default"
});
Loading

0 comments on commit a9832ab

Please sign in to comment.