Skip to content

Commit

Permalink
Refatoração na estrutura dos pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
thinogueiras committed Mar 12, 2024
1 parent 997d2f4 commit 00a4e41
Show file tree
Hide file tree
Showing 5 changed files with 169 additions and 115 deletions.
59 changes: 0 additions & 59 deletions .github/workflows/browserstack-ci.yml

This file was deleted.

86 changes: 86 additions & 0 deletions .github/workflows/browserstack-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: BrowserStack Tests

on:
pull_request:
branches: [ main ]
push:
branches: [main]

jobs:
tests:
runs-on: ubuntu-latest
name: E2E Tests 🤖🤖

steps:
- name: Checkout 🚀🚀
uses: actions/checkout@v4

- name: Setup Python 🔧🔧
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies ➕➕
run: pip install -r requirements.txt

- name: BrowserStack Env Setup 🔧🔧
uses: browserstack/github-actions/setup-env@master
with:
username: ${{ secrets.BROWSERSTACK_USERNAME }}
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}

- name: Run tests 🧪🧪
run: browserstack-sdk robot -d ./reports -e ignore-bs tests/

- name: Publish Robot Reports 📄📄
uses: actions/upload-artifact@v4
if: always()
with:
name: Robot-Reports
path: reports
retention-days: 90
if-no-files-found: warn

- name: Slack Notification - Success
if: ${{ success() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: pipeline-notifications
SLACK_COLOR: ${{ job.status }}
SLACK_ICON: https://cdn-icons-png.flaticon.com/512/1642/1642322.png
SLACK_TITLE: 'All tests passed successfully'
SLACK_MESSAGE: ':robot: Tests passed :robot:'
SLACK_USERNAME: SUCCESS

- name: Slack Notification - Failure
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: pipeline-notifications
SLACK_COLOR: ${{ job.status }}
SLACK_ICON: https://cdn-icons-png.flaticon.com/512/3271/3271351.png
SLACK_TITLE: 'Some tests failed'
SLACK_MESSAGE: ':fire: Tests failed :fire:'
SLACK_USERNAME: FAILURE

reports:
if: always()
needs: [tests]
runs-on: ubuntu-latest
continue-on-error: true
name: Reports 📄📄
steps:
- uses: actions/checkout@v4

- name: Download Robot Reports
uses: actions/download-artifact@v4
with:
name: Robot-Reports
path: reports

- name: Send report to commit
uses: joonvena/[email protected]
with:
gh_access_token: ${{ secrets.GITHUB_TOKEN }}
53 changes: 0 additions & 53 deletions .github/workflows/ci.yml

This file was deleted.

80 changes: 80 additions & 0 deletions .github/workflows/continuous-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Robot Framework Tests

on:
pull_request:
branches: [ main ]
push:
branches: [main]

jobs:
tests:
runs-on: ubuntu-latest
name: E2E Tests 🤖🤖

steps:
- name: Checkout 🚀🚀
uses: actions/checkout@v4

- name: Setup Python 🔧🔧
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies ➕➕
run: pip install -r requirements.txt

- name: Run tests 🧪🧪
run: robot -d ./reports -v BROWSER:headlesschrome tests/

- name: Publish Robot Reports 📄📄
uses: actions/upload-artifact@v4
if: always()
with:
name: Robot-Reports
path: reports
retention-days: 90
if-no-files-found: warn

- name: Slack Notification - Success
if: ${{ success() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: pipeline-notifications
SLACK_COLOR: ${{ job.status }}
SLACK_ICON: https://cdn-icons-png.flaticon.com/512/1642/1642322.png
SLACK_TITLE: 'All tests passed successfully'
SLACK_MESSAGE: ':robot: Tests passed :robot:'
SLACK_USERNAME: SUCCESS

- name: Slack Notification - Failure
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: pipeline-notifications
SLACK_COLOR: ${{ job.status }}
SLACK_ICON: https://cdn-icons-png.flaticon.com/512/3271/3271351.png
SLACK_TITLE: 'Some tests failed'
SLACK_MESSAGE: ':fire: Tests failed :fire:'
SLACK_USERNAME: FAILURE

reports:
if: always()
needs: [tests]
runs-on: ubuntu-latest
continue-on-error: true
name: Reports 📄📄
steps:
- uses: actions/checkout@v4

- name: Download Robot Reports
uses: actions/download-artifact@v4
with:
name: Robot-Reports
path: reports

- name: Send report to commit
uses: joonvena/[email protected]
with:
gh_access_token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Projeto de testes E2E com Robot Framework e Selenium WebDriver.

[![Robot Framework Tests](https://github.com/thinogueiras/Robot-BrowserStack-Tests/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/thinogueiras/Robot-BrowserStack-Tests/actions/workflows/ci.yml) [![BrowserStack Tests](https://github.com/thinogueiras/Robot-BrowserStack-Tests/actions/workflows/browserstack-ci.yml/badge.svg?branch=main)](https://github.com/thinogueiras/Robot-BrowserStack-Tests/actions/workflows/browserstack-ci.yml)
[![Robot Framework Tests](https://github.com/thinogueiras/Robot-Selenium-BrowserStack/actions/workflows/continuous-testing.yml/badge.svg?branch=main)](https://github.com/thinogueiras/Robot-Selenium-BrowserStack/actions/workflows/continuous-testing.yml) [![BrowserStack Tests](https://github.com/thinogueiras/Robot-Selenium-BrowserStack/actions/workflows/browserstack-testing.yml/badge.svg?branch=main)](https://github.com/thinogueiras/Robot-Selenium-BrowserStack/actions/workflows/browserstack-testing.yml)

## Pré-requisitos mínimos de ambiente:

* [Python](https://www.python.org/downloads/) 3.10.12.
* [Python](https://www.python.org/downloads/) 3.11.x.

* [Node.js](https://nodejs.org/en) 18.17.1.
* [Node.js](https://nodejs.org/en) 18.17.x.

## Instalação do projeto:

Expand Down

2 comments on commit 00a4e41

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
10 0 0 10 100 24.968667s

Passed Tests

Name ⏱️ Duration Suite
Deve validar o título da página inicial 16.147 s Home
Deve validar o logo Buger Eats 0.512 s Home
Deve validar o texto do cabeçalho 0.491 s Home
Deve validar o texto central 0.460 s Home
Deve registrar o usuário como entregador 1.688 s Signup
Deve validar CPF inválido 1.156 s Signup
Deve validar E-mail inválido 1.116 s Signup
Deve validar Whatsapp inválido 1.133 s Signup
Deve validar CEP inválido 1.184 s Signup
Deve validar os campos obrigatórios 1.081 s Signup

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
9 0 0 9 100 1m22.714459s

Passed Tests

Name ⏱️ Duration Suite
Deve validar o título da página inicial 9.571 s Home
Deve validar o logo Buger Eats 5.537 s Home
Deve validar o texto do cabeçalho 8.926 s Home
Deve validar o texto central 4.801 s Home
Deve validar CPF inválido 9.746 s Signup
Deve validar E-mail inválido 17.976 s Signup
Deve validar Whatsapp inválido 10.435 s Signup
Deve validar CEP inválido 8.136 s Signup
Deve validar os campos obrigatórios 7.585 s Signup

Please sign in to comment.