Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 11 additions & 25 deletions .github/workflows/auto-simple-suite-reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,17 @@ jobs:
retention-days: 7

post-slack-notification-started:
runs-on: ubuntu-latest
steps:
- name: Post a start message in a Slack channel
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' \
--data '{"text":"The simple suite pipeline started"}' \
$SLACK_WEBHOOK_URL
uses: ./.github/workflows/slack-notification.yaml
with:
job_status: started
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

post-slack-notification-results:
runs-on: ubuntu-latest
needs: run-simple-suite
needs: run-simple-suite
if: always()
steps:
- name: Post a result message in a Slack channel
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
if [ "${{ needs.run-simple-suite.result }}" == "success" ]; then
MESSAGE="The simple suite pipeline succeeded"
elif [ "${{ needs.run-simple-suite.result }}" == "failure" ]; then
MESSAGE="The simple suite pipeline failed"
fi

curl -X POST -H 'Content-type: application/json' \
--data "{\"text\":\"$MESSAGE\"}" \
$SLACK_WEBHOOK_URL
uses: ./.github/workflows/slack-notification.yaml
with:
job_status: ${{ needs.run-simple-suite.result }}
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
43 changes: 43 additions & 0 deletions .github/workflows/run-p0-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Run P0 tests

on:
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
run-p0-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js and Playwright
uses: ./.github/actions/setup-playwright

- name: Run P0 tests
run: yarn playwright test --project=chromium --grep @p0

- name: Upload test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: p0-tests-results-${{ github.run_id }}
path: playwright-report/
retention-days: 7

post-slack-notification-started:
uses: ./.github/workflows/slack-notification.yaml
with:
job_status: started
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

post-slack-notification-results:
needs: run-p0-tests
if: always()
uses: ./.github/workflows/slack-notification.yaml
with:
job_status: ${{ needs.run-p0-tests.result }}
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
35 changes: 35 additions & 0 deletions .github/workflows/slack-notification.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Slack Notification

on:
workflow_call:
inputs:
job_status:
description: 'Status: started, success, failure, cancelled, skipped'
required: true
type: string
secrets:
SLACK_WEBHOOK_URL:
required: true

jobs:
send-notification:
runs-on: ubuntu-latest
steps:
- name: Post message to Slack
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
PIPELINE_NAME="${{ github.workflow }}"

case "${{ inputs.job_status }}" in
"started") MESSAGE="🚀 $PIPELINE_NAME started" ;;
"success") MESSAGE="✅ $PIPELINE_NAME succeeded" ;;
"failure") MESSAGE="❌ $PIPELINE_NAME failed" ;;
"cancelled") MESSAGE="🚫 $PIPELINE_NAME was cancelled" ;;
"skipped") MESSAGE="⏭️ $PIPELINE_NAME was skipped" ;;
*) MESSAGE="⚠️ $PIPELINE_NAME - status: ${{ inputs.job_status }}" ;;
esac

curl -X POST -H 'Content-type: application/json' \
--data "{\"text\":\"$MESSAGE\"}" \
$SLACK_WEBHOOK_URL
2 changes: 1 addition & 1 deletion tests/example.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';

test('has title', { tag: ['@smoke'] }, async ({ page }) => {
test('has title', { tag: ['@smoke', '@p0'] }, async ({ page }) => {
await page.goto('https://playwright.dev/');

// Expect a title "to contain" a substring.
Expand Down