Giter Club home page Giter Club logo

cypress-slack-video-upload-action's Introduction

typescript-action status

Upload Cypress videos and screenshots directly to Slack

This Github action enables you to take the screenshots and videos generated by Cypress after a test run and upload them directly to a Slack channel of your choice. All files are contained within a single message thread to minimize noise.

Inputs

token

Required Slack app token. See Internal app tokens

  • Create an app
  • Under Bot Token Scopes, add files:write and chat:write permissions
  • Install the app into your workspace
  • Invite the bot to whatever channels you want to send the videos and screenshots to /invite <botname>
  • Grab the Bot User OAuth Token from the OAuth & Permissions page
  • Add that token as a secret to your Github repo's Actions Secrets found under Settings -> Secrets (in the examples below we call it SLACK_TOKEN)

channels

Required Slack channels 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 Slack message text.

Default: A Cypress test just finished. I've placed the screenshots and videos in this thread. Good pie!

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: trymbill/[email protected]
        with:
          token: ${{ secrets.SLACK_TOKEN }}
          channels: 'engineering-ops'

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: trymbill/[email protected]
        if: failure()
        with:
          token: ${{ secrets.SLACK_TOKEN }}
          channels: 'engineering-ops'
          message-text: 'Cypress tests failed! They have been placed in this thread, good luck.'

cypress-slack-video-upload-action's People

Contributors

dependabot[bot] avatar evanhsu avatar grigorii-zander avatar trymbill avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.