Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ivadimko committed Apr 24, 2019
0 parents commit 299a642
Show file tree
Hide file tree
Showing 19 changed files with 8,527 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#airbnb
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/backstop_data
/src/report
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: '@mate-academy/eslint-config',
};
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.idea
node_modules
.DS_Store
yarn.lock
backstop_data
!backstop_data/engine_scripts/
42 changes: 42 additions & 0 deletions .htmllintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"attr-bans": [
"align",
"background",
"bgcolor",
"border",
"frameborder",
"style"
],
"attr-no-dup": true,
"attr-quote-style": "double",
"attr-req-value": false,
"class-no-dup": true,
"doctype-first": true,
"doctype-html5": true,
"fig-req-figcaption": true,
"head-req-title": true,
"html-req-lang": true,
"id-class-style": false,
"id-no-dup": true,
"img-req-src": true,
"img-req-alt": "allownull",
"indent-width": 2,
"indent-width-cont": true,
"input-radio-req-name": true,
"spec-char-escape": true,
"tag-bans": [
"b",
"i",
"u",
"center",
"style",
"marquee",
"font",
"s"
],
"tag-name-lowercase": true,
"tag-name-match": true,
"tag-self-close": "never",
"title-no-dup": true,
"line-end-style": "lf"
}
2 changes: 2 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/backstop_data/
/src/report
4 changes: 4 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
extends: "@mate-academy/stylelint-config",
rules: {}
}
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: node_js
node_js:
- '11'
cache: npm
before_script:
- bash ./config/hooks/start-server.sh
script:
- npm run css:reference
- npm run css:test
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions config/backstop/backstopConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
'use strict';

// https://github.com/garris/BackstopJS#advanced-scenarios
const basicScenario = {
label: 'test', // name of the test
url: 'http://localhost:8080',
referenceUrl: '', // put here reference to github-pages with ready project
readyEvent: '',
readySelector: '',
delay: 1000,
hideSelectors: ['[data-qa-hidden]'],
removeSelectors: ['[data-qa-remove]'],
hoverSelector: '',
clickSelector: '',
postInteractionWait: 0,
selectors: '',
selectorExpansion: true,
expect: 0,
misMatchThreshold: 1, // 1% of 100%
requireSameDimensions: true
};

module.exports = {
id: 'test',
onBeforeScript: 'puppet/onBefore.js',
onReadyScript: 'puppet/onReady.js',
viewports: [
{
name: 'tablet_h',
width: 1024,
height: 768
}
],
scenarios: [
{ ...basicScenario }
// define here scenarios for testing
],
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
};
9 changes: 9 additions & 0 deletions config/hooks/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

cp -R backstop_data/ src/report
git add src/
git commit -m "deploy static content"
git subtree push --prefix src origin gh-pages
./node_modules/.bin/rimraf src/report
git add src/
git commit -m "removed report after deploy"
3 changes: 3 additions & 0 deletions config/hooks/start-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
npm run start &
sleep 3
Loading

0 comments on commit 299a642

Please sign in to comment.