Skip to content

Commit

Permalink
make build
Browse files Browse the repository at this point in the history
  • Loading branch information
v-zagorovskii committed Jul 19, 2024
0 parents commit a1b4f06
Show file tree
Hide file tree
Showing 42 changed files with 2,670 additions and 0 deletions.
1 change: 1 addition & 0 deletions Search.ccd3c07b.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions index.b7bfdc6e.css

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

1 change: 1 addition & 0 deletions index.b7bfdc6e.css.map

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

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-width, 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>Document</title><link rel="stylesheet" href="index.b7bfdc6e.css"><link href="https://fonts.cdnfonts.com/css/avenir" rel="stylesheet"></head><body> <form action="#" class="search-bar" data-qa="big"> <input type="text" placeholder="Try “Los Angeles“" class="big search-bar__item" data-qa="keypress"> </form> <form action="#" class="search-bar" data-qa="small"> <input type="text" placeholder="Try “Los Angeles“" class="search-bar__item small"> </form> </body></html>
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.
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.
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.
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.
167 changes: 167 additions & 0 deletions report/bitmaps_test/20240719-223229/report.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
{
"testSuite": "BackstopJS",
"tests": [
{
"pair": {
"reference": "..\\bitmaps_reference\\Entire_document_1024px.png",
"test": "..\\bitmaps_test\\20240719-223229\\Entire_document_1024px.png",
"selector": "document",
"fileName": "Entire_document_1024px.png",
"label": "Entire document",
"requireSameDimensions": false,
"misMatchThreshold": 1,
"url": "http://localhost:3001/index.html",
"referenceUrl": "https://mate-academy.github.io/layout_solutions/search-bar-airbnb/",
"expect": 0,
"viewportLabel": "1024px",
"diff": {
"isSameDimensions": false,
"dimensionDifference": {
"width": 0,
"height": 8
},
"rawMisMatchPercentage": 6.7352294921875,
"misMatchPercentage": "6.74",
"analysisTime": 33
},
"diffImage": "..\\bitmaps_test\\20240719-223229\\failed_diff_Entire_document_1024px.png"
},
"status": "fail"
},
{
"pair": {
"reference": "..\\bitmaps_reference\\Entire_document_720px.png",
"test": "..\\bitmaps_test\\20240719-223229\\Entire_document_720px.png",
"selector": "document",
"fileName": "Entire_document_720px.png",
"label": "Entire document",
"requireSameDimensions": false,
"misMatchThreshold": 1,
"url": "http://localhost:3001/index.html",
"referenceUrl": "https://mate-academy.github.io/layout_solutions/search-bar-airbnb/",
"expect": 0,
"viewportLabel": "720px",
"diff": {
"isSameDimensions": false,
"dimensionDifference": {
"width": 0,
"height": 8
},
"rawMisMatchPercentage": 7.467881944444445,
"misMatchPercentage": "7.47",
"analysisTime": 34
},
"diffImage": "..\\bitmaps_test\\20240719-223229\\failed_diff_Entire_document_720px.png"
},
"status": "fail"
},
{
"pair": {
"reference": "..\\bitmaps_reference\\Big_search_bar_data-qa_big_1024px.png",
"test": "..\\bitmaps_test\\20240719-223229\\Big_search_bar_data-qa_big_1024px.png",
"selector": "[data-qa=\"big\"]",
"fileName": "Big_search_bar_data-qa_big_1024px.png",
"label": "Big search bar data-qa_big",
"requireSameDimensions": false,
"misMatchThreshold": 1,
"url": "http://localhost:3001/index.html",
"referenceUrl": "https://mate-academy.github.io/layout_solutions/search-bar-airbnb/",
"expect": 0,
"viewportLabel": "1024px",
"diff": {
"isSameDimensions": false,
"dimensionDifference": {
"width": -16,
"height": 0
},
"rawMisMatchPercentage": 3.899274553571429,
"misMatchPercentage": "3.90",
"analysisTime": 26
},
"diffImage": "..\\bitmaps_test\\20240719-223229\\failed_diff_Big_search_bar_data-qa_big_1024px.png"
},
"status": "fail"
},
{
"pair": {
"reference": "..\\bitmaps_reference\\Big_search_bar_data-qa_big_720px.png",
"test": "..\\bitmaps_test\\20240719-223229\\Big_search_bar_data-qa_big_720px.png",
"selector": "[data-qa=\"big\"]",
"fileName": "Big_search_bar_data-qa_big_720px.png",
"label": "Big search bar data-qa_big",
"requireSameDimensions": false,
"misMatchThreshold": 1,
"url": "http://localhost:3001/index.html",
"referenceUrl": "https://mate-academy.github.io/layout_solutions/search-bar-airbnb/",
"expect": 0,
"viewportLabel": "720px",
"diff": {
"isSameDimensions": false,
"dimensionDifference": {
"width": -16,
"height": 0
},
"rawMisMatchPercentage": 4.861111111111112,
"misMatchPercentage": "4.86",
"analysisTime": 36
},
"diffImage": "..\\bitmaps_test\\20240719-223229\\failed_diff_Big_search_bar_data-qa_big_720px.png"
},
"status": "fail"
},
{
"pair": {
"reference": "..\\bitmaps_reference\\Small_search_bar_data-qa_small_1024px.png",
"test": "..\\bitmaps_test\\20240719-223229\\Small_search_bar_data-qa_small_1024px.png",
"selector": "[data-qa=\"small\"]",
"fileName": "Small_search_bar_data-qa_small_1024px.png",
"label": "Small search bar data-qa_small",
"requireSameDimensions": false,
"misMatchThreshold": 1,
"url": "http://localhost:3001/index.html",
"referenceUrl": "https://mate-academy.github.io/layout_solutions/search-bar-airbnb/",
"expect": 0,
"viewportLabel": "1024px",
"diff": {
"isSameDimensions": false,
"dimensionDifference": {
"width": -16,
"height": 0
},
"rawMisMatchPercentage": 4.6270461309523805,
"misMatchPercentage": "4.63",
"analysisTime": 20
},
"diffImage": "..\\bitmaps_test\\20240719-223229\\failed_diff_Small_search_bar_data-qa_small_1024px.png"
},
"status": "fail"
},
{
"pair": {
"reference": "..\\bitmaps_reference\\Small_search_bar_data-qa_small_720px.png",
"test": "..\\bitmaps_test\\20240719-223229\\Small_search_bar_data-qa_small_720px.png",
"selector": "[data-qa=\"small\"]",
"fileName": "Small_search_bar_data-qa_small_720px.png",
"label": "Small search bar data-qa_small",
"requireSameDimensions": false,
"misMatchThreshold": 1,
"url": "http://localhost:3001/index.html",
"referenceUrl": "https://mate-academy.github.io/layout_solutions/search-bar-airbnb/",
"expect": 0,
"viewportLabel": "720px",
"diff": {
"isSameDimensions": false,
"dimensionDifference": {
"width": -16,
"height": 0
},
"rawMisMatchPercentage": 6.580687830687832,
"misMatchPercentage": "6.58",
"analysisTime": 32
},
"diffImage": "..\\bitmaps_test\\20240719-223229\\failed_diff_Small_search_bar_data-qa_small_720px.png"
},
"status": "fail"
}
]
}
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"
}
]
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.waitForSelector(keyPressSelectorItem.selector);
await page.type(keyPressSelectorItem.selector, keyPressSelectorItem.keyPress);
}
}

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

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

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

if (scrollToSelector) {
await page.waitForSelector(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.
Loading

0 comments on commit a1b4f06

Please sign in to comment.