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

fix 🐛: Update CI and tests #377

Merged
merged 12 commits into from
Feb 1, 2024
Merged

fix 🐛: Update CI and tests #377

merged 12 commits into from
Feb 1, 2024

Conversation

melMass
Copy link
Member

@melMass melMass commented Jan 31, 2024

  • also fixes the playwright screenshot test, not sure about the action

also fixes the playwright screenshot test, not srue about the action
Copy link

github-actions bot commented Jan 31, 2024

PR Preview Action v1.4.6
Preview removed because the pull request was closed.
2024-02-01 16:22 UTC

@Zir0h
Copy link
Contributor

Zir0h commented Jan 31, 2024

12 failed
[webkit] › teia.screenshots.spec.ts:46:5 › screenshots feeds menu ──────────────────────────────
[webkit] › teia.screenshots.spec.ts:61:5 › screenshots events menu ─────────────────────────────
[webkit] › teia.screenshots.spec.ts:78:5 › screenshots main menu ───────────────────────────────
[webkit] › teia.screenshots.spec.ts:97:7 › screenshots page home ───────────────────────────────
[webkit] › teia.screenshots.spec.ts:97:7 › screenshots page afterviz ───────────────────────────
[webkit] › teia.screenshots.spec.ts:97:7 › screenshots page settings ───────────────────────────
[Mobile Safari] › teia.screenshots.spec.ts:46:5 › screenshots feeds menu ───────────────────────
[Mobile Safari] › teia.screenshots.spec.ts:61:5 › screenshots events menu ──────────────────────
[Mobile Safari] › teia.screenshots.spec.ts:78:5 › screenshots main menu ────────────────────────
[Mobile Safari] › teia.screenshots.spec.ts:97:7 › screenshots page home ────────────────────────
[Mobile Safari] › teia.screenshots.spec.ts:97:7 › screenshots page afterviz ────────────────────
[Mobile Safari] › teia.screenshots.spec.ts:97:7 › screenshots page settings ────────────────────
18 passed (1.5m)

The ones that passed generated working screenshots 🥳

I'm on linux, so probably normal that I can't run those safari tests

@melMass
Copy link
Member Author

melMass commented Jan 31, 2024

Noice! Then I guess it will fail on the CI though... Maybe I can just conditionally add Webkit if not on linux I'll check it out in docker.

I should have added instructions to test all this, I will add more info to CONTRIBUTE.md or similar later but the TLDR is:

Storybook

  • usage:
    from the root of teia-ui, this should open a tab in your default browser to http://localhost:6006

    npm i # you must install dev deps you cannot use prod mode
    npm run storybook
  • what is this?:
    This is a very wip storybook workspace that I started during the grant (storybook was in a very beta transition back then), but thanks to that I was already using their new API so this PR doesn't change anything about that.

    storybook is just a way to show and document components in isolation, it's also nice to spot dependencies of a given component and if it's truly isolateable or not.
    For now it includes some of our core componenents (first load is slow that's normal, like vite can):

    demo

storybook+.webm

Playwright

  • usage:
    from the root of teia-ui, the first command will install isolated binaries for all browsers it supports to run the tests, the second one run the tests, the --ui flag is a new thing that's really cool and allow you to navigate all the navigation history as live webpages

    npx playwright install --with-deps
    npx playwright test --ui
  • what is this?:
    This is a framework for frontend testing / browser automation. In this repo we use it to take screenshots of various parts of the website, this was mainly a way to check all themes quickly in the most critical scenarios, it can be used when doing some global style change to make sure how it's affected on various browsers/devices.

There is a very strange and ugly scrollbar on
windows...
This commit styles it according to the theme,
check the PR body for screenshots of before/after
@melMass
Copy link
Member Author

melMass commented Feb 1, 2024

Latest commit fixes a style on windows detected thanks to playwright:

Before

image

After

image

still looks a bit sketchy but less than currently
@melMass melMass changed the title fix 🐛: use stable version of storybook fix 🐛: Update CI and tests Feb 1, 2024
@melMass
Copy link
Member Author

melMass commented Feb 1, 2024

gh workflow run playwright-compare.yml --ref fix/playwright-tests -f "before-commit=7f0d42ad23a9d2f4b1fdd7dc162f094c08478fca"

Where before-commit is the commit you want to test the current ref against. (you can provide after-commit too but it's optional)

this is needed to kick a workflow not in main
allow to fetch other refs than the current
as no artifacts are uploaded for now
missing commas :facepalm
@melMass
Copy link
Member Author

melMass commented Feb 1, 2024

Works!

side_by_side.zip

@melMass
Copy link
Member Author

melMass commented Feb 1, 2024

Ready to merge on my side!

Copy link
Contributor

@Zir0h Zir0h left a comment

Choose a reason for hiding this comment

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

awesome!

not working for org and we can't accept it anyway
@melMass melMass merged commit 50e7160 into main Feb 1, 2024
3 checks passed
@melMass melMass deleted the fix/playwright-tests branch February 1, 2024 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants