forked from mate-academy/layout_search-bar-airbnb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7ab2078
Showing
39 changed files
with
2,717 additions
and
0 deletions.
There are no files selected for viewing
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.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.0261ec08.css"></head><body> <form class="search-bar search-bar__position search-bar--big" data-qa="big"> <div class="search-bar__icon search-bar__icon--big"></div> <input class="search-bar__input search-bar__input--big" type="text" data-qa="keypress" placeholder="Try “Los Angeles“"> </form> <form class="search-bar search-bar__position search-bar--small" data-qa="small"> <div class="search-bar__icon search-bar__icon--small"></div> <input class="search-bar__input search-bar__input--small" type="text" data-qa="hover" placeholder="Try “Los Angeles“"> </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.
Binary file added
BIN
+2.47 KB
report/bitmaps_test/20241210-065011/Big_search_bar_data-qa_big_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
BIN
+2.36 KB
report/bitmaps_test/20241210-065011/Big_search_bar_data-qa_big_720px.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.
Binary file added
BIN
+1.92 KB
report/bitmaps_test/20241210-065011/Small_search_bar_data-qa_small_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
BIN
+1.86 KB
report/bitmaps_test/20241210-065011/Small_search_bar_data-qa_small_720px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
{ | ||
"testSuite": "BackstopJS", | ||
"tests": [ | ||
{ | ||
"pair": { | ||
"reference": "..\\bitmaps_reference\\Entire_document_1024px.png", | ||
"test": "..\\bitmaps_test\\20241210-065011\\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": true, | ||
"dimensionDifference": { | ||
"width": 0, | ||
"height": 0 | ||
}, | ||
"rawMisMatchPercentage": 0.12939453125, | ||
"misMatchPercentage": "0.13", | ||
"analysisTime": 26 | ||
} | ||
}, | ||
"status": "pass" | ||
}, | ||
{ | ||
"pair": { | ||
"reference": "..\\bitmaps_reference\\Entire_document_720px.png", | ||
"test": "..\\bitmaps_test\\20241210-065011\\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": true, | ||
"dimensionDifference": { | ||
"width": 0, | ||
"height": 0 | ||
}, | ||
"rawMisMatchPercentage": 0.18402777777777776, | ||
"misMatchPercentage": "0.18", | ||
"analysisTime": 24 | ||
} | ||
}, | ||
"status": "pass" | ||
}, | ||
{ | ||
"pair": { | ||
"reference": "..\\bitmaps_reference\\Big_search_bar_data-qa_big_1024px.png", | ||
"test": "..\\bitmaps_test\\20241210-065011\\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": true, | ||
"dimensionDifference": { | ||
"width": 0, | ||
"height": 0 | ||
}, | ||
"rawMisMatchPercentage": 0.19416099773242632, | ||
"misMatchPercentage": "0.19", | ||
"analysisTime": 26 | ||
} | ||
}, | ||
"status": "pass" | ||
}, | ||
{ | ||
"pair": { | ||
"reference": "..\\bitmaps_reference\\Big_search_bar_data-qa_big_720px.png", | ||
"test": "..\\bitmaps_test\\20241210-065011\\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": true, | ||
"dimensionDifference": { | ||
"width": 0, | ||
"height": 0 | ||
}, | ||
"rawMisMatchPercentage": 0.2780032467532468, | ||
"misMatchPercentage": "0.28", | ||
"analysisTime": 14 | ||
} | ||
}, | ||
"status": "pass" | ||
}, | ||
{ | ||
"pair": { | ||
"reference": "..\\bitmaps_reference\\Small_search_bar_data-qa_small_1024px.png", | ||
"test": "..\\bitmaps_test\\20241210-065011\\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": true, | ||
"dimensionDifference": { | ||
"width": 0, | ||
"height": 0 | ||
}, | ||
"rawMisMatchPercentage": 0.1771541950113379, | ||
"misMatchPercentage": "0.18", | ||
"analysisTime": 16 | ||
} | ||
}, | ||
"status": "pass" | ||
}, | ||
{ | ||
"pair": { | ||
"reference": "..\\bitmaps_reference\\Small_search_bar_data-qa_small_720px.png", | ||
"test": "..\\bitmaps_test\\20241210-065011\\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": true, | ||
"dimensionDifference": { | ||
"width": 0, | ||
"height": 0 | ||
}, | ||
"rawMisMatchPercentage": 0.2536525974025974, | ||
"misMatchPercentage": "0.25", | ||
"analysisTime": 10 | ||
} | ||
}, | ||
"status": "pass" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
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.
Oops, something went wrong.