Skip to content

SlackNotifications

SlackNotifications #56

Workflow file for this run

name: Playwright Github Actions
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install node js v20
uses: actions/setup-node@v2
with:
node-version: "20"
- name: Install dependencies
run: npm ci
- name: Install Chrome browser for Playwright
run: npx playwright install chrome
- name: Run tests
run: npm run test:serial
env:
npm_config_ENV: "qa"
- name: Wait for job completion
run: sleep 30s
if: always()
- name: Zip HTML report
run: zip -r html-report.zip html-report
if: always()
- name: Upload HTML report as artifact
uses: actions/upload-artifact@v2
with:
name: html-report
path: html-report.zip
- name: Send Slack notification with artifact link
uses: peaceiris/actions-slack@v2
with:
title: Playwright tests have completed
description: |
Playwright tests have completed successfully. HTML report is attached as an artifact.
You can download the report from the following link:
[Download HTML report](${{ github.server_url }}/${{ github.repository }}/actions/artifacts/html-report)
author_name: GitHub Actions
color: good
footer: ${{ github.event_name }}
author_icon: https://avatars.githubusercontent.com/u/44036562
webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}