Skip to content

Latest commit

 

History

History
86 lines (59 loc) · 2.33 KB

File metadata and controls

86 lines (59 loc) · 2.33 KB

typescript-action status

Upload Cypress videos and screenshots directly to Workplace Chat

This Github action enables you to take the screenshots and videos generated by Cypress after a test run and upload them directly to a Workplace Group Chat of your choice.

Inputs

token

Required Workplace Chat Bot Access token.

channel

Required Workplace Group Chat ID to upload to

workdir

Optional The folder where Cypress stores screenshots and videos on the build machine.

Default: cypress

(this relative path resolves to /home/runner/work/<REPO_NAME>/<REPO_NAME>/cypress)

If your project uses Cypress from the project root folder, the default value will work for you. But if your project uses Cypress in a subfolder (like most monorepos), you'll need to provide the relative path to that folder (i.e. e2e/cypress). (Don't include a trailing slash on your path!)

message-text

Optional Custom chat message text.

Default: A Cypress test just finished. They are being uploaded here!

Examples

Upload results after every push

on: [push]

jobs:
  test-and-upload-results:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: 'Run tests'
        uses: cypress-io/github-action@v2

      - name: 'Upload screenshots and videos to Slack'
        uses: SreeniIO/[email protected]
        with:
          token: ${{ secrets.SLACK_TOKEN }}
          channel: '12345...'

Only upload when open PRs fail

on: [pull_request]

jobs:
  test-and-upload-results-on-fail:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: 'Run tests'
        uses: cypress-io/github-action@v2

      - name: 'Upload screenshots and videos to Slack'
        uses: SreeniIO/[email protected]
        if: failure()
        with:
          token: ${{ secrets.SLACK_TOKEN }}
          channel: '12345...'
          message-text: 'Cypress tests failed! They are being uploaded here, good luck.'

Credits: Inspired from https://github.com/trymbill/cypress-slack-video-upload-action