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

test: add visual tests infra #1047

Merged
merged 35 commits into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
51510f5
chore(TestComponent): made a new kind of component testing
NasgulNexus Oct 12, 2023
939da08
fix: ci
NasgulNexus Oct 11, 2023
618723e
fix: ci
NasgulNexus Oct 11, 2023
959179f
fix: ci
NasgulNexus Oct 11, 2023
4513a35
fix: ci
NasgulNexus Oct 11, 2023
1e8e4fe
fix: test ci
NasgulNexus Oct 12, 2023
b15aa1d
fix: ci
NasgulNexus Oct 12, 2023
dc467cb
fix: add to gitignore test-results
NasgulNexus Oct 12, 2023
4d51053
fix: snapshots
NasgulNexus Oct 12, 2023
604ff87
fix: ci
NasgulNexus Oct 12, 2023
d2b3d9d
fix: upload reports
NasgulNexus Oct 12, 2023
5929f42
fix: retries 0
NasgulNexus Oct 12, 2023
360212a
fix: test styles
NasgulNexus Oct 12, 2023
425b89e
fix: config
NasgulNexus Oct 12, 2023
18d1c9f
fix: test channel
NasgulNexus Oct 12, 2023
bc84b37
fix: delete channel
NasgulNexus Oct 12, 2023
fbb9110
fix: add upload test-result
NasgulNexus Oct 12, 2023
5d8bb87
fix: add docker
NasgulNexus Nov 8, 2023
a6d90e3
fix: delete test
NasgulNexus Nov 8, 2023
5877113
fix: change ci
NasgulNexus Nov 8, 2023
f55102f
fix: add always
NasgulNexus Nov 8, 2023
a6ba436
fix: add always
NasgulNexus Nov 8, 2023
9abae19
fix: delete container
NasgulNexus Nov 8, 2023
e2202be
fix: test aws
NasgulNexus Nov 8, 2023
aae8b1b
fix: test commit
NasgulNexus Nov 10, 2023
bbc692d
fix: docs
NasgulNexus Nov 10, 2023
c7c9b3b
fix: folder tests
NasgulNexus Nov 13, 2023
6c58de1
fix: ci
NasgulNexus Nov 13, 2023
485ed8a
fix: fix broken test
NasgulNexus Nov 13, 2023
e8b903c
fix: test tests
NasgulNexus Nov 13, 2023
ce44594
fix: rebase
NasgulNexus Nov 13, 2023
16c956a
fix: test ci if
NasgulNexus Nov 16, 2023
735383b
fix: correct remarks
NasgulNexus Nov 16, 2023
aa02617
fix: fix docs
NasgulNexus Nov 16, 2023
9d7d11a
fix: commit ci cd
NasgulNexus Nov 17, 2023
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
49 changes: 49 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Playwright Tests

on:
# push:
# branches: [main, next]
pull_request:

jobs:
test:
name: Test component
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npm run playwright
env:
CI: 'true'
- name: Upload Playwright playwright report to GitHub Actions Artifacts
if: always()
Copy link
Contributor

Choose a reason for hiding this comment

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

This line needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made it so that the report was always shown and during development it was clear whether new tests appeared or not

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean isnt's if: always() equal to not specifing if statement at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://github.com/gravity-ui/uikit/actions/runs/6888720871/job/18738258388#step:6:4712 tested without if it doesn't work.
because the test crashes and then does not perform other tasks. Without if he will do it only when everything went well

uses: actions/upload-artifact@v3
with:
name: playwright-report
path: playwright-report
retention-days: 1
- name: Upload Playwright report
if: always()
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/uikit/pulls/${{ github.event.pull_request.number }}/ --endpoint-url=https://storage.yandexcloud.net --recursive
shell: bash
- name: Create Comment
if: always()
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
number: ${{ github.event.pull_request.number }}
header: playwright test
message: '[Playwright Test Component](https://storage.yandexcloud.net/playwright-reports/uikit/pulls/${{ github.event.pull_request.number }}/index.html) is ready.'

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ node_modules
/build
/styles/**/*.css
/coverage
/playwright/playwright/.cache
/playwright-report
/test-results
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ module.exports = {
'\\.(css|less|scss|sass)$': 'jest-transform-css',
},
testMatch: ['**/*.test.[jt]s?(x)'],
testPathIgnorePatterns: ['.visual.'],
};
252 changes: 249 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading