Skip to content

Conversation

@ExuApplePie
Copy link

@ExuApplePie ExuApplePie commented Nov 26, 2025

SUMMARY

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 file 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

N/A

TESTING INSTRUCTIONS

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

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

SheepStar02 and others added 2 commits November 28, 2025 00:15
fix(playwright docs): optimize playwrights docs test
@pull-request-size pull-request-size bot added size/M and removed size/L labels Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants