{"id":29176799,"url":"https://github.com/robotcourses/robotframework-slacknotification","last_synced_at":"2025-07-01T17:32:43.940Z","repository":{"id":300254967,"uuid":"1001169323","full_name":"robotcourses/robotframework-slacknotification","owner":"robotcourses","description":"Send real-time notifications to Slack with the results of your tests","archived":false,"fork":false,"pushed_at":"2025-06-20T17:16:26.000Z","size":15237,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-20T17:43:52.803Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robotcourses.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-13T00:01:01.000Z","updated_at":"2025-06-20T17:16:30.000Z","dependencies_parsed_at":"2025-06-20T17:53:58.900Z","dependency_job_id":null,"html_url":"https://github.com/robotcourses/robotframework-slacknotification","commit_stats":null,"previous_names":["robotcourses/robotframework-slacknotification"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robotcourses/robotframework-slacknotification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotcourses%2Frobotframework-slacknotification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotcourses%2Frobotframework-slacknotification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotcourses%2Frobotframework-slacknotification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotcourses%2Frobotframework-slacknotification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robotcourses","download_url":"https://codeload.github.com/robotcourses/robotframework-slacknotification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotcourses%2Frobotframework-slacknotification/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263007041,"owners_count":23398750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-01T17:30:41.945Z","updated_at":"2025-07-01T17:32:43.895Z","avatar_url":"https://github.com/robotcourses.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RobotSlackNotification\n\n![Exemplo de Uso](docs/example_video.gif)\n\n## 🇧🇷 Descrição\n\n**RobotSlackNotification** é uma biblioteca para o [Robot Framework](https://robotframework.org/) que envia notificações em tempo real para um canal do Slack com o status e os resultados dos testes automatizados. Ideal para execuções integradas com pipelines de CI/CD, como GitHub Actions, GitLab CI, Jenkins, entre outros.\n\n### Principais Funcionalidades\n\n- Envia mensagem principal com resumo dos testes (executados, sucesso, falha, pulados)\n- Atualiza a mensagem principal conforme a execução avança\n- Envia detalhes de falhas em threads da mensagem principal\n- Permite menção automática a grupos do Slack (User Groups) configurados por suite\n\n---\n\n## ⚙️ Configuração do Projeto\n\n### 1. Instale a biblioteca\n\nUse o Poetry ou pip:\n```bash\npoetry add robotframework-slacknotification\n# ou\npip install robotframework-slacknotification\n```\n\n### 2. Configure o arquivo `.env`\n\nCrie um arquivo `.env` na raiz do projeto o API TOKEN do Slack e o ID do seu Canal:\n```\nSLACK_API_TOKEN=xoxb-seu-token-do-slack\nSLACK_CHANNEL=ID_DO_CANAL\n```\n\n- O token deve ser do tipo \"Bot User OAuth Token\" e ter os escopos:\n  - `chat:write`\n  - `chat:write.public`\n  - `usergroups:read` (para menções automáticas a grupos)\n\n### 3. (Opcional) Configure os grupos de menção por suite\n\nCrie um arquivo chamado `robot_slack_config.py` na raiz do seu projeto de testes, conforme o exemplo abaixo:\n\n```python\nfrom dotenv import load_dotenv\nimport os\n\nload_dotenv()\n\n# Configurações obrigatórias do Slack\nSLACK_API_TOKEN = os.getenv('SLACK_API_TOKEN', \"\")\nSLACK_CHANNEL = os.getenv('SLACK_CHANNEL', \"\")\n\n# Configurações opcionais de grupos por suite\nSUITE_SLACK_GROUPS = {\n    \"Test Slack\": [\"grupo_dev\", \"grupo_test\"],\n}\n\n# Configuração opcional para logs de debug\nDEBUG_LOGS = True  # Ativa logs detalhados para debug\n```\n\n- O nome da suite deve ser igual ao exibido no log do Robot Framework\n- Os nomes dos grupos devem ser os \"handles\" dos User Groups do Slack (sem o `@`)\n- O arquivo é obrigatório para a biblioteca funcionar\n- `DEBUG_LOGS` (opcional): Quando `True`, exibe logs detalhados no console para facilitar o debug da biblioteca\n\n### 4. (Opcional) Suporte a múltiplos idiomas\n\nA biblioteca suporta mensagens em três idiomas:\n- **Inglês** (padrão) = en\n- **Português-BR** = pt-br\n- **Espanhol** = es\n\nBasta passar o argumento `language` ao importar a biblioteca no seu teste Robot:\n\n```robot\nLibrary    RobotSlackNotification\n    ...    language=pt-br\n```\nou\n```robot\nLibrary    RobotSlackNotification\n    ...    language=es\n```\nSe não informar, o padrão será inglês (`en`).\n\nTodos os textos das mensagens, labels e alertas serão enviados no idioma escolhido.\n\n### 5. Adicione a biblioteca no seu teste Robot\nExemplo completo de uso:\n```robot\nLibrary    RobotSlackNotification\n    ...    test_title=Seu Título de Teste\n    ...    environment=HML\n    ...    cicd_url=https://github.com/sua-org/seu-repo/actions/runs/123456789\n    ...    language=pt-br\n```\n\n- `test_title` (opcional): Título do teste. Se não informado, usa o nome da suite por padrão.\n- `environment` (opcional): Ambiente de execução. Se não informado, não aparece na mensagem.\n- `cicd_url` (opcional): URL completa do pipeline.\n- `language` (opcional): Idioma das mensagens. Padrão é inglês (`en`).\n\n---\n\n## 🛠️ Configuração no Slack\n\n1. **Crie um app no Slack:**  \n   - https://api.slack.com/apps → \"Create New App\" → \"From scratch\"\n   - Adicione os escopos: `chat:write`, `chat:write.public`, `usergroups:read`\n   - Instale o app no workspace e copie o token do bot (`xoxb-...`)\n\n2. **Crie User Groups (Grupos de Usuários):**  \n   - Acesse https://app.slack.com/user-groups\n   - Crie grupos como `@grupo_dev`, `@grupo_qa`, etc.\n   - O handle do grupo (ex: `grupo_dev`) é o que você usará no arquivo de configuração.\n\n3. **Adicione o bot ao canal desejado.**\n\n---\n\n## 🚨 Como funcionam as menções automáticas\n\n- No final da execução de cada suite, se houver falhas e grupos configurados para aquela suite, será enviada uma mensagem na thread da mensagem principal, marcando os grupos.\n- Exemplo de mensagem automática:\n  ```\n  @grupo_dev @grupo_qa podem verificar?\n  ```\n\n---\n\n## 🇺🇸 English\n\n**RobotSlackNotification** is a [Robot Framework](https://robotframework.org/) library that sends real-time notifications to a Slack channel with the status and results of your automated tests. Perfect for executions integrated with CI/CD pipelines like GitHub Actions, GitLab CI, Jenkins, and others.\n\n### Main Features\n\n- Sends a main message with a summary of test results (executed, passed, failed, skipped)\n- Updates the main message as execution progresses\n- Sends failure details in threads under the main message\n- Allows automatic mention of Slack User Groups per suite\n\n---\n\n## ⚙️ Project Setup\n\n### 1. Install the library\n\nUse Poetry or pip:\n```bash\npoetry add robotframework-slacknotification\n# or\npip install robotframework-slacknotification\n```\n\n### 2. Configure the `.env` file\n\nCreate a `.env` file in the project root with your Slack API Token and Channel ID:\n```\nSLACK_API_TOKEN=xoxb-your-slack-token\nSLACK_CHANNEL=YOUR_CHANNEL_ID\n```\n\n- The token must be a \"Bot User OAuth Token\" with scopes:\n  - `chat:write`\n  - `chat:write.public`\n  - `usergroups:read` (for automatic group mentions)\n\n### 3. (Optional) Configure group mentions per suite\n\nCreate a file named `robot_slack_config.py` in your test project root, as shown below:\n\n```python\nfrom dotenv import load_dotenv\nimport os\n\nload_dotenv()\n\n# Required Slack configurations\nSLACK_API_TOKEN = os.getenv('SLACK_API_TOKEN', \"\")\nSLACK_CHANNEL = os.getenv('SLACK_CHANNEL', \"\")\n\n# Optional suite group configurations\nSUITE_SLACK_GROUPS = {\n    \"Suite Name 1\": [\"grupo_dev\", \"grupo_qa\"],\n    \"Suite Name 2\": [\"grupo_ops\"],\n}\n\n# Optional debug logs configuration\nDEBUG_LOGS = True  # Enables detailed debug logs\n```\n\n- The suite name must match exactly what is shown in the Robot Framework log\n- Group names must be the User Group handles from Slack (without `@`)\n- The file is required for the library to work\n- `DEBUG_LOGS` (optional): When `True`, displays detailed logs in the console to help debug the library\n\n### 4. (Optional) Multi-language support\n\nThe library supports messages in three languages:\n- **English** (default) = en\n- **Portuguese-BR** = pt-br\n- **Spanish** = es\n\nJust pass the `language` argument when importing the library in your Robot test:\n\n```robot\nLibrary    RobotSlackNotification\n    ...    language=pt-br\n```\nor\n```robot\nLibrary    RobotSlackNotification\n    ...    language=es\n```\nIf not specified, the default is English (`en`).\n\nAll message texts, labels, and alerts will be sent in the selected language.\n\n### 5. Add the library to your Robot test\n\nFull usage example:\n```robot\nLibrary    RobotSlackNotification\n    ...    test_title=Your Test Title\n    ...    environment=HML\n    ...    cicd_url=https://github.com/your-org/your-repo/actions/runs/123456789\n    ...    language=en\n```\n\n- `test_title` (optional): Test title. If not provided, the suite name will be used by default.\n- `environment` (optional): Execution environment. If not provided, it will not appear in the message.\n- `cicd_url` (optional): Full pipeline run URL.\n- `language` (optional): Message language. Default is English (`en`).\n\n---\n\n## 🛠️ Slack Setup\n\n1. **Create a Slack app:**  \n   - https://api.slack.com/apps → \"Create New App\" → \"From scratch\"\n   - Add scopes: `chat:write`, `chat:write.public`, `usergroups:read`\n   - Install the app in your workspace and copy the bot token (`xoxb-...`)\n\n2. **Create User Groups:**  \n   - Go to https://app.slack.com/user-groups\n   - Create groups like `@grupo_dev`, `@grupo_qa`, etc.\n   - The group handle (e.g., `grupo_dev`) is what you use in the config file.\n\n3. **Add the bot to the desired channel.**\n\n---\n\n## 🚨 How automatic mentions work\n\n- At the end of each suite, if there are failures and groups configured for that suite, a message will be sent in the thread of the main message, mentioning the groups.\n- Example of automatic message:\n  ```\n  @grupo_dev @grupo_qa can check?\n  ```\n\n---\n\n## Licença / License\n\nEste projeto está licenciado sob a licença Apache 2.0.  \nThis project is licensed under the Apache 2.0 license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotcourses%2Frobotframework-slacknotification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobotcourses%2Frobotframework-slacknotification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotcourses%2Frobotframework-slacknotification/lists"}