Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumCoder228 committed Nov 15, 2024
1 parent 2dab9a7 commit 27b8cf5
Show file tree
Hide file tree
Showing 3 changed files with 234 additions and 68 deletions.
90 changes: 22 additions & 68 deletions backstopConfig.js
Original file line number Diff line number Diff line change
@@ -1,79 +1,33 @@
'use strict';
// https://github.com/garris/BackstopJS#advanced-scenarios

const backstop = require('@mate-academy/backstop-config');
const { basicScenario } = backstop;

const basic = {
...basicScenario,
label: 'Elementary test',
referenceUrl: basicScenario.referenceUrl + '/catalog/',
};

const config = {
...backstop,
fileNameTemplate: '{scenarioLabel}_{viewportLabel}',
onBeforeScript: 'puppet/onBefore.js',
onReadyScript: 'puppet/onReady.js',
module.exports = {
id: "layout_catalog_test",
viewports: [
{
name: '1024px',
width: 1024,
height: 768,
label: "desktop",
width: 1920,
height: 1080,
},
{
name: '1200px',
width: 1200,
height: 768,
label: "tablet",
width: 768,
height: 1024,
},
],
scenarios: [
{
...basic,
label: 'Entire document',
selectors: ['document'],
},
{
...basic,
label: 'Header tag',
selectors: ['header'],
misMatchThreshold: 5
},
{
...basic,
label: 'Nav tag',
selectors: ['nav'],
},
{
...basic,
label: 'Link with data-qa_hover',
selectors: ['[data-qa="nav-hover"]'],
hoverSelector: '[data-qa="nav-hover"]',
postInteractionWait: 1000,
},
{
...basic,
label: 'Link with class_is-active',
selectors: ['a.is-active'],
},
{
...basic,
label: 'Main tag',
selectors: ['main'],
},
{
...basic,
label: 'Card with data-qa_card',
selectors: ['[data-qa="card"]'],
label: "Home Page",
url: "http://localhost:8080",
selectors: ["document"],
misMatchThreshold: 0.1,
},
// {
// ...basic,
// label: 'Card with data-qa_card-hover',
// selectors: ['[data-qa="card"]'],
// hoverSelector: '[data-qa="card-hover"]',
// postInteractionWait: 1000,
// },
],
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",
},
engine: "puppeteer",
report: ["browser"],
debug: false,
};

module.exports = config;
Loading

0 comments on commit 27b8cf5

Please sign in to comment.