-
Notifications
You must be signed in to change notification settings - Fork 32
ci: integrated visual tests via playwright #670
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5878534
ci: added visual tests
makhnatkin a7cad7b
ci: added playwright
makhnatkin cdca71d
ci: added playwright
makhnatkin 96a5310
ci: added vitejs/plugin-react
makhnatkin 4e05503
ci: updated configs, added first test (draft)
makhnatkin f9333f2
ci: added first test
makhnatkin 8b8e3ff
ci: moved playwright to tests folder
makhnatkin 21bcc59
ci: deleted unused files
makhnatkin 6dd519f
ci: added snapshots
makhnatkin dc1abde
ci: updated workers count
makhnatkin 9af2c17
ci: added pre style
makhnatkin 3705c82
ci: updated tests, added readme
makhnatkin a57e5d5
ci: updated imports
makhnatkin 13eacf8
ci: updated helpers
makhnatkin ee6be78
ci: added wait fixture
makhnatkin c4b0643
ci: fixed some tests
makhnatkin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: PR Visual Tests Report | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: ['PR Visual Tests'] | ||
| types: | ||
| - completed | ||
|
|
||
| jobs: | ||
| comment: | ||
| name: Create GitHub Comment | ||
| if: github.event.workflow_run.event == 'pull_request' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Download Artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }} | ||
| run-id: ${{ github.event.workflow_run.id }} | ||
| - name: Extract PR Number | ||
| id: pr | ||
| run: echo "::set-output name=id::$(<pr/pr-id.txt)" | ||
| shell: bash | ||
| - name: Install AWS CLI | ||
| uses: unfor19/install-aws-cli-action@v1 | ||
| with: | ||
| version: 2.22.35 | ||
| arch: amd64 | ||
| - name: Upload to S3 | ||
| env: | ||
| AWS_ACCESS_KEY_ID: ${{ secrets.STORYBOOK_S3_KEY_ID }} | ||
| AWS_SECRET_ACCESS_KEY: ${{ secrets.STORYBOOK_S3_SECRET_KEY }} | ||
| AWS_DEFAULT_REGION: ru-central1 | ||
| AWS_EC2_METADATA_DISABLED: true | ||
| run: aws s3 cp playwright-report s3://playwright-reports/markdown-editor/pulls/${{ steps.pr.outputs.id}}/ --endpoint-url=https://storage.yandexcloud.net --recursive | ||
| shell: bash | ||
| - name: Create Comment | ||
| uses: marocchino/sticky-pull-request-comment@v2 | ||
| with: | ||
| GITHUB_TOKEN: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }} | ||
| number: ${{ steps.pr.outputs.id }} | ||
| header: visual tests report | ||
| message: '[Visual Tests Report](https://storage.yandexcloud.net/playwright-reports/markdown-editor/pulls/${{ steps.pr.outputs.id }}/index.html) is ready.' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: PR Visual Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| visual_tests: | ||
| name: Visual Tests | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: mcr.microsoft.com/playwright:v1.49.0-jammy | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
| - name: Install Packages | ||
| run: npm ci | ||
| - name: Run Visual Tests | ||
| run: npm run playwright | ||
| env: | ||
| CI: 'true' | ||
| - name: Upload Playwright Report | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: playwright-report | ||
| path: ./playwright-report | ||
| retention-days: 1 | ||
| - name: Save PR ID | ||
| if: always() | ||
| run: | | ||
| pr="${{ github.event.pull_request.number }}" | ||
| echo $pr > ./pr-id.txt | ||
| shell: bash | ||
| - name: Create PR Artifact | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: pr | ||
| path: ./pr-id.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| import {ActionName as Action} from 'src/bundle/config/action-names'; | ||
| import {ToolbarName as Toolbar} from 'src/modules/toolbars/constants'; | ||
| import { | ||
| boldItemView, | ||
| boldItemWysiwyg, | ||
| colorifyItemMarkup, | ||
| colorifyItemView, | ||
| colorifyItemWysiwyg, | ||
| italicItemMarkup, | ||
| italicItemView, | ||
| redoItemMarkup, | ||
| redoItemView, | ||
| redoItemWysiwyg, | ||
| undoItemMarkup, | ||
| undoItemView, | ||
| undoItemWysiwyg, | ||
| } from 'src/modules/toolbars/items'; | ||
| import type {ToolbarsPreset} from 'src/modules/toolbars/types'; | ||
|
|
||
| export const toolbarPresets: Record<string, ToolbarsPreset> = { | ||
| custom: { | ||
| items: { | ||
| [Action.undo]: { | ||
| view: undoItemView, | ||
| wysiwyg: undoItemWysiwyg, | ||
| markup: undoItemMarkup, | ||
| }, | ||
| [Action.redo]: { | ||
| view: redoItemView, | ||
| wysiwyg: redoItemWysiwyg, | ||
| markup: redoItemMarkup, | ||
| }, | ||
| [Action.bold]: { | ||
| view: boldItemView, | ||
| wysiwyg: boldItemWysiwyg, | ||
| }, | ||
| [Action.italic]: { | ||
| view: italicItemView, | ||
| markup: italicItemMarkup, | ||
| }, | ||
| [Action.colorify]: { | ||
| view: colorifyItemView, | ||
| wysiwyg: colorifyItemWysiwyg, | ||
| markup: colorifyItemMarkup, | ||
| }, | ||
| }, | ||
| orders: { | ||
| [Toolbar.wysiwygMain]: [[Action.colorify], [Action.bold], [Action.undo, Action.redo]], | ||
| [Toolbar.markupMain]: [[Action.colorify], [Action.italic], [Action.undo, Action.redo]], | ||
| }, | ||
| }, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.