Skip to content

Commit

Permalink
make build
Browse files Browse the repository at this point in the history
  • Loading branch information
AnastasiiaKriuchkova committed May 17, 2023
0 parents commit 10b3cb0
Show file tree
Hide file tree
Showing 36 changed files with 6,135 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-wid'o0p;[th, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>Moyo header</title><link rel="stylesheet" href="style.367d488d.css"><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com"><link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet"></head><body> <header> <div class="logo"> <a class="logo__link" href="#home"> <img class="logo__item" src="logo.6c938e44.png" alt="Logo Moyo"> </a> </div> <nav class="nav"> <ul class="nav__list"> <li class="nav__item"> <a class="nav__link is-active" href="#apple">Apple</a> </li> <li class="nav__item"> <a class="nav__link" href="#samsung">Samsung</a> </li> <li class="nav__item"> <a class="nav__link" href="#smartphones">Smartphones</a> </li> <li class="nav__item" data-qa="hover"> <a class="nav__link" href="#laptops & Computers"> Laptops & Computers </a> </li> <li class="nav__item"> <a class="nav__link" href="#gadgets">Gadgets</a> </li> <li class="nav__item"> <a class="nav__link" href="#tablets">Tablets</a> </li> <li class="nav__item"> <a class="nav__link" href="#photo">Photo</a> </li> <li class="nav__item"> <a class="nav__link" href="#video">Video</a> </li> </ul> </nav> </header> </body></html>
Binary file added logo.6c938e44.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 report/bitmaps_reference/Header_tag_1024px.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 report/bitmaps_reference/Header_tag_1200px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 report/bitmaps_reference/Nav_tag_1024px.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 report/bitmaps_reference/Nav_tag_1200px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions report/engine_scripts/cookies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"domain": ".www.yourdomain.com",
"path": "/",
"name": "yourCookieName",
"value": "yourCookieValue",
"expirationDate": 1798790400,
"hostOnly": false,
"httpOnly": false,
"secure": false,
"session": false,
"sameSite": "no_restriction"
}
]
Binary file added report/engine_scripts/imageStub.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions report/engine_scripts/puppet/clickAndHoverHelper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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]

if (keyPressSelector) {
for (const keyPressSelectorItem of [].concat(keyPressSelector)) {
await page.waitFor(keyPressSelectorItem.selector);
await page.type(keyPressSelectorItem.selector, keyPressSelectorItem.keyPress);
}
}

if (hoverSelector) {
for (const hoverSelectorIndex of [].concat(hoverSelector)) {
await page.waitFor(hoverSelectorIndex);
await page.hover(hoverSelectorIndex);
}
}

if (clickSelector) {
for (const clickSelectorIndex of [].concat(clickSelector)) {
await page.waitFor(clickSelectorIndex);
await page.click(clickSelectorIndex);
}
}

if (postInteractionWait) {
await page.waitFor(postInteractionWait);
}

if (scrollToSelector) {
await page.waitFor(scrollToSelector);
await page.evaluate(scrollToSelector => {
document.querySelector(scrollToSelector).scrollIntoView();
}, scrollToSelector);
}
};
29 changes: 29 additions & 0 deletions report/engine_scripts/puppet/loadCookies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
var fs = require('fs');

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

// READ COOKIES FROM FILE IF EXISTS
if (fs.existsSync(cookiePath)) {
cookies = JSON.parse(fs.readFileSync(cookiePath));
}

// MUNGE COOKIE DOMAIN
cookies = cookies.map(cookie => {
cookie.url = 'https://' + cookie.domain;
delete cookie.domain;
return cookie;
});

// SET COOKIES
const setCookies = async () => {
return Promise.all(
cookies.map(async (cookie) => {
await page.setCookie(cookie);
})
);
};
await setCookies();
console.log('Cookie state restored with:', JSON.stringify(cookies, null, 2));
};
3 changes: 3 additions & 0 deletions report/engine_scripts/puppet/onBefore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = async (page, scenario, vp) => {
await require('./loadCookies')(page, scenario);
};
6 changes: 6 additions & 0 deletions report/engine_scripts/puppet/onReady.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = async (page, scenario, vp) => {
console.log('SCENARIO > ' + scenario.label);
await require('./clickAndHoverHelper')(page, scenario);

// add more ready handlers here...
};
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 report/html_report/assets/fonts/Lato-Bold.ttf
Binary file not shown.
Binary file added report/html_report/assets/fonts/Lato-Regular.ttf
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.
205 changes: 205 additions & 0 deletions report/html_report/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
report({
"testSuite": "BackstopJS",
"tests": [
{
"pair": {
"reference": "../bitmaps_reference/Header_tag_1024px.png",
"test": "../bitmaps_test/20230517-211128/Header_tag_1024px.png",
"selector": "header",
"fileName": "Header_tag_1024px.png",
"label": "Header tag",
"requireSameDimensions": false,
"misMatchThreshold": 1,
"url": "http://localhost:3001/index.html",
"referenceUrl": "https://mate-academy.github.io/layout_solutions/moyo-header/",
"expect": 0,
"viewportLabel": "1024px",
"diff": {
"isSameDimensions": true,
"dimensionDifference": {
"width": 0,
"height": 0
},
"misMatchPercentage": "0.07",
"analysisTime": 28
}
},
"status": "pass"
},
{
"pair": {
"reference": "../bitmaps_reference/Header_tag_1200px.png",
"test": "../bitmaps_test/20230517-211128/Header_tag_1200px.png",
"selector": "header",
"fileName": "Header_tag_1200px.png",
"label": "Header tag",
"requireSameDimensions": false,
"misMatchThreshold": 1,
"url": "http://localhost:3001/index.html",
"referenceUrl": "https://mate-academy.github.io/layout_solutions/moyo-header/",
"expect": 0,
"viewportLabel": "1200px",
"diff": {
"isSameDimensions": true,
"dimensionDifference": {
"width": 0,
"height": 0
},
"misMatchPercentage": "0.06",
"analysisTime": 37
}
},
"status": "pass"
},
{
"pair": {
"reference": "../bitmaps_reference/Nav_tag_1024px.png",
"test": "../bitmaps_test/20230517-211128/Nav_tag_1024px.png",
"selector": "nav",
"fileName": "Nav_tag_1024px.png",
"label": "Nav tag",
"requireSameDimensions": false,
"misMatchThreshold": 1,
"url": "http://localhost:3001/index.html",
"referenceUrl": "https://mate-academy.github.io/layout_solutions/moyo-header/",
"expect": 0,
"viewportLabel": "1024px",
"diff": {
"isSameDimensions": true,
"dimensionDifference": {
"width": 0,
"height": 0
},
"misMatchPercentage": "0.11",
"analysisTime": 26
}
},
"status": "pass"
},
{
"pair": {
"reference": "../bitmaps_reference/Nav_tag_1200px.png",
"test": "../bitmaps_test/20230517-211128/Nav_tag_1200px.png",
"selector": "nav",
"fileName": "Nav_tag_1200px.png",
"label": "Nav tag",
"requireSameDimensions": false,
"misMatchThreshold": 1,
"url": "http://localhost:3001/index.html",
"referenceUrl": "https://mate-academy.github.io/layout_solutions/moyo-header/",
"expect": 0,
"viewportLabel": "1200px",
"diff": {
"isSameDimensions": true,
"dimensionDifference": {
"width": 0,
"height": 0
},
"misMatchPercentage": "0.11",
"analysisTime": 34
}
},
"status": "pass"
},
{
"pair": {
"reference": "../bitmaps_reference/Link_with_data-qa_hover_1024px.png",
"test": "../bitmaps_test/20230517-211128/Link_with_data-qa_hover_1024px.png",
"selector": "[data-qa=\"hover\"]",
"fileName": "Link_with_data-qa_hover_1024px.png",
"label": "Link with data-qa_hover",
"requireSameDimensions": false,
"misMatchThreshold": 1,
"url": "http://localhost:3001/index.html",
"referenceUrl": "https://mate-academy.github.io/layout_solutions/moyo-header/",
"expect": 0,
"viewportLabel": "1024px",
"diff": {
"isSameDimensions": true,
"dimensionDifference": {
"width": 0,
"height": 0
},
"misMatchPercentage": "0.00"
}
},
"status": "pass"
},
{
"pair": {
"reference": "../bitmaps_reference/Link_with_data-qa_hover_1200px.png",
"test": "../bitmaps_test/20230517-211128/Link_with_data-qa_hover_1200px.png",
"selector": "[data-qa=\"hover\"]",
"fileName": "Link_with_data-qa_hover_1200px.png",
"label": "Link with data-qa_hover",
"requireSameDimensions": false,
"misMatchThreshold": 1,
"url": "http://localhost:3001/index.html",
"referenceUrl": "https://mate-academy.github.io/layout_solutions/moyo-header/",
"expect": 0,
"viewportLabel": "1200px",
"diff": {
"isSameDimensions": true,
"dimensionDifference": {
"width": 0,
"height": 0
},
"misMatchPercentage": "0.00"
}
},
"status": "pass"
},
{
"pair": {
"reference": "../bitmaps_reference/Link_with_class_is-active_1024px.png",
"test": "../bitmaps_test/20230517-211128/Link_with_class_is-active_1024px.png",
"selector": "a.is-active",
"fileName": "Link_with_class_is-active_1024px.png",
"label": "Link with class_is-active",
"requireSameDimensions": false,
"misMatchThreshold": 1,
"url": "http://localhost:3001/index.html",
"referenceUrl": "https://mate-academy.github.io/layout_solutions/moyo-header/",
"expect": 0,
"viewportLabel": "1024px",
"diff": {
"isSameDimensions": true,
"dimensionDifference": {
"width": 0,
"height": 0
},
"misMatchPercentage": "1.94",
"analysisTime": 7
},
"diffImage": "../bitmaps_test/20230517-211128/failed_diff_Link_with_class_is-active_1024px.png"
},
"status": "fail"
},
{
"pair": {
"reference": "../bitmaps_reference/Link_with_class_is-active_1200px.png",
"test": "../bitmaps_test/20230517-211128/Link_with_class_is-active_1200px.png",
"selector": "a.is-active",
"fileName": "Link_with_class_is-active_1200px.png",
"label": "Link with class_is-active",
"requireSameDimensions": false,
"misMatchThreshold": 1,
"url": "http://localhost:3001/index.html",
"referenceUrl": "https://mate-academy.github.io/layout_solutions/moyo-header/",
"expect": 0,
"viewportLabel": "1200px",
"diff": {
"isSameDimensions": true,
"dimensionDifference": {
"width": 0,
"height": 0
},
"misMatchPercentage": "1.94",
"analysisTime": 15
},
"diffImage": "../bitmaps_test/20230517-211128/failed_diff_Link_with_class_is-active_1200px.png"
},
"status": "fail"
}
]
});
Loading

0 comments on commit 10b3cb0

Please sign in to comment.