From b06137bed2d1ff37c92935c51937003fe4b6a861 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Mon, 27 Aug 2018 17:01:16 -0300 Subject: [PATCH 01/27] =?UTF-8?q?Adicionar=20shell=20script=20para=20execu?= =?UTF-8?q?=C3=A7=C3=A3o=20do=20teste=20fuma=C3=A7a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tests/functional/runSmokeTest.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/tests/functional/runSmokeTest.sh diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh new file mode 100644 index 00000000..0f8bbb89 --- /dev/null +++ b/src/tests/functional/runSmokeTest.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +echo Instalando o Protractor globalmente... + + yarn global add protractor + +echo Atualizando o servidor do Selenium... + + webdriver-manager update + +echo Iniciando o servidor... + + webdriver-manager start --detach + +echo Executando os testes... + + protractor functional-tests.conf.js + +echo Parando o servidor... + + webdriver-manager shutdown + +exit From b1400e321bdb421a4c2bad9cd15af0563b5cdc0b Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Mon, 27 Aug 2018 17:16:59 -0300 Subject: [PATCH 02/27] =?UTF-8?q?Adicionar=20est=C3=A1gio=20para=20execu?= =?UTF-8?q?=C3=A7=C3=A3o=20dos=20testes=20de=20fuma=C3=A7a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f40634d3..b7da832b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,12 @@ +sudo: required +dist: trusty +addons: + apt: + sources: + - google-chrome + packages: + - google-chrome-stable + language: node_js cache: yarn: true @@ -8,7 +17,9 @@ 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 + if: (branch = waffle-292 AND NOT (type = pull-request )) - name: deploy if: (branch = master AND NOT (type = pull_request )) @@ -31,6 +42,16 @@ jobs: script: bash ci/security-checks.sh - stage: test-with-coverage script: yarn test-coverage + + + - stage: smoke-test + before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + - sleep 5 + script: ./src/tests/functional/runSmokeTest.sh + + - stage: deploy before_script: - yarn run build-css @@ -48,3 +69,4 @@ notifications: on_success: change on_failure: always on_start: always + From 13dc36889f15f96819ba28c5fe4a8523a9852616 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Mon, 27 Aug 2018 17:50:33 -0300 Subject: [PATCH 03/27] =?UTF-8?q?Adicionar=20permiss=C3=A3o=20para=20execu?= =?UTF-8?q?=C3=A7=C3=A3o=20do=20shell=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index b7da832b..83484f9d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,6 +46,7 @@ jobs: - stage: smoke-test before_script: + - chmod +x ./src/tests/functional/runSmokeTest.sh - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - sleep 5 From 18df286d31f45b316c7c176669ea980f2617a285 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Mon, 27 Aug 2018 18:16:58 -0300 Subject: [PATCH 04/27] =?UTF-8?q?Ajustar=20a=20ordem=20de=20execu=C3=A7?= =?UTF-8?q?=C3=A3o=20dos=20scripts=20para=20executar=20os=20testes=20de=20?= =?UTF-8?q?fuma=C3=A7a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 3 ++- src/tests/functional/runSmokeTest.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 83484f9d..16cd2e30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,8 @@ jobs: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - sleep 5 - script: ./src/tests/functional/runSmokeTest.sh + - ./src/tests/functional/runSmokeTest.sh + script: protractor functional-tests.conf.js - stage: deploy diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh index 0f8bbb89..be3ceaa7 100644 --- a/src/tests/functional/runSmokeTest.sh +++ b/src/tests/functional/runSmokeTest.sh @@ -14,7 +14,7 @@ echo Iniciando o servidor... echo Executando os testes... - protractor functional-tests.conf.js + # protractor functional-tests.conf.js echo Parando o servidor... From aeb5a8d27df558a440c7f6f03bf4a662d19e49f8 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Mon, 27 Aug 2018 18:43:23 -0300 Subject: [PATCH 05/27] =?UTF-8?q?Ajsutando=20a=20ordem=20de=20execu=C3=A7?= =?UTF-8?q?=C3=A3o=20do=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 3 +-- src/tests/functional/runSmokeTest.sh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 16cd2e30..83484f9d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,8 +50,7 @@ jobs: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - sleep 5 - - ./src/tests/functional/runSmokeTest.sh - script: protractor functional-tests.conf.js + script: ./src/tests/functional/runSmokeTest.sh - stage: deploy diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh index be3ceaa7..0f8bbb89 100644 --- a/src/tests/functional/runSmokeTest.sh +++ b/src/tests/functional/runSmokeTest.sh @@ -14,7 +14,7 @@ echo Iniciando o servidor... echo Executando os testes... - # protractor functional-tests.conf.js + protractor functional-tests.conf.js echo Parando o servidor... From 8d730749df5b170f93d9c29262e53e1dafe4c9f6 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Mon, 27 Aug 2018 19:17:54 -0300 Subject: [PATCH 06/27] =?UTF-8?q?Adicionar=20condi=C3=A7=C3=A3o=20para=20e?= =?UTF-8?q?xecu=C3=A7=C3=A3o=20dos=20comandos=20no=20shell=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tests/functional/runSmokeTest.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh index 0f8bbb89..f880b463 100644 --- a/src/tests/functional/runSmokeTest.sh +++ b/src/tests/functional/runSmokeTest.sh @@ -6,18 +6,24 @@ echo Instalando o Protractor globalmente... echo Atualizando o servidor do Selenium... - webdriver-manager update + if [$ == true] + then webdriver-manager update + else exit echo Iniciando o servidor... - webdriver-manager start --detach + if [$1 == true] + then webdriver-manager start --detach + else exit echo Executando os testes... - protractor functional-tests.conf.js + if [$2 == true] + then protractor functional-tests.conf.js + else exit echo Parando o servidor... - webdriver-manager shutdown - -exit + if [$3 == true] + then webdriver-manager shutdown + else exit From 6fe5e0c88072281a919c38e8ae6dcdc9e7dce211 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Mon, 27 Aug 2018 19:26:41 -0300 Subject: [PATCH 07/27] =?UTF-8?q?Corrigir=20o=20formato=20das=20condi?= =?UTF-8?q?=C3=A7=C3=B5es=20para=20execu=C3=A7=C3=A3o=20dos=20comandos=20n?= =?UTF-8?q?o=20shell=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tests/functional/runSmokeTest.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh index f880b463..8bc3f291 100644 --- a/src/tests/functional/runSmokeTest.sh +++ b/src/tests/functional/runSmokeTest.sh @@ -8,22 +8,28 @@ echo Atualizando o servidor do Selenium... if [$ == true] then webdriver-manager update - else exit + else exit $ + fi echo Iniciando o servidor... if [$1 == true] then webdriver-manager start --detach - else exit + else exit $1 + fi echo Executando os testes... if [$2 == true] then protractor functional-tests.conf.js - else exit + else exit $2 + fi echo Parando o servidor... if [$3 == true] then webdriver-manager shutdown - else exit + else exit $3 + fi + +exit From 5040c083131ecb3595b46805afdcd3700823f5b7 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Mon, 27 Aug 2018 19:39:13 -0300 Subject: [PATCH 08/27] =?UTF-8?q?Referenciar=20a=20vari=C3=A1vel=20com=20o?= =?UTF-8?q?=20retorno=20de=20execu=C3=A7=C3=A3o=20do=20primeiro=20comando?= =?UTF-8?q?=20do=20shell=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tests/functional/runSmokeTest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh index 8bc3f291..ddcc0598 100644 --- a/src/tests/functional/runSmokeTest.sh +++ b/src/tests/functional/runSmokeTest.sh @@ -6,9 +6,9 @@ echo Instalando o Protractor globalmente... echo Atualizando o servidor do Selenium... - if [$ == true] + if [$0 == true] then webdriver-manager update - else exit $ + else exit $0 fi echo Iniciando o servidor... From e1ffe235a336b5a1a6e50e2f836cd0bb8ee72a5b Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Tue, 28 Aug 2018 09:39:15 -0300 Subject: [PATCH 09/27] =?UTF-8?q?Ajustar=20tipo=20de=20argumento=20para=20?= =?UTF-8?q?compara=C3=A7=C3=A3o=20no=20shell=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tests/functional/runSmokeTest.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh index ddcc0598..2d55e65e 100644 --- a/src/tests/functional/runSmokeTest.sh +++ b/src/tests/functional/runSmokeTest.sh @@ -6,28 +6,29 @@ echo Instalando o Protractor globalmente... echo Atualizando o servidor do Selenium... - if [$0 == true] + ra1 = $?; + if [ra1 = 0] then webdriver-manager update else exit $0 fi echo Iniciando o servidor... - if [$1 == true] + if [$? = 0] then webdriver-manager start --detach else exit $1 fi echo Executando os testes... - if [$2 == true] + if [$? = 0] then protractor functional-tests.conf.js else exit $2 fi echo Parando o servidor... - if [$3 == true] + if [$? = 0] then webdriver-manager shutdown else exit $3 fi From 3f54b8d9b2f5dd71c60da0c9a1467feddd72d0f4 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Tue, 28 Aug 2018 09:52:40 -0300 Subject: [PATCH 10/27] =?UTF-8?q?Ajustar=20tipo=20de=20argumento=20para=20?= =?UTF-8?q?compara=C3=A7=C3=A3o=20no=20shell=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tests/functional/runSmokeTest.sh | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh index 2d55e65e..24b1f4bd 100644 --- a/src/tests/functional/runSmokeTest.sh +++ b/src/tests/functional/runSmokeTest.sh @@ -6,31 +6,30 @@ echo Instalando o Protractor globalmente... echo Atualizando o servidor do Selenium... - ra1 = $?; - if [ra1 = 0] - then webdriver-manager update - else exit $0 + if [$? = 0]; + then webdriver-manager update + else exit $? fi echo Iniciando o servidor... - if [$? = 0] - then webdriver-manager start --detach - else exit $1 + if [$? = 0]; + then webdriver-manager start --detach + else exit $? fi echo Executando os testes... - if [$? = 0] - then protractor functional-tests.conf.js - else exit $2 + if [$? = 0]; + then protractor functional-tests.conf.js + else exit $? fi echo Parando o servidor... - if [$? = 0] - then webdriver-manager shutdown - else exit $3 + if [$? = 0]; + then webdriver-manager shutdown + else exit $? fi exit From 597d1ea4e6601d256a0528bc76c4d13c853636e7 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Tue, 28 Aug 2018 10:16:28 -0300 Subject: [PATCH 11/27] =?UTF-8?q?Adicionar=20novas=20vari=C3=A1veis=20para?= =?UTF-8?q?=20validar=20o=20comportamento?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tests/functional/runSmokeTest.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh index 24b1f4bd..2a8fe54f 100644 --- a/src/tests/functional/runSmokeTest.sh +++ b/src/tests/functional/runSmokeTest.sh @@ -4,11 +4,18 @@ echo Instalando o Protractor globalmente... yarn global add protractor + echo "$?" + echo Atualizando o servidor do Selenium... - if [$? = 0]; - then webdriver-manager update - else exit $? +echo "$?" + + if ["$?" -eq "0"]; then + echo Atualizando o servidor do Selenium... + webdriver-manager update + else + echo A atualização do servidor falhou e retornou o código "$?"! + exit $? fi echo Iniciando o servidor... From 6f48a726271b8863c2ca6e427f97a82ab050518e Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Tue, 28 Aug 2018 10:53:51 -0300 Subject: [PATCH 12/27] =?UTF-8?q?Alterar=20o=20tipo=20do=20arquivo=20para?= =?UTF-8?q?=20testar=20a=20execu=C3=A7=C3=A3o=20sem=20apresentar=20o=20err?= =?UTF-8?q?or=20de=20comando=20n=C3=A3o=20encontrado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tests/functional/runSmokeTest.sh | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) mode change 100644 => 100755 src/tests/functional/runSmokeTest.sh diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh old mode 100644 new mode 100755 index 2a8fe54f..96b7bf2b --- a/src/tests/functional/runSmokeTest.sh +++ b/src/tests/functional/runSmokeTest.sh @@ -1,22 +1,16 @@ -#!/bin/bash +#!/bin/sh echo Instalando o Protractor globalmente... - yarn global add protractor +yarn global add protractor - echo "$?" - -echo Atualizando o servidor do Selenium... - -echo "$?" - - if ["$?" -eq "0"]; then - echo Atualizando o servidor do Selenium... - webdriver-manager update - else - echo A atualização do servidor falhou e retornou o código "$?"! - exit $? - fi +if [ "$?" -eq "0" ]; then + echo Atualizando o servidor do Selenium... + webdriver-manager update +else + echo A atualização do servidor falhou e retornou o código "$?"! + exit "$?" +fi echo Iniciando o servidor... From 8a23a4d6fba1b4b299a721994e76833580a66fc7 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Tue, 28 Aug 2018 11:11:15 -0300 Subject: [PATCH 13/27] =?UTF-8?q?Ajustar=20as=20condi=C3=A7=C3=B5es=20para?= =?UTF-8?q?=20execu=C3=A7=C3=A3o=20dos=20demais=20comandos=20no=20shell=20?= =?UTF-8?q?script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tests/functional/runSmokeTest.sh | 39 +++++++++++++++------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh index 96b7bf2b..22880905 100755 --- a/src/tests/functional/runSmokeTest.sh +++ b/src/tests/functional/runSmokeTest.sh @@ -12,25 +12,28 @@ else exit "$?" fi -echo Iniciando o servidor... - - if [$? = 0]; - then webdriver-manager start --detach - else exit $? - fi - -echo Executando os testes... - - if [$? = 0]; - then protractor functional-tests.conf.js - else exit $? - fi +if [ "$?" -eq "0" ]; then + echo Iniciando o servidor... + webdriver-manager start --detach +else + echo A iniciação do servidor falhou e retornou o código "$?"! + exit "$?" +fi -echo Parando o servidor... +if [ "$?" -eq "0" ]; then + echo Executando os testes... + protractor functional-tests.conf.js +else + echo A execução dos testes falhou e retornou o código "$?"! + exit "$?" +fi - if [$? = 0]; - then webdriver-manager shutdown - else exit $? - fi +if [ "$?" -eq "0" ]; then + echo Parando o servidor... + webdriver-manager shutdown +else + echo O encerramento do servidor falhou e retornou o código "$?"! + exit "$?" +fi exit From 6b450fa6af1ef3d3544d616efda16a2117cfa9dc Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Tue, 28 Aug 2018 11:52:40 -0300 Subject: [PATCH 14/27] =?UTF-8?q?Ajustar=20o=20retorno=20nas=20condi=C3=A7?= =?UTF-8?q?=C3=B5es=20em=20caso=20de=20erro=20na=20execu=C3=A7=C3=A3o=20do?= =?UTF-8?q?s=20comandos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tests/functional/runSmokeTest.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh index 22880905..075ebec0 100755 --- a/src/tests/functional/runSmokeTest.sh +++ b/src/tests/functional/runSmokeTest.sh @@ -1,14 +1,19 @@ #!/bin/sh echo Instalando o Protractor globalmente... - yarn global add protractor +# if [ "$?" -ne "0" ]; then +# echo A instalação do Protractor falhou e retornou o código "$?"! +# exit "$?" +# fi + if [ "$?" -eq "0" ]; then echo Atualizando o servidor do Selenium... webdriver-manager update else - echo A atualização do servidor falhou e retornou o código "$?"! + echo A instalação do Protractor falhou e retornou o código "$?"! + # echo A atualização do servidor falhou e retornou o código "$?"! exit "$?" fi @@ -16,7 +21,8 @@ if [ "$?" -eq "0" ]; then echo Iniciando o servidor... webdriver-manager start --detach else - echo A iniciação do servidor falhou e retornou o código "$?"! + # echo A iniciação do servidor falhou e retornou o código "$?"! + echo A atualização do servidor falhou e retornou o código "$?"! exit "$?" fi @@ -24,7 +30,8 @@ if [ "$?" -eq "0" ]; then echo Executando os testes... protractor functional-tests.conf.js else - echo A execução dos testes falhou e retornou o código "$?"! + # echo A execução dos testes falhou e retornou o código "$?"! + echo A iniciação do servidor falhou e retornou o código "$?"! exit "$?" fi @@ -32,8 +39,13 @@ if [ "$?" -eq "0" ]; then echo Parando o servidor... webdriver-manager shutdown else - echo O encerramento do servidor falhou e retornou o código "$?"! + echo A execução dos testes falhou e retornou o código "$?"! + # echo O encerramento do servidor falhou e retornou o código "$?"! exit "$?" fi -exit +if [ "$?" -eq "0" ]; then + exit +else + exit "$?" +fi \ No newline at end of file From f4782d7b96d3675ea80d54e9a9b9ee2ccfc5e9f5 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Tue, 28 Aug 2018 13:22:24 -0300 Subject: [PATCH 15/27] =?UTF-8?q?Ajustar=20o=20retorno=20dos=20comandos=20?= =?UTF-8?q?no=20shell=20script=20para=20testar=20o=20status=20de=20execu?= =?UTF-8?q?=C3=A7=C3=A3o=20do=20mesmo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tests/functional/runSmokeTest.sh | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh index 075ebec0..ef27cc20 100755 --- a/src/tests/functional/runSmokeTest.sh +++ b/src/tests/functional/runSmokeTest.sh @@ -3,36 +3,28 @@ echo Instalando o Protractor globalmente... yarn global add protractor -# if [ "$?" -ne "0" ]; then -# echo A instalação do Protractor falhou e retornou o código "$?"! -# exit "$?" -# fi - if [ "$?" -eq "0" ]; then echo Atualizando o servidor do Selenium... webdriver-manager update else echo A instalação do Protractor falhou e retornou o código "$?"! - # echo A atualização do servidor falhou e retornou o código "$?"! - exit "$?" + # exit "$?" fi if [ "$?" -eq "0" ]; then echo Iniciando o servidor... webdriver-manager start --detach else - # echo A iniciação do servidor falhou e retornou o código "$?"! echo A atualização do servidor falhou e retornou o código "$?"! - exit "$?" + # exit "$?" fi if [ "$?" -eq "0" ]; then echo Executando os testes... protractor functional-tests.conf.js else - # echo A execução dos testes falhou e retornou o código "$?"! echo A iniciação do servidor falhou e retornou o código "$?"! - exit "$?" + # exit "$?" fi if [ "$?" -eq "0" ]; then @@ -40,12 +32,13 @@ if [ "$?" -eq "0" ]; then webdriver-manager shutdown else echo A execução dos testes falhou e retornou o código "$?"! - # echo O encerramento do servidor falhou e retornou o código "$?"! - exit "$?" + # exit "$?" fi if [ "$?" -eq "0" ]; then - exit + echo O servidor foi parado com sucesso! + # exit else - exit "$?" + echo O encerramento do servidor falhou e retornou o código "$?"! + # exit "$?" fi \ No newline at end of file From 0525a2f684269b4870722ff7e4930f442e5201a6 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Tue, 28 Aug 2018 13:42:41 -0300 Subject: [PATCH 16/27] =?UTF-8?q?Ajustar=20a=20sequencia=20das=20condi?= =?UTF-8?q?=C3=A7=C3=B5es=20para=20receber=20os=20retornos=20corretamente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tests/functional/runSmokeTest.sh | 54 +++++++++++++--------------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh index ef27cc20..af88581a 100755 --- a/src/tests/functional/runSmokeTest.sh +++ b/src/tests/functional/runSmokeTest.sh @@ -6,39 +6,33 @@ yarn global add protractor if [ "$?" -eq "0" ]; then echo Atualizando o servidor do Selenium... webdriver-manager update -else + else echo A instalação do Protractor falhou e retornou o código "$?"! - # exit "$?" -fi -if [ "$?" -eq "0" ]; then - echo Iniciando o servidor... - webdriver-manager start --detach -else - echo A atualização do servidor falhou e retornou o código "$?"! - # exit "$?" -fi + if [ "$?" -eq "0" ]; then + echo Iniciando o servidor... + webdriver-manager start --detach + else + echo A atualização do servidor falhou e retornou o código "$?"! -if [ "$?" -eq "0" ]; then - echo Executando os testes... - protractor functional-tests.conf.js -else - echo A iniciação do servidor falhou e retornou o código "$?"! - # exit "$?" -fi + if [ "$?" -eq "0" ]; then + echo Executando os testes... + protractor functional-tests.conf.js + else + echo A iniciação do servidor falhou e retornou o código "$?"! -if [ "$?" -eq "0" ]; then - echo Parando o servidor... - webdriver-manager shutdown -else - echo A execução dos testes falhou e retornou o código "$?"! - # exit "$?" -fi + if [ "$?" -eq "0" ]; then + echo Parando o servidor... + webdriver-manager shutdown + else + echo A execução dos testes falhou e retornou o código "$?"! -if [ "$?" -eq "0" ]; then - echo O servidor foi parado com sucesso! - # exit -else - echo O encerramento do servidor falhou e retornou o código "$?"! - # exit "$?" + if [ "$?" -eq "0" ]; then + echo O servidor foi parado com sucesso! + else + echo O encerramento do servidor falhou e retornou o código "$?"! + fi + fi + fi + fi fi \ No newline at end of file From 4e07503e3963926ae2582e66425a3890ceacbb01 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Tue, 28 Aug 2018 14:13:49 -0300 Subject: [PATCH 17/27] Ajustar as condicionais para obter o retorno correto --- src/tests/functional/runSmokeTest.sh | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh index af88581a..849dfbfb 100755 --- a/src/tests/functional/runSmokeTest.sh +++ b/src/tests/functional/runSmokeTest.sh @@ -6,33 +6,29 @@ yarn global add protractor if [ "$?" -eq "0" ]; then echo Atualizando o servidor do Selenium... webdriver-manager update - else - echo A instalação do Protractor falhou e retornou o código "$?"! - if [ "$?" -eq "0" ]; then echo Iniciando o servidor... webdriver-manager start --detach - else - echo A atualização do servidor falhou e retornou o código "$?"! - if [ "$?" -eq "0" ]; then echo Executando os testes... protractor functional-tests.conf.js - else - echo A iniciação do servidor falhou e retornou o código "$?"! - if [ "$?" -eq "0" ]; then echo Parando o servidor... webdriver-manager shutdown - else - echo A execução dos testes falhou e retornou o código "$?"! - if [ "$?" -eq "0" ]; then echo O servidor foi parado com sucesso! else echo O encerramento do servidor falhou e retornou o código "$?"! fi + else + echo A execução dos testes falhou e retornou o código "$?"! fi + else + echo A iniciação do servidor falhou e retornou o código "$?"! fi + else + echo A atualização do servidor falhou e retornou o código "$?"! fi + else + echo A instalação do Protractor falhou e retornou o código "$?"! fi \ No newline at end of file From 05e1309e055dccc9677ef84ae47a0a1578bf1aa0 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Tue, 28 Aug 2018 14:27:09 -0300 Subject: [PATCH 18/27] =?UTF-8?q?Adicionar=20a=20execu=C3=A7=C3=A3o=20do?= =?UTF-8?q?=20shell=20script=20como=20bash=20para=20validar=20retorno?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 83484f9d..030644be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,7 @@ jobs: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - sleep 5 - script: ./src/tests/functional/runSmokeTest.sh + script: bash ./src/tests/functional/runSmokeTest.sh - stage: deploy From 151c1533593475fed909f31fbfc896f86d625c20 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Tue, 28 Aug 2018 14:53:09 -0300 Subject: [PATCH 19/27] Remover a linha que maximiza a tela --- .travis.yml | 2 +- functional-tests.conf.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 030644be..83484f9d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,7 @@ jobs: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - sleep 5 - script: bash ./src/tests/functional/runSmokeTest.sh + script: ./src/tests/functional/runSmokeTest.sh - stage: deploy diff --git a/functional-tests.conf.js b/functional-tests.conf.js index 868fb67d..232668b3 100644 --- a/functional-tests.conf.js +++ b/functional-tests.conf.js @@ -24,7 +24,8 @@ exports.config = { }, onPrepare() { - browser.manage().window().maximize(); + // browser.manage().window().maximize(); + // browser.manage().window().setSize(new Dimension(1600, 900)); browser.manage().timeouts().pageLoadTimeout(40000); const { Given, Then, When, Before } = require('cucumber'); global.Given = Given; From 27a2675b27a8e642f77001753b10ec4d28dba277 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Tue, 28 Aug 2018 15:20:15 -0300 Subject: [PATCH 20/27] =?UTF-8?q?Adicionar=20comando=20para=20inciar=20o?= =?UTF-8?q?=20servidor=20para=20execu=C3=A7=C3=A3o=20dos=20testes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 83484f9d..b3753533 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,10 +45,13 @@ jobs: - 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 - sleep 5 script: ./src/tests/functional/runSmokeTest.sh From 03a2bd213ab3ddb8cbbc4ddd2286f63192c87984 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Tue, 28 Aug 2018 17:28:41 -0300 Subject: [PATCH 21/27] =?UTF-8?q?Adicionar=20comando=20para=20executar=20a?= =?UTF-8?q?=20aplica=C3=A7=C3=A3o=20em=20background?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b3753533..ba7fb348 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,7 +51,7 @@ jobs: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - sleep 3 - - yarn start + - npm start --detach 2>&1 & - sleep 5 script: ./src/tests/functional/runSmokeTest.sh From 749a86d29b86c41c8305a19948386710ee824516 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Wed, 29 Aug 2018 09:58:16 -0300 Subject: [PATCH 22/27] Adicionar o comando para encerrar o processo do servidor node --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ba7fb348..9fe9a784 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,6 @@ jobs: - stage: test-with-coverage script: yarn test-coverage - - stage: smoke-test install: before_script: @@ -54,7 +53,8 @@ jobs: - npm start --detach 2>&1 & - sleep 5 script: ./src/tests/functional/runSmokeTest.sh - + after_script: + - pkill node - stage: deploy before_script: From 36cb177fed3a033b9c80b95eab6ea63967a51bae Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Wed, 29 Aug 2018 10:27:29 -0300 Subject: [PATCH 23/27] =?UTF-8?q?Adicionar=20vari=C3=A1vel=20para=20recebe?= =?UTF-8?q?r=20o=20status=20da=20execu=C3=A7=C3=A3o=20dos=20comandos=20e?= =?UTF-8?q?=20validar=20retorno=20para=20o=20CI=20quando=20o=20teste=20fal?= =?UTF-8?q?har?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functional-tests.conf.js | 2 +- src/tests/functional/runSmokeTest.sh | 26 ++++++++++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/functional-tests.conf.js b/functional-tests.conf.js index 232668b3..61e52d8f 100644 --- a/functional-tests.conf.js +++ b/functional-tests.conf.js @@ -24,7 +24,7 @@ exports.config = { }, onPrepare() { - // browser.manage().window().maximize(); + browser.manage().window().maximize(); // browser.manage().window().setSize(new Dimension(1600, 900)); browser.manage().timeouts().pageLoadTimeout(40000); const { Given, Then, When, Before } = require('cucumber'); diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh index 849dfbfb..e7e719b8 100755 --- a/src/tests/functional/runSmokeTest.sh +++ b/src/tests/functional/runSmokeTest.sh @@ -3,32 +3,38 @@ echo Instalando o Protractor globalmente... yarn global add protractor -if [ "$?" -eq "0" ]; then +export StatusResult=$?; +if [ $StatusResult -eq "0" ]; then echo Atualizando o servidor do Selenium... webdriver-manager update - if [ "$?" -eq "0" ]; then + if [ $StatusResult -eq "0" ]; then echo Iniciando o servidor... webdriver-manager start --detach - if [ "$?" -eq "0" ]; then + if [ $StatusResult -eq "0" ]; then echo Executando os testes... protractor functional-tests.conf.js - if [ "$?" -eq "0" ]; then + if [ $StatusResult -eq "0" ]; then echo Parando o servidor... webdriver-manager shutdown - if [ "$?" -eq "0" ]; then + if [ $StatusResult -eq "0" ]; then echo O servidor foi parado com sucesso! else - echo O encerramento do servidor falhou e retornou o código "$?"! + echo O encerramento do servidor falhou e retornou o código $StatusResult! + exit $StatusResult fi else - echo A execução dos testes falhou e retornou o código "$?"! + echo A execução dos testes falhou e retornou o código $StatusResult! + exit $StatusResult fi else - echo A iniciação do servidor falhou e retornou o código "$?"! + echo A iniciação do servidor falhou e retornou o código $StatusResult! + exit $StatusResult fi else - echo A atualização do servidor falhou e retornou o código "$?"! + echo A atualização do servidor falhou e retornou o código $StatusResult! + exit $StatusResult fi else - echo A instalação do Protractor falhou e retornou o código "$?"! + echo A instalação do Protractor falhou e retornou o código $StatusResult! + exit $StatusResult fi \ No newline at end of file From 6a0f47feb06632b8ed2b045526e9ebe7262cfbb7 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Wed, 29 Aug 2018 10:49:31 -0300 Subject: [PATCH 24/27] =?UTF-8?q?Identificar=20vari=C3=A1vel=20para=20reto?= =?UTF-8?q?rno=20de=20execu=C3=A7=C3=A3o=20de=20cada=20comando?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tests/functional/runSmokeTest.sh | 36 +++++++++++++++------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/tests/functional/runSmokeTest.sh b/src/tests/functional/runSmokeTest.sh index e7e719b8..b9355c6f 100755 --- a/src/tests/functional/runSmokeTest.sh +++ b/src/tests/functional/runSmokeTest.sh @@ -3,38 +3,42 @@ echo Instalando o Protractor globalmente... yarn global add protractor -export StatusResult=$?; -if [ $StatusResult -eq "0" ]; then +export StatusResult1=$?; +if [ $StatusResult1 -eq "0" ]; then echo Atualizando o servidor do Selenium... webdriver-manager update - if [ $StatusResult -eq "0" ]; then + export StatusResult2=$?; + if [ $StatusResult2 -eq "0" ]; then echo Iniciando o servidor... webdriver-manager start --detach - if [ $StatusResult -eq "0" ]; then + export StatusResult3=$?; + if [ $StatusResult3 -eq "0" ]; then echo Executando os testes... protractor functional-tests.conf.js - if [ $StatusResult -eq "0" ]; then + export StatusResult4=$?; + if [ $StatusResult4 -eq "0" ]; then echo Parando o servidor... webdriver-manager shutdown - if [ $StatusResult -eq "0" ]; then + 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 $StatusResult! - exit $StatusResult + 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 $StatusResult! - exit $StatusResult + 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 $StatusResult! - exit $StatusResult + 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 $StatusResult! - exit $StatusResult + 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 $StatusResult! - exit $StatusResult + echo A instalação do Protractor falhou e retornou o código $StatusResult1! + exit $StatusResult1 fi \ No newline at end of file From 50af5b5b05b3f913450cfdac07fbea648fc156e0 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Wed, 29 Aug 2018 11:01:14 -0300 Subject: [PATCH 25/27] =?UTF-8?q?Remover=20a=20op=C3=A7=C3=A3o=20para=20ma?= =?UTF-8?q?ximizar=20tela=20por=20ser=20desnecess=C3=A1ria=20neste=20conte?= =?UTF-8?q?xto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functional-tests.conf.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/functional-tests.conf.js b/functional-tests.conf.js index 61e52d8f..329af5b4 100644 --- a/functional-tests.conf.js +++ b/functional-tests.conf.js @@ -24,8 +24,6 @@ exports.config = { }, onPrepare() { - browser.manage().window().maximize(); - // browser.manage().window().setSize(new Dimension(1600, 900)); browser.manage().timeouts().pageLoadTimeout(40000); const { Given, Then, When, Before } = require('cucumber'); global.Given = Given; From c57a7dd7abb30c76026d634454b34fe1ff5b2689 Mon Sep 17 00:00:00 2001 From: Alisson Neves Date: Wed, 29 Aug 2018 11:26:20 -0300 Subject: [PATCH 26/27] =?UTF-8?q?Remover=20linhas=20em=20branco,=20condi?= =?UTF-8?q?=C3=A7=C3=A3o=20para=20o=20est=C3=A1gio=20e=20alerar=20o=20coma?= =?UTF-8?q?ndo=20para=20startar=20o=20node=20server?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9fe9a784..0174173e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,11 +17,10 @@ node_js: '8' stages: - name: lint + test + security-tests - name: test-with-coverage - if: (branch = master AND NOT (type = pull_request )) + if: (branch = master AND NOT (type = pull_request)) - name: smoke-test - if: (branch = waffle-292 AND NOT (type = pull-request )) - name: deploy - if: (branch = master AND NOT (type = pull_request )) + if: (branch = master AND NOT (type = pull_request)) install: - yarn install @@ -42,7 +41,6 @@ jobs: script: bash ci/security-checks.sh - stage: test-with-coverage script: yarn test-coverage - - stage: smoke-test install: before_script: @@ -50,12 +48,11 @@ jobs: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - sleep 3 - - npm start --detach 2>&1 & + - 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 From 95b192f2bd7f7b281311fe8af5416dd012686f2e Mon Sep 17 00:00:00 2001 From: Tatiane Aguirres Nogueira Date: Mon, 3 Sep 2018 19:27:52 -0300 Subject: [PATCH 27/27] =?UTF-8?q?Adicionar=20Tatiane=20Nogueira=20=C3=A0s?= =?UTF-8?q?=20colaboradoras?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/sobre/__snapshots__/Sobre.test.js.snap | 6 ++++++ src/components/sobre/colaboradores.js | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/components/sobre/__snapshots__/Sobre.test.js.snap b/src/components/sobre/__snapshots__/Sobre.test.js.snap index da34fc74..a9441b76 100644 --- a/src/components/sobre/__snapshots__/Sobre.test.js.snap +++ b/src/components/sobre/__snapshots__/Sobre.test.js.snap @@ -304,6 +304,12 @@ exports[`Sobre possui a mesma estrutura 1`] = ` nome="Sérgio Luis" papel="BA" /> +