CypressでGitHub ActionsでのE2Eテストの状況をSlack動画通知する
5735 ワード
結論
Cypress Screenshot & Video Upload to Slackをよくみてクレメンス
ハマりどころ
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)
以下3点
- Under Bot Token Scopes, add files:write and chat:write permissions
- /invite botname
- Grab the Bot User OAuth Token from the OAuth & Permissions page
ここはGitHubの設定
- 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)
いざ実行
github/workflows/e2e.yml
name: E2E Test
on:
pull_request:
branches: [ master ]
jobs:
e2e-test:
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: 'proj-...'
- name: 'Upload screenshots and videos to Slack'
uses: trymbill/[email protected]
if: failure()
with:
token: ${{ secrets.SLACK_TOKEN }}
channels: 'proj-...'
message-text: 'Cypress tests failed! They have been placed in this thread, good luck.'
参照
Author And Source
この問題について(CypressでGitHub ActionsでのE2Eテストの状況をSlack動画通知する), 我々は、より多くの情報をここで見つけました https://qiita.com/ProjectEuropa/items/0c3e42f0571c1d546a8f著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .