From 79144d4eedc68d4bd86d02ea882a4c6f5d27e70b Mon Sep 17 00:00:00 2001 From: Dionimar Date: Sat, 19 Oct 2024 18:25:46 +0800 Subject: [PATCH 01/13] add task solution --- readme.md | 5 +++-- src/index.html | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index fca5f5e388..35899b3d75 100644 --- a/readme.md +++ b/readme.md @@ -21,5 +21,6 @@ and use this [VSCode settings](https://mate-academy.github.io/fe-program/tools/v ## Demo Links Replace `` with your Github username and copy the links to Pull Request description: -- [DEMO LINK](https://.github.io/layout_hello-world/) -- [TEST REPORT LINK](https://.github.io/layout_hello-world/report/html_report/) + +- [DEMO LINK](https://DionimarDev.github.io/layout_hello-world/) +- [TEST REPORT LINK](https://DionimarDev.github.io/layout_hello-world/report/html_report/) diff --git a/src/index.html b/src/index.html index e69de29bb2..cee0d087bb 100644 --- a/src/index.html +++ b/src/index.html @@ -0,0 +1,2 @@ + +Hello world! From 07f9068e173181463347ca1203f15c5f2edeba7b Mon Sep 17 00:00:00 2001 From: Dionimar Date: Sat, 19 Oct 2024 18:43:41 +0800 Subject: [PATCH 02/13] add task solution --- src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index cee0d087bb..a164b049f4 100644 --- a/src/index.html +++ b/src/index.html @@ -1,2 +1,2 @@ -Hello world! +Hello, world! From c6423b1019f40ffad28e85ef1e2db21d9f8f0412 Mon Sep 17 00:00:00 2001 From: Dionimar Date: Sat, 19 Oct 2024 18:53:11 +0800 Subject: [PATCH 03/13] add task solution --- src/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/src/index.html b/src/index.html index a164b049f4..af5626b4a1 100644 --- a/src/index.html +++ b/src/index.html @@ -1,2 +1 @@ - Hello, world! From 2e161c1cd62dffaa4077b8d38865d63d2a2d501d Mon Sep 17 00:00:00 2001 From: Dionimar Date: Sat, 19 Oct 2024 18:57:36 +0800 Subject: [PATCH 04/13] add task solution --- .linthtmlrc.json | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.linthtmlrc.json b/.linthtmlrc.json index 477c99b1b9..9efa3e9370 100644 --- a/.linthtmlrc.json +++ b/.linthtmlrc.json @@ -12,8 +12,8 @@ "attr-quote-style": "double", "attr-req-value": true, "class-no-dup": true, - "doctype-first": true, - "doctype-html5": true, + "doctype-first": false, + "doctype-html5": false, "fig-req-figcaption": true, "head-req-title": true, "html-req-lang": true, @@ -26,16 +26,7 @@ "indent-width-cont": true, "input-radio-req-name": true, "spec-char-escape": true, - "tag-bans": [ - "b", - "i", - "u", - "center", - "style", - "marquee", - "font", - "s" - ], + "tag-bans": ["b", "i", "u", "center", "style", "marquee", "font", "s"], "tag-name-lowercase": true, "tag-name-match": true, "tag-self-close": false, From 21589c9ea3e53d0c25809fb56440690cc5cd8275 Mon Sep 17 00:00:00 2001 From: Dionimar Date: Sat, 19 Oct 2024 19:01:16 +0800 Subject: [PATCH 05/13] add task solution --- src/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.html b/src/index.html index af5626b4a1..a164b049f4 100644 --- a/src/index.html +++ b/src/index.html @@ -1 +1,2 @@ + Hello, world! From 791ab332047b41b7595dfda4b828a8a315c1c2d7 Mon Sep 17 00:00:00 2001 From: Dionimar Date: Sat, 19 Oct 2024 19:08:11 +0800 Subject: [PATCH 06/13] add task solution --- src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index a164b049f4..cee0d087bb 100644 --- a/src/index.html +++ b/src/index.html @@ -1,2 +1,2 @@ -Hello, world! +Hello world! From 3175e24c87a2bc1b9aa68698b57c408fb5d4a41c Mon Sep 17 00:00:00 2001 From: Dionimar Date: Sat, 19 Oct 2024 19:14:50 +0800 Subject: [PATCH 07/13] add task solution --- src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index cee0d087bb..a164b049f4 100644 --- a/src/index.html +++ b/src/index.html @@ -1,2 +1,2 @@ -Hello world! +Hello, world! From 799b49dba301db4ca9c026ffa9c63ad2f442ef4e Mon Sep 17 00:00:00 2001 From: Dionimar Date: Sat, 19 Oct 2024 19:17:27 +0800 Subject: [PATCH 08/13] add task solution --- .github/workflows/test.yml-template | 29 ++++++++++++++++ backstop.json | 54 +++++++++++++++++++++++++++++ backstopConfig.js | 15 ++++---- package-lock.json | 16 ++++++--- package.json | 6 ++-- 5 files changed, 108 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/test.yml-template create mode 100644 backstop.json diff --git a/.github/workflows/test.yml-template b/.github/workflows/test.yml-template new file mode 100644 index 0000000000..8b5743ecb4 --- /dev/null +++ b/.github/workflows/test.yml-template @@ -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 diff --git a/backstop.json b/backstop.json new file mode 100644 index 0000000000..967585f45e --- /dev/null +++ b/backstop.json @@ -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 +} diff --git a/backstopConfig.js b/backstopConfig.js index e6f40f1ba6..733ddb6eb7 100644 --- a/backstopConfig.js +++ b/backstopConfig.js @@ -9,17 +9,20 @@ const { basicScenario } = backstop; const config = { ...backstop, fileNameTemplate: '{scenarioLabel}', - viewports: [{ - name: 'custom-size', - width: 200, - height: 50, - }], + viewports: [ + { + name: 'custom-size', + width: 200, + height: 50, + }, + ], scenarios: [ { ...basicScenario, label: 'Entire document', referenceUrl: basicScenario.referenceUrl + '/hello-world/', - }], + }, + ], }; module.exports = config; diff --git a/package-lock.json b/package-lock.json index 61cf4a2b31..53e78eaf03 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,15 @@ "version": "1.0.0", "hasInstallScript": true, "license": "GPL-3.0", + "dependencies": { + "backstop": "^1.0.1" + }, "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", "jest": "^29.7.0", @@ -1211,9 +1214,9 @@ "dev": true }, "node_modules/@mate-academy/scripts": { - "version": "1.8.6", - "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-1.8.6.tgz", - "integrity": "sha512-b4om/whj4G9emyi84ORE3FRZzCRwRIesr8tJHXa8EvJdOaAPDpzcJ8A0sFfMsWH9NUOVmOwkBtOXDu5eZZ00Ig==", + "version": "1.9.12", + "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-1.9.12.tgz", + "integrity": "sha512-/OcmxMa34lYLFlGx7Ig926W1U1qjrnXbjFJ2TzUcDaLmED+A5se652NcWwGOidXRuMAOYLPU2jNYBEkKyXrFJA==", "dev": true, "dependencies": { "@octokit/rest": "^17.11.2", @@ -4673,6 +4676,11 @@ "@babel/core": "^7.0.0" } }, + "node_modules/backstop": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/backstop/-/backstop-1.0.1.tgz", + "integrity": "sha512-1vLEMys4xy7ffDuTZQnjk7+30fwxQ5Nw5P7KDqm0TtsqsTM38aITYAJ083AEX/uojgtB/iBaq2B6ZygLjNAjUw==" + }, "node_modules/backstopjs": { "version": "6.3.23", "resolved": "https://registry.npmjs.org/backstopjs/-/backstopjs-6.3.23.tgz", diff --git a/package.json b/package.json index ce9d180d76..d125cb8269 100644 --- a/package.json +++ b/package.json @@ -17,13 +17,12 @@ "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", "jest": "^29.7.0", @@ -38,5 +37,8 @@ "javascript": false, "bem": false } + }, + "dependencies": { + "backstop": "^1.0.1" } } From f944d80bfaf25c837c018ecbd11f61ee6eff1e48 Mon Sep 17 00:00:00 2001 From: Dionimar Date: Sat, 19 Oct 2024 19:25:06 +0800 Subject: [PATCH 09/13] add task solution --- src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index a164b049f4..cee0d087bb 100644 --- a/src/index.html +++ b/src/index.html @@ -1,2 +1,2 @@ -Hello, world! +Hello world! From 45d36ddc35f0c339b2bccc2d92fed279a28a7fd1 Mon Sep 17 00:00:00 2001 From: Dionimar Date: Sat, 19 Oct 2024 19:35:43 +0800 Subject: [PATCH 10/13] add task solution --- src/index.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index cee0d087bb..955ab44fc5 100644 --- a/src/index.html +++ b/src/index.html @@ -1,2 +1,14 @@ -Hello world! + + + + + Document + + + Hello, world! + + From a49b405c6f3eb964e708411cb26c079daebd7951 Mon Sep 17 00:00:00 2001 From: Dionimar Date: Sat, 19 Oct 2024 19:38:12 +0800 Subject: [PATCH 11/13] add task solution --- src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 955ab44fc5..6532713986 100644 --- a/src/index.html +++ b/src/index.html @@ -9,6 +9,6 @@ Document - Hello, world! + Hello world! From a45e9db90a099b6eb544eb9745334b2e662921e6 Mon Sep 17 00:00:00 2001 From: Dionimar Date: Sat, 19 Oct 2024 19:40:56 +0800 Subject: [PATCH 12/13] add task solution --- src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 6532713986..955ab44fc5 100644 --- a/src/index.html +++ b/src/index.html @@ -9,6 +9,6 @@ Document - Hello world! + Hello, world! From 5aa0bc3e37168ae891d9f498d7cb8a6d08ef0bd9 Mon Sep 17 00:00:00 2001 From: Dionimar Date: Sat, 19 Oct 2024 19:57:17 +0800 Subject: [PATCH 13/13] add task solution --- .linthtmlrc.json | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.linthtmlrc.json b/.linthtmlrc.json index 9efa3e9370..477c99b1b9 100644 --- a/.linthtmlrc.json +++ b/.linthtmlrc.json @@ -12,8 +12,8 @@ "attr-quote-style": "double", "attr-req-value": true, "class-no-dup": true, - "doctype-first": false, - "doctype-html5": false, + "doctype-first": true, + "doctype-html5": true, "fig-req-figcaption": true, "head-req-title": true, "html-req-lang": true, @@ -26,7 +26,16 @@ "indent-width-cont": true, "input-radio-req-name": true, "spec-char-escape": true, - "tag-bans": ["b", "i", "u", "center", "style", "marquee", "font", "s"], + "tag-bans": [ + "b", + "i", + "u", + "center", + "style", + "marquee", + "font", + "s" + ], "tag-name-lowercase": true, "tag-name-match": true, "tag-self-close": false,