Skip to content

Commit

Permalink
Merge pull request Enegrecer#301 from Enegrecer/development
Browse files Browse the repository at this point in the history
Sincroniza development com master
  • Loading branch information
Nayara S Ribeiro authored Sep 12, 2018
2 parents a13fe9a + 7f513dd commit 18e8b48
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 3 deletions.
27 changes: 25 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
sudo: required
dist: trusty
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable

language: node_js
cache:
yarn: true
Expand All @@ -8,9 +17,10 @@ node_js: '8'
stages:
- name: lint + test + security-tests
- name: test-with-coverage
if: (NOT (type = pull_request ))
if: (branch = master AND NOT (type = pull_request))
- name: smoke-test
- name: deploy
if: (branch = master AND NOT (type = pull_request ))
if: (branch = master AND NOT (type = pull_request))

install:
- yarn install
Expand All @@ -31,6 +41,18 @@ jobs:
script: bash ci/security-checks.sh
- stage: test-with-coverage
script: yarn test-coverage
- stage: smoke-test
install:
before_script:
- chmod +x ./src/tests/functional/runSmokeTest.sh
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3
- yarn start --detach 2>&1 &
- sleep 5
script: ./src/tests/functional/runSmokeTest.sh
after_script:
- pkill node
- stage: deploy
before_script:
- yarn run build-css
Expand All @@ -48,3 +70,4 @@ notifications:
on_success: change
on_failure: always
on_start: always

1 change: 0 additions & 1 deletion functional-tests.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ exports.config = {
},

onPrepare() {
browser.manage().window().maximize();
browser.manage().timeouts().pageLoadTimeout(40000);
const { Given, Then, When, Before } = require('cucumber');
global.Given = Given;
Expand Down
6 changes: 6 additions & 0 deletions src/components/sobre/__snapshots__/Sobre.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,12 @@ exports[`Sobre possui a mesma estrutura 1`] = `
nome="Sérgio Luis"
papel="BA"
/>
<Colaborador
foto="https://firebasestorage.googleapis.com/v0/b/enegrecer-e37b3.appspot.com/o/fotos%2Fpessoas%2Ftatiane-nogueira.png?alt=media&token=4ec16519-9158-41d9-b279-ca0b6d98e8ea"
key="Tatiane Aguirres Nogueira"
nome="Tatiane Aguirres Nogueira"
papel="DEVa"
/>
<Colaborador
foto="https://firebasestorage.googleapis.com/v0/b/enegrecer-e37b3.appspot.com/o/fotos%2Fpessoas%2Fthais-lopes.jpg?alt=media&token=6733cfb8-d256-4dfb-9673-d974683cac4f"
key="Thais Lopes"
Expand Down
5 changes: 5 additions & 0 deletions src/components/sobre/colaboradores.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ export function colaboradores() {
papel: 'BA',
foto: 'https://firebasestorage.googleapis.com/v0/b/enegrecer-e37b3.appspot.com/o/fotos%2Fpessoas%2Fsergio-luis.jpg?alt=media&token=5f03b54b-5b15-4cbb-8bda-b20cf9750e33',
},
{
nome: 'Tatiane Aguirres Nogueira',
papel: 'DEVa',
foto: 'https://firebasestorage.googleapis.com/v0/b/enegrecer-e37b3.appspot.com/o/fotos%2Fpessoas%2Ftatiane-nogueira.png?alt=media&token=4ec16519-9158-41d9-b279-ca0b6d98e8ea',
},
{
nome: 'Thais Lopes',
papel: 'DEVa',
Expand Down
44 changes: 44 additions & 0 deletions src/tests/functional/runSmokeTest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/sh

echo Instalando o Protractor globalmente...
yarn global add protractor

export StatusResult1=$?;
if [ $StatusResult1 -eq "0" ]; then
echo Atualizando o servidor do Selenium...
webdriver-manager update
export StatusResult2=$?;
if [ $StatusResult2 -eq "0" ]; then
echo Iniciando o servidor...
webdriver-manager start --detach
export StatusResult3=$?;
if [ $StatusResult3 -eq "0" ]; then
echo Executando os testes...
protractor functional-tests.conf.js
export StatusResult4=$?;
if [ $StatusResult4 -eq "0" ]; then
echo Parando o servidor...
webdriver-manager shutdown
export StatusResult5=$?;
if [ $StatusResult5 -eq "0" ]; then
echo O servidor foi parado com sucesso!
else
echo O encerramento do servidor falhou e retornou o código $StatusResult5!
exit $StatusResult5
fi
else
echo A execução dos testes falhou e retornou o código $StatusResult4!
exit $StatusResult4
fi
else
echo A iniciação do servidor falhou e retornou o código $StatusResult3!
exit $StatusResult3
fi
else
echo A atualização do servidor falhou e retornou o código $StatusResult2!
exit $StatusResult2
fi
else
echo A instalação do Protractor falhou e retornou o código $StatusResult1!
exit $StatusResult1
fi

0 comments on commit 18e8b48

Please sign in to comment.