Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moyo header #5852

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
22bf131
Header task completed
sdoskich Dec 1, 2024
48dc591
Fix style changes in style.css
sdoskich Dec 1, 2024
681bc50
Updated style.css
sdoskich Dec 1, 2024
a9832ab
Fix CSS linting issue
sdoskich Dec 21, 2024
aa7302e
Remove large files from the repository
sdoskich Dec 21, 2024
ce47477
Fix large files issue and update .gitignore
sdoskich Dec 21, 2024
37fff96
Ignore large file and remove from repo
sdoskich Dec 21, 2024
8cd57f1
Refactor styles to use classes instead of tags
sdoskich Dec 23, 2024
f46c21a
Set links to have full header height by removing hardcoded bottom value
sdoskich Dec 23, 2024
25bf4ee
Add BackstopJS configuration and reference images
sdoskich Dec 23, 2024
d85935f
Moved files to docs folder
sdoskich Dec 23, 2024
443fae1
Updated repository with latest changes
sdoskich Dec 23, 2024
dac891c
Add BackstopJS tests and update configuration
sdoskich Dec 23, 2024
d2bae2b
1
sdoskich Feb 3, 2025
56ab9e0
Merge branch 'master' into master
sdoskich Feb 8, 2025
124446d
index_bundle.js
sdoskich Feb 8, 2025
4831804
Update package-lock.json
sdoskich Feb 8, 2025
2e047ba
Updated layout and styles
sdoskich Feb 8, 2025
65657a0
Changed Apple text color to blue and fixed spacing
sdoskich Feb 8, 2025
4207061
Merge completed
sdoskich Feb 8, 2025
0328740
Added text-transform: uppercase for navigation menu
sdoskich Feb 8, 2025
cac3228
Updated bottom value in main-menu ul li:hover::after to 20px
sdoskich Feb 8, 2025
8ead38e
Fix BackstopJS config, add approve script
sdoskich Feb 8, 2025
c7a200c
add BackstopJS report
sdoskich Feb 8, 2025
6b56b1e
Added BackstopJS report
sdoskich Feb 8, 2025
7936a57
Updated CSS styles
sdoskich Feb 9, 2025
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
29 changes: 29 additions & 0 deletions .github/workflows/test.yml-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
- name: Upload HTML report(backstop data)
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: report
path: backstop_data
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ backstop_data
dist
.cache
.parcel-cache
reports/html_report/index_bundle.js
54 changes: 54 additions & 0 deletions backstop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"id": "backstop_default",
"viewports": [
{
"label": "phone",
"width": 320,
"height": 480
},
{
"label": "tablet",
"width": 1024,
"height": 768
}
],
"onBeforeScript": "puppet/onBefore.js",
"onReadyScript": "puppet/onReady.js",
"scenarios": [
{
"label": "BackstopJS Homepage",
"cookiePath": "backstop_data/engine_scripts/cookies.json",
"url": "https://garris.github.io/BackstopJS/",
"referenceUrl": "",
"readyEvent": "",
"readySelector": "",
"delay": 0,
"hideSelectors": [],
"removeSelectors": [],
"hoverSelector": "",
"clickSelector": "",
"postInteractionWait": 0,
"selectors": [],
"selectorExpansion": true,
"expect": 0,
"misMatchThreshold" : 0.1,
"requireSameDimensions": true
}
],
"paths": {
"bitmaps_reference": "backstop_data/bitmaps_reference",
"bitmaps_test": "backstop_data/bitmaps_test",
"engine_scripts": "backstop_data/engine_scripts",
"html_report": "backstop_data/html_report",
"ci_report": "backstop_data/ci_report"
},
"report": ["browser"],
"engine": "puppeteer",
"engineOptions": {
"args": ["--no-sandbox"]
},
"asyncCaptureLimit": 5,
"asyncCompareLimit": 50,
"debug": false,
"debugWindow": false
}
2 changes: 1 addition & 1 deletion backstop_data/engine_scripts/cookies.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"httpOnly": false,
"secure": false,
"session": false,
"sameSite": "no_restriction"
"sameSite": "Lax"
}
]
14 changes: 8 additions & 6 deletions backstop_data/engine_scripts/puppet/clickAndHoverHelper.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
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]
const hoverSelector = scenario.hoverSelectors || scenario.hoverSelector;
const clickSelector = scenario.clickSelectors || scenario.clickSelector;
const keyPressSelector = scenario.keyPressSelectors || scenario.keyPressSelector;
const scrollToSelector = scenario.scrollToSelector;
const postInteractionWait = scenario.postInteractionWait; // selector [str] | ms [int]

if (keyPressSelector) {
for (const keyPressSelectorItem of [].concat(keyPressSelector)) {
Expand All @@ -27,7 +27,9 @@ module.exports = async (page, scenario) => {
}

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

if (scrollToSelector) {
Expand Down
12 changes: 8 additions & 4 deletions backstop_data/engine_scripts/puppet/loadCookies.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var fs = require('fs');
const fs = require('fs');

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

// READ COOKIES FROM FILE IF EXISTS
if (fs.existsSync(cookiePath)) {
Expand All @@ -11,7 +11,11 @@ module.exports = async (page, scenario) => {

// MUNGE COOKIE DOMAIN
cookies = cookies.map(cookie => {
cookie.url = 'https://' + cookie.domain;
if (cookie.domain.startsWith('http://') || cookie.domain.startsWith('https://')) {
cookie.url = cookie.domain;
} else {
cookie.url = 'https://' + cookie.domain;
}
delete cookie.domain;
return cookie;
});
Expand Down
Empty file added index.html
Empty file.
12 changes: 7 additions & 5 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@
"keywords": [],
"author": "Mate Academy",
"license": "GPL-3.0",
"dependencies": {},
"devDependencies": {
"@linthtml/linthtml": "^0.9.6",
"@mate-academy/backstop-config": "latest",
"@mate-academy/bemlint": "latest",
"@mate-academy/linthtml-config": "latest",
"@mate-academy/scripts": "^1.8.6",
"@mate-academy/scripts": "^1.9.12",
"@mate-academy/stylelint-config": "latest",
"backstopjs": "6.3.23",
"backstopjs": "^6.3.23",
"jest": "^29.7.0",
"parcel": "^2.12.0",
"prettier": "^3.3.2",
Expand Down
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 reports/html_report/assets/fonts/Lato-Bold.ttf
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.
40 changes: 40 additions & 0 deletions reports/html_report/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
report({
"testSuite": "BackstopJS",
"tests": [
{
"pair": {
"reference": "../bitmaps_reference/backstop_default_BackstopJS_Homepage_0_document_0_phone.png",
"test": "../bitmaps_test/20241221-130037/backstop_default_BackstopJS_Homepage_0_document_0_phone.png",
"selector": "document",
"fileName": "backstop_default_BackstopJS_Homepage_0_document_0_phone.png",
"label": "BackstopJS Homepage",
"requireSameDimensions": true,
"misMatchThreshold": 0.1,
"url": "https://garris.github.io/BackstopJS/",
"referenceUrl": "",
"expect": 0,
"viewportLabel": "phone",
"error": "Reference file not found /Users/sergij/projects/layout_moyo-header/backstop_data/bitmaps_reference/backstop_default_BackstopJS_Homepage_0_document_0_phone.png"
},
"status": "fail"
},
{
"pair": {
"reference": "../bitmaps_reference/backstop_default_BackstopJS_Homepage_0_document_1_tablet.png",
"test": "../bitmaps_test/20241221-130037/backstop_default_BackstopJS_Homepage_0_document_1_tablet.png",
"selector": "document",
"fileName": "backstop_default_BackstopJS_Homepage_0_document_1_tablet.png",
"label": "BackstopJS Homepage",
"requireSameDimensions": true,
"misMatchThreshold": 0.1,
"url": "https://garris.github.io/BackstopJS/",
"referenceUrl": "",
"expect": 0,
"viewportLabel": "tablet",
"error": "Reference file not found /Users/sergij/projects/layout_moyo-header/backstop_data/bitmaps_reference/backstop_default_BackstopJS_Homepage_0_document_1_tablet.png"
},
"status": "fail"
}
],
"id": "backstop_default"
});
Loading
Loading