Skip to content
Open

Form #18

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .stylelintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ module.exports = {
{
resolveNestedSelectors: true,
message: function expected(selectorValue) {
return `Expected class selector "${selectorValue}" to match BEM CSS pattern https://en.bem.info/methodology/css. Selector validation tool: https://regexr.com/3apms`;
},
return `Expected class selector "${selectorValue}" to match BEM CSS pattern https://en.bem.info/methodology/css. Selector validation tool: https://regexr.com/3apms`;
},
},
],
"selector-max-id": 0,
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
npm i
```

5. Запустите проект с помощью
5. Запустите проект с помощью

```shell
npm run dev
Expand All @@ -36,7 +36,7 @@ npm run dev
Запустить тестирование вашего проекта можно с помощью

```shell
npm run test
npm run test
```

Тестовый фреймворк обращается к адресу `localhost:3000` поэтому сервер должен быть запущен с `npm run dev`, запускайте команду тестирования в новом терминале, не закрывая сервер с проектом.
Expand Down
58 changes: 29 additions & 29 deletions engine_scripts/onReady.cjs
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
module.exports = async (page, scenario, vp) => {
console.log('SCENARIO > ' + scenario.label);
console.log('SCENARIO > ' + scenario.label);

// add more ready handlers here...
await page.waitForFunction(() => {
return document.fonts.ready.then(() => {
console.log('Fonts loaded');
return true;
});
// add more ready handlers here...
await page.waitForFunction(() => {
return document.fonts.ready.then(() => {
console.log('Fonts loaded');
return true;
});
});

await page.evaluate((scenario) => {
/** force load lazy images */
const lazyImages = document.querySelectorAll('img[loading="lazy"]');
lazyImages.forEach((i) => {
i.removeAttribute('loading');
});
}, scenario);
await page.evaluate((scenario) => {
/** force load lazy images */
const lazyImages = document.querySelectorAll('img[loading="lazy"]');
lazyImages.forEach((i) => {
i.removeAttribute('loading');
});
}, scenario);

// await require('./clickAndHoverHelper')(page, scenario);
// await require('./clickAndHoverHelper')(page, scenario);

if (scenario.showSelectors) {
await Promise.all(
scenario.showSelectors.map(async (selector) => {
await page
.evaluate((sel) => {
document.querySelectorAll(sel).forEach(s => {
s.style.visibility = 'visible';
});
}, selector);
})
);
}
if (scenario.showSelectors) {
await Promise.all(
scenario.showSelectors.map(async (selector) => {
await page
.evaluate((sel) => {
document.querySelectorAll(sel).forEach(s => {
s.style.visibility = 'visible';
});
}, selector);
})
);
}

await page.waitForTimeout(scenario.delay || 0);
};
await page.waitForTimeout(scenario.delay || 0);
};
22 changes: 11 additions & 11 deletions js.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ module.exports = {
requireSameDimensions: true,
delay: 500
},
/* {
"label": "faq-tab-2",
"url": "http://localhost:3000/index.html",
"referenceUrl": "./figma/index.html",
selectors: [`[data-test="faq"]`],
misMatchThreshold: 1.0,
"onReadyScript": "faq-tab-2.cjs",
requireSameDimensions: true,
delay: 1000
},*/
/* {
"label": "faq-tab-2",
"url": "http://localhost:3000/index.html",
"referenceUrl": "./figma/index.html",
selectors: [`[data-test="faq"]`],
misMatchThreshold: 1.0,
"onReadyScript": "faq-tab-2.cjs",
requireSameDimensions: true,
delay: 1000
},*/
{
"label": "reviews-prev",
"url": "http://localhost:3000/index.html",
Expand Down Expand Up @@ -117,7 +117,7 @@ module.exports = {
"engine": "puppeteer",
"engineOptions": {
"args": ["--no-sandbox"],
"gotoParameters": {"waitUntil": ["load", "networkidle0"], timeout: 10000},
"gotoParameters": { "waitUntil": ["load", "networkidle0"], timeout: 10000 },
},
"asyncCaptureLimit": 10,
"asyncCompareLimit": 50,
Expand Down
80 changes: 40 additions & 40 deletions pp.config.cjs
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
const desktopSections = [
{section: 'hero', misMatchThreshold: 0.7},
{section: 'about', misMatchThreshold: 0.9},
{section: 'price', misMatchThreshold: 0.9},
{section: 'games', misMatchThreshold: 0.9},
{section: 'juri', misMatchThreshold: 0.9},
{section: 'features', misMatchThreshold: 0.8},
{section: 'offers', misMatchThreshold: 0.9},
{section: 'faq', misMatchThreshold: 0.9},
{section: 'reviews', misMatchThreshold: 0.7},
{section: 'form', misMatchThreshold: 0.9},
{section: 'footer', misMatchThreshold: 1.0}
{ section: 'hero', misMatchThreshold: 0.7 },
{ section: 'about', misMatchThreshold: 0.9 },
{ section: 'price', misMatchThreshold: 0.9 },
{ section: 'games', misMatchThreshold: 0.9 },
{ section: 'juri', misMatchThreshold: 0.9 },
{ section: 'features', misMatchThreshold: 0.8 },
{ section: 'offers', misMatchThreshold: 0.9 },
{ section: 'faq', misMatchThreshold: 0.9 },
{ section: 'reviews', misMatchThreshold: 0.7 },
{ section: 'form', misMatchThreshold: 0.9 },
{ section: 'footer', misMatchThreshold: 1.0 }
];

const tabletSections = [
{section: 'hero', misMatchThreshold: 1.0},
{section: 'about', misMatchThreshold: 0.8},
{section: 'price', misMatchThreshold: 0.7},
{section: 'games', misMatchThreshold: 0.8},
{section: 'juri', misMatchThreshold: 0.7},
{section: 'features', misMatchThreshold: 1.6},
{section: 'offers', misMatchThreshold: 0.7},
{section: 'faq', misMatchThreshold: 1.6},
{section: 'reviews', misMatchThreshold: 1.3},
{section: 'form', misMatchThreshold: 1.0},
{section: 'footer', misMatchThreshold: 1.9}
{ section: 'hero', misMatchThreshold: 1.0 },
{ section: 'about', misMatchThreshold: 0.8 },
{ section: 'price', misMatchThreshold: 0.7 },
{ section: 'games', misMatchThreshold: 0.8 },
{ section: 'juri', misMatchThreshold: 0.7 },
{ section: 'features', misMatchThreshold: 1.6 },
{ section: 'offers', misMatchThreshold: 0.7 },
{ section: 'faq', misMatchThreshold: 1.6 },
{ section: 'reviews', misMatchThreshold: 1.3 },
{ section: 'form', misMatchThreshold: 1.0 },
{ section: 'footer', misMatchThreshold: 1.9 }
];

const mobileSections = [
{section: 'hero', misMatchThreshold: 3.7},
{section: 'about', misMatchThreshold: 1.8},
{section: 'price', misMatchThreshold: 0.9},
{section: 'games', misMatchThreshold: 1.1},
{section: 'juri', misMatchThreshold: 0.7},
{section: 'features', misMatchThreshold: 2.7},
{section: 'offers', misMatchThreshold: 1.4},
{section: 'faq', misMatchThreshold: 1.7},
{section: 'reviews', misMatchThreshold: 2.7},
{section: 'form', misMatchThreshold: 1.6},
{section: 'footer', misMatchThreshold: 2.0}
{ section: 'hero', misMatchThreshold: 3.7 },
{ section: 'about', misMatchThreshold: 1.8 },
{ section: 'price', misMatchThreshold: 0.9 },
{ section: 'games', misMatchThreshold: 1.1 },
{ section: 'juri', misMatchThreshold: 0.7 },
{ section: 'features', misMatchThreshold: 2.7 },
{ section: 'offers', misMatchThreshold: 1.4 },
{ section: 'faq', misMatchThreshold: 1.7 },
{ section: 'reviews', misMatchThreshold: 2.7 },
{ section: 'form', misMatchThreshold: 1.6 },
{ section: 'footer', misMatchThreshold: 2.0 }
];

const VIEWPORTS = {
'desktop': {"label": "desktop", "width": 1366, "height": 800},
'tablet': {"label": "tablet", "width": 768, "height": 1024},
'mobile': {"label": "mobile", "width": 320, "height": 480}
'desktop': { "label": "desktop", "width": 1366, "height": 800 },
'tablet': { "label": "tablet", "width": 768, "height": 1024 },
'mobile': { "label": "mobile", "width": 320, "height": 480 }
};

const URL = 'http://localhost:3000/index.html';
Expand Down Expand Up @@ -91,9 +91,9 @@ module.exports = {
scaleToSameSize: false
},
"scenarios": [
...desktopSections.map(({section, misMatchThreshold}) => generateScenario(section, misMatchThreshold, 'desktop')),
...tabletSections.map(({section, misMatchThreshold}) => generateScenario(section, misMatchThreshold, 'tablet')),
...mobileSections.map(({section, misMatchThreshold}) => generateScenario(section, misMatchThreshold, 'mobile')),
...desktopSections.map(({ section, misMatchThreshold }) => generateScenario(section, misMatchThreshold, 'desktop')),
...tabletSections.map(({ section, misMatchThreshold }) => generateScenario(section, misMatchThreshold, 'tablet')),
...mobileSections.map(({ section, misMatchThreshold }) => generateScenario(section, misMatchThreshold, 'mobile')),
],
fileNameTemplate: '{scenarioLabel}_{viewportLabel}',
"paths": {
Expand All @@ -107,7 +107,7 @@ module.exports = {
"engine": "puppeteer",
"engineOptions": {
"args": ["--no-sandbox"],
"gotoParameters": {"waitUntil": ["load", "networkidle0"], timeout: 40000},
"gotoParameters": { "waitUntil": ["load", "networkidle0"], timeout: 40000 },
},
"asyncCaptureLimit": 10,
"asyncCompareLimit": 50,
Expand Down
Binary file added source/fonts/AlumniSans-ExtraBold.woff
Binary file not shown.
Binary file added source/fonts/AlumniSans-ExtraBold.woff2
Binary file not shown.
Binary file added source/fonts/AlumniSans-SemiBold.woff
Binary file not shown.
Binary file added source/fonts/AlumniSans-SemiBold.woff2
Binary file not shown.
Binary file added source/fonts/RobotoCondensed-Bold.woff
Binary file not shown.
Binary file added source/fonts/RobotoCondensed-Bold.woff2
Binary file not shown.
Binary file added source/fonts/RobotoCondensed-Light.woff
Binary file not shown.
Binary file added source/fonts/RobotoCondensed-Light.woff2
Binary file not shown.
Binary file added source/fonts/RobotoCondensed-Regular.woff
Binary file not shown.
Binary file added source/fonts/RobotoCondensed-Regular.woff2
Binary file not shown.
Binary file added source/img/action-desktop.jpg
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 source/img/action-desktop.webp
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 source/img/[email protected]
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 source/img/[email protected]
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 source/img/action-mobile.jpg
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 source/img/action-mobile.webp
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 source/img/[email protected]
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 source/img/[email protected]
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 source/img/action-tablet.jpg
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 source/img/action-tablet.webp
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 source/img/[email protected]
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 source/img/[email protected]
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 source/img/avatar.png
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 source/img/avatar.webp
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 source/img/[email protected]
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 source/img/[email protected]
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 source/img/decor-desktop.png
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 source/img/decor-desktop.webp
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 source/img/[email protected]
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 source/img/[email protected]
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 source/img/decor-tablet.png
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 source/img/decor-tablet.webp
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 source/img/[email protected]
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 source/img/[email protected]
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 source/img/games-desktop.jpg
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 source/img/games-desktop.webp
Binary file added source/img/[email protected]
Binary file added source/img/[email protected]
Binary file added source/img/games-mobile.jpg
Binary file added source/img/games-mobile.webp
Binary file added source/img/[email protected]
Binary file added source/img/[email protected]
Binary file added source/img/games-tablet.jpg
Binary file added source/img/games-tablet.webp
Binary file added source/img/[email protected]
Binary file added source/img/[email protected]
Binary file added source/img/gym-desktop.jpg
Binary file added source/img/gym-desktop.webp
Binary file added source/img/[email protected]
Binary file added source/img/[email protected]
Binary file added source/img/gym-mobile.jpg
Binary file added source/img/gym-mobile.webp
Binary file added source/img/[email protected]
Binary file added source/img/[email protected]
Binary file added source/img/gym-tablet.jpg
Binary file added source/img/gym-tablet.webp
Binary file added source/img/[email protected]
Binary file added source/img/[email protected]
Binary file added source/img/hero-desktop.jpg
Binary file added source/img/hero-desktop.webp
Binary file added source/img/[email protected]
Binary file added source/img/[email protected]
Binary file added source/img/hero-tablet.jpg
Binary file added source/img/hero-tablet.webp
Binary file added source/img/[email protected]
Binary file added source/img/[email protected]
Binary file added source/img/juri/juri-1.jpg
Binary file added source/img/juri/juri-1.webp
Binary file added source/img/juri/[email protected]
Binary file added source/img/juri/[email protected]
Binary file added source/img/juri/juri-2.jpg
Binary file added source/img/juri/juri-2.webp
Binary file added source/img/juri/[email protected]
Binary file added source/img/juri/[email protected]
Binary file added source/img/juri/juri-3.jpg
Binary file added source/img/juri/juri-3.webp
Binary file added source/img/juri/[email protected]
Binary file added source/img/juri/[email protected]
Binary file added source/img/juri/juri-4.jpg
Binary file added source/img/juri/juri-4.webp
Binary file added source/img/juri/[email protected]
Binary file added source/img/juri/[email protected]
3 changes: 3 additions & 0 deletions source/img/sprite/icon-arrow.svg
3 changes: 3 additions & 0 deletions source/img/sprite/icon-minus.svg
3 changes: 3 additions & 0 deletions source/img/sprite/icon-ok.svg
3 changes: 3 additions & 0 deletions source/img/sprite/icon-play.svg
3 changes: 3 additions & 0 deletions source/img/sprite/icon-plus.svg
3 changes: 3 additions & 0 deletions source/img/sprite/icon-reddit.svg
5 changes: 5 additions & 0 deletions source/img/sprite/icon-rubble.svg
3 changes: 3 additions & 0 deletions source/img/sprite/icon-vk.svg
5 changes: 0 additions & 5 deletions source/img/sprite/user.svg
Diff not rendered.
Loading