Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress component test #1257

Merged
merged 23 commits into from
Nov 22, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
generate snaps after merging PR
  • Loading branch information
Sanghavi authored and Sanghavi committed Nov 3, 2022
commit e137b921830850a93da916b2eee76c94e5852d7a
29 changes: 29 additions & 0 deletions .github/workflows/webviz-subsurface-components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,32 @@ jobs:
git push -u origin update_snaps
gh pr create --reviewer ${{ github.actor }} --title 'Cypress - New Snapshots for PR number ${{ github.event.number }} by ${{ github.actor }}' --body 'Created by Github action'
fi

- name: prepare for automated pull request
id: check_file_changed
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || contains(github.event.head_commit.message, '[deploy test]')) && matrix.python-version == '3.10' && failure()
run: |
if [ -d "react/cypress-visual-screenshots/diff" ]
then
echo '::set-output name=status::true'
cd react
npx cypress-image-diff -u
rm -rf cypress-visual-screenshots/comparison
rm -rf cypress-visual-screenshots/diff
rm -rf cypress/screenshots
rm -rf cypress/videos
else
echo "false" >> $GITHUB_OUTPUT
fi

- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@5a6b15373e5788c38d83296b674ad5abea28085c
if: steps.check_file_changed.outputs.status == 'true' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || contains(github.event.head_commit.message, '[deploy test]')) && matrix.python-version == '3.10' && failure()
with:
commit-message: updated cypress snapshots
title: Cypress - New Snapshots generated for the commit "${{ github.event.head_commit.message }}" by ${{ github.event.commits[0].author.email }}
body: This is an auto-generated PR to update cypress snapshots.
base: ${{ github.head_ref }}
reviewers: ${{ github.event.sender.login }}
delete-branch: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, will fix it