Skip to content

Commit

Permalink
GitHub Actions Pipeline com BrowserStack
Browse files Browse the repository at this point in the history
  • Loading branch information
thinogueiras committed Feb 28, 2024
1 parent d0bcd25 commit 35b3ef4
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 5 deletions.
File renamed without changes
File renamed without changes
Binary file added .github/images/browserstack-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/browserstack-tests.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/observabilidade.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions .github/workflows/browserStack-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: BrowserStack Tests

on:
pull_request:
branches: [ main ]

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

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

- 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 -i browserstack tests/

- name: Upload Reports 📖📖
uses: actions/upload-artifact@v4
if: always()
with:
name: 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
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Automação de testes Mobile com Robot Framework e Appium.

<p align="left">
<img src="images/robot.png" width="275px">
</p>
[![BrowserStack Tests](https://github.com/thinogueiras/Robot-Appium-Tests/actions/workflows/browserStack-ci.yml/badge.svg?branch=main)](https://github.com/thinogueiras/Robot-Appium-Tests/actions/workflows/browserStack-ci.yml)

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

Expand Down Expand Up @@ -67,11 +65,11 @@ browserstack-sdk setup --framework "robot" --username "<YOUR_BROWSERSTACK_USERNA

- Inicie o Appium Server com o comando: **`appium`**.

![Alt text](images/appium.png)
![Alt text](.github/images/appium.png)

- Dê um play no Android Device Virtual.

![Alt text](images/avd.png)
![Alt text](.github/images/avd.png)


## Execução dos testes 🤖 🤖
Expand All @@ -96,6 +94,22 @@ Verifique a pasta `reports` para visualizar os <b>relatórios</b> da execução:

---

## Sobre a integração com o BrowserStack:

<p>
<img src=".github/images/browserstack-logo.png" width="375px">
</p>

### Execuções disparadas automaticamente pelo pipeline do `GitHub Actions`:

![alt text](.github/images/browserstack-tests.png)

### Observabilidade dos Testes:

![alt text](.github/images/observabilidade.png)

---

<a href="https://www.linkedin.com/in/thinogueiras"><img alt="Linkedin" src="https://img.shields.io/badge/-LinkedIn-blue?style=for-the-badge&logo=Linkedin&logoColor=white"></a>

<strong>Thiago Nogueira dos Santos</strong> 🤓 ✌🏻
Expand Down
Binary file removed images/robot.png
Binary file not shown.

0 comments on commit 35b3ef4

Please sign in to comment.