-
Notifications
You must be signed in to change notification settings - Fork 220
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
feat(build): add mage dagger:run generate:screenshots #1868
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1868 +/- ##
==========================================
- Coverage 71.64% 71.45% -0.19%
==========================================
Files 58 63 +5
Lines 5501 6093 +592
==========================================
+ Hits 3941 4354 +413
- Misses 1335 1491 +156
- Partials 225 248 +23
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
ui/screenshot.js
Outdated
|
||
const browser = await chromium.launch({ headless: true }); | ||
const context = await browser.newContext({ | ||
viewport: { width: 1280, height: 720 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdyt about increasing the resolution to something like viewport: { width: 1600, height: 1200 }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or maybe 1440x900
? I think thats the resolution I've been using when taking screenshots in Chrome for docs images (have a custom emulated device in the browser setup)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ill give it a go. When I did it locally I got some rather zoomed out shots at higher res. Ill paste here what that gives me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could rebase this onto main
right since there doesn't seem to be anything eval-v2 specific
?
fdf71fa
to
acd312b
Compare
This PR currently has a merge conflict. Please resolve this and then re-add the |
acd312b
to
b4a324c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really cool
* main: feat(build): add mage dagger:run generate:screenshots (#1868) chore(deps-dev): bump eslint from 8.43.0 to 8.45.0 in /ui (#1878) chore(deps-dev): bump postcss from 8.4.24 to 8.4.26 in /ui (#1877) chore(deps-dev): bump @playwright/test from 1.35.1 to 1.36.1 in /ui (#1880) chore(deps-dev): bump tailwindcss from 3.3.2 to 3.3.3 in /ui (#1876) chore(deps-dev): bump eslint-config-airbnb-typescript in /ui (#1879) chore(deps): bump github.com/hashicorp/cap from 0.3.1 to 0.3.2 (#1875) chore(deps): bump github.com/go-chi/chi/v5 from 5.0.8 to 5.0.10 (#1874) chore: remove refs to deprecated io/ioutil (#1867) chore(deps-dev): bump @types/react-dom from 18.2.5 to 18.2.7 in /ui (#1864) chore(deps-dev): bump jest and @types/jest in /ui (#1851) chore(github): move all db unit tests to dagger (#1869) chore(deps): bump semver from 6.3.0 to 6.3.1 in /examples/nextjs (#1861)
Fixes FLI-493
This adds the new mage target:
mage dagger:run generate:screenshots
.Currently, for this pass it only defines the screenshots for the
Getting Started
page.The purpose of this target is to aid in re-generating documentation screenshots as and when we make releases.
The dagger pipeline does the following:
ui/screenshot/
for.js
files.ui/screenshot/fixtures
.Each of these files uses a utility defined in
ui/screenshot.js
.This script exports a single function
capture
which takes a name and a function which operates over a playwright page.Here is the create_constraint screenshot definition:
flipt/ui/screenshot/create-contraint.js
Lines 1 to 16 in 731b718
The
name
parameter passed tocapture
is leveraged in two way.create_constraint.png
).fixtures/create_constraint.yml
).When run from the root of the flipt repository
mage dagger:run generate:screenshots
will output a directoryscreenshots
in the root of the project.You can always run flipt yourself and then do the following to experiment with a single screenshot generator:
cd ui node screenshot/create-constraint.js