Skip to content

Commit

Permalink
make build
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik-Dudek-code committed Sep 26, 2024
0 parents commit 48066c0
Show file tree
Hide file tree
Showing 31 changed files with 2,510 additions and 0 deletions.
Binary file added imac.202c52ff.jpeg
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.6c2b2549.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.6c2b2549.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, initial-scale=1.0"><title>Product cards</title><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet"><link rel="stylesheet" href="index.6c2b2549.css"></head><body> <section data-qa="card" class="card"> <div class="card__image"></div> <p class="card__name"> APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) </p> <p class="card__description">Product code: 195434</p> <div class="card__wrapper-stars"> <div class="stars stars--4"> <div class="stars__star"></div> <div class="stars__star"></div> <div class="stars__star"></div> <div class="stars__star"></div> <div class="stars__star"></div> </div> <p class="card__review">Reviews: 5</p> </div> <div class="card__wrapper-price"> <p class="card__price">Price:</p> <p class="card__amount">$2,199</p> </div> <a href="#" data-qa="hover" class="card__button"> Buy </a> </section> </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.
57 changes: 57 additions & 0 deletions report/bitmaps_test/20240926-132711/report.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"testSuite": "BackstopJS",
"tests": [
{
"pair": {
"reference": "..\\bitmaps_reference\\Card_with_data-qa_card.png",
"test": "..\\bitmaps_test\\20240926-132711\\Card_with_data-qa_card.png",
"selector": "[data-qa=\"card\"]",
"fileName": "Card_with_data-qa_card.png",
"label": "Card with data-qa_card",
"requireSameDimensions": false,
"misMatchThreshold": 1,
"url": "http://localhost:3001/index.html",
"referenceUrl": "https://mate-academy.github.io/layout_solutions/product-cards/",
"expect": 0,
"viewportLabel": "tablet_h",
"diff": {
"isSameDimensions": true,
"dimensionDifference": {
"width": 0,
"height": 0
},
"rawMisMatchPercentage": 0.014705882352941175,
"misMatchPercentage": "0.01",
"analysisTime": 8
}
},
"status": "pass"
},
{
"pair": {
"reference": "..\\bitmaps_reference\\Link_with_data-qa_hover.png",
"test": "..\\bitmaps_test\\20240926-132711\\Link_with_data-qa_hover.png",
"selector": "[data-qa=\"card\"]",
"fileName": "Link_with_data-qa_hover.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/product-cards/",
"expect": 0,
"viewportLabel": "tablet_h",
"diff": {
"isSameDimensions": true,
"dimensionDifference": {
"width": 0,
"height": 0
},
"rawMisMatchPercentage": 0,
"misMatchPercentage": "0.00",
"analysisTime": 10
}
},
"status": "pass"
}
]
}
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.
57 changes: 57 additions & 0 deletions report/html_report/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
report({
"testSuite": "BackstopJS",
"tests": [
{
"pair": {
"reference": "..\\bitmaps_reference\\Card_with_data-qa_card.png",
"test": "..\\bitmaps_test\\20240926-132711\\Card_with_data-qa_card.png",
"selector": "[data-qa=\"card\"]",
"fileName": "Card_with_data-qa_card.png",
"label": "Card with data-qa_card",
"requireSameDimensions": false,
"misMatchThreshold": 1,
"url": "http://localhost:3001/index.html",
"referenceUrl": "https://mate-academy.github.io/layout_solutions/product-cards/",
"expect": 0,
"viewportLabel": "tablet_h",
"diff": {
"isSameDimensions": true,
"dimensionDifference": {
"width": 0,
"height": 0
},
"rawMisMatchPercentage": 0.014705882352941175,
"misMatchPercentage": "0.01",
"analysisTime": 8
}
},
"status": "pass"
},
{
"pair": {
"reference": "..\\bitmaps_reference\\Link_with_data-qa_hover.png",
"test": "..\\bitmaps_test\\20240926-132711\\Link_with_data-qa_hover.png",
"selector": "[data-qa=\"card\"]",
"fileName": "Link_with_data-qa_hover.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/product-cards/",
"expect": 0,
"viewportLabel": "tablet_h",
"diff": {
"isSameDimensions": true,
"dimensionDifference": {
"width": 0,
"height": 0
},
"rawMisMatchPercentage": 0,
"misMatchPercentage": "0.00",
"analysisTime": 10
}
},
"status": "pass"
}
]
});
Loading

0 comments on commit 48066c0

Please sign in to comment.