Skip to content

Commit

Permalink
Fix CCI rendering errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Rickard Svensson committed Mar 4, 2019
1 parent a4ce30a commit 68d7a1c
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 1,172 deletions.
15 changes: 7 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ jobs:
# Each step uses the same `$BASH_ENV`, so need to modify it
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
- run:
name: Upgrade Chrome
command: |
curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome.deb
sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome
rm google-chrome.deb
- run:
name: Install Yarn
command: npm i -g yarn
Expand All @@ -31,14 +38,6 @@ jobs:
key: dependency-cache-v0-{{ checksum "yarn.lock" }}
paths:
- node_modules
- run:
name: Install Dependencies
command: |
node -v
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update -y
sudo apt-get install lsb-base google-chrome-stable -y
- run:
name: Build
command: |
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"eslint": "5.12.1",
"eslint-config-airbnb": "17.1.0",
"eslint-plugin-import": "2.15.0",
"eslint-plugin-protractor": "1.41.0",
"eslint-plugin-react": "7.12.4",
"glob": "7.1.3",
"handlebars": "4.0.12",
Expand Down
8 changes: 8 additions & 0 deletions test/component/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"env": {
"protractor": true
},
"plugins": [
"protractor"
]
}
1 change: 1 addition & 0 deletions test/component/components.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Object.keys(components).forEach((component) => {
before(() => browser.get(file));

it('should match baseline', () => {
browser.wait(protractor.ExpectedConditions.presenceOf($('body.ready'), 5 * 1000, 'Page was not ready to render'));
const img = browser.takeImageOf(settings);
expect(img).to.eventually.matchImageOf(fixture, component);
});
Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/src/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,9 @@
</head>
<body>
{{{content}}}
<script>
setTimeout(() => {
document.body.classList.add('ready');
}, 500)
</script>
</body>
Loading

0 comments on commit 68d7a1c

Please sign in to comment.