You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "ExuApplePie (via GitHub)" <gi...@apache.org> on 2025/11/26 18:02:23 UTC
[PR] feat: up to date docs screenshots with playwright [superset]
ExuApplePie opened a new pull request, #36297:
URL: https://github.com/apache/superset/pull/36297
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
This PR includes new functionality to run a suite of tests using Playwright in order to take screenshots of the UI so that the docs will have up to date screenshots.
The first changes made are to the `playwright.config.ts` along with a new fijle `auth.setup.ts`. Using these two files, I defined two new projects so that our tests do not need to go through the login screen every time. For the authentication setup, I just hard coded the default admin/admin login as I was not sure if there is an env variable to handle this. The authentication is then stored in `\superset\superset-frontend\playwright\.auth`, which was also added to the `.gitignore`. Then our second project from the config file is set to depend on the auth file, so it is always run before our project. In addition, I set a `testMatch` and `testIgnore` property, so that only these tests will use the authentication, and the already existing E2E tests will still have the functionality to test login.
The 'tests' that take the screenshots are written in `\superset\superset-frontend\playwright\tests\docs\docs-screenshots.spec.ts`. Each test navigates to the content I want to screenshot, sometimes may zoom out for a nicer screenshot, then will wait a a few seconds to ensure the page has fully loaded, then finally will take a screenshot as a JPEG and save it to `\superset\docs\static\img\screenshots` folder.
The tests try to use locators that are easy to read/understand, and are resilient to changes. For example, instead of using a CSS path, I try to locate a combobox with some name property. I used the non-development environment for these screenshots. It also seemed like some of the locators didn't exist in the development version of Superset. Please do note that if there are major UI overhauls, it is likely that these tests will have to be re-written.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
N/A
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
Aside from verifying the files exist at the paths mentioned earlier, you can run the tests by using the command `npx playwright test --project=chromium-authenticated` in the superset-frontend directory.
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: up to date docs screenshots with playwright [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #36297:
URL: https://github.com/apache/superset/pull/36297#issuecomment-4653784784
This was superseded by #40859 37494, so we'll close it out... thank you for being an important part of the project, and paving the way with this work to prove the concept!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: up to date docs screenshots with playwright [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #36297:
URL: https://github.com/apache/superset/pull/36297#issuecomment-3582586521
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: up to date docs screenshots with playwright [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #36297:
URL: https://github.com/apache/superset/pull/36297#issuecomment-3720208484
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 71f7903c7cc53bfad025b42e20f10387ee71d165 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/695ea65de790b80009bbf1cb |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-36297--superset-docs-preview.netlify.app](https://deploy-preview-36297--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-36297--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: up to date docs screenshots with playwright [superset]
Posted by "ExuApplePie (via GitHub)" <gi...@apache.org>.
ExuApplePie commented on PR #36297:
URL: https://github.com/apache/superset/pull/36297#issuecomment-3605316568
Thanks for the feedback, I added the licensing header to the top of the two files and also installed pre commit and used it for the commit to add the header.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: up to date docs screenshots with playwright [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #36297:
URL: https://github.com/apache/superset/pull/36297#issuecomment-3604436627
Looks like pre-commit needs to be run, and we have some licensing header failures on:
* superset-frontend/playwright/tests/auth.setup.ts
* superset-frontend/playwright/tests/docs/docs-screenshots.spec.ts
For the headers, you can copy/paste them from the top of other ts files. For the pre-commit stuff:
Superset uses Git pre-commit hooks courtesy of [pre-commit](https://pre-commit.com/). To install run the following:
```
pip3 install -r requirements/development.txt
pre-commit install
```
A series of checks will now run when you make a git commit.
Alternatively it is possible to run pre-commit by running pre-commit manually:
```
pre-commit run --all-files
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: up to date docs screenshots with playwright [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed pull request #36297: feat: up to date docs screenshots with playwright
URL: https://github.com/apache/superset/pull/36297
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org