Hi Akshara, nice work on converting the I18nSeleniumTests to Playwright!
I’m curious about your experience with the migration — did you run into any
challenges with how Django’s current test infrastructure (like `LiveServerTestCase`
or `StaticLiveServerTestCase`) works with Playwright vs Selenium?
I ask because I’ve been working on keyboard shortcut tests for the Django admin
using Selenium (`AdminSeleniumTestCase`), and testing keyboard events has been
tricky. If Playwright handles keyboard simulation better, that could be a big win
for the admin’s accessibility testing too.
Regarding LiveServerTestCase vs StaticLiveServerTestCase with
Playwright — this is actually one of the key integration points
I am researching for my proposal.
Currently Django’s SeleniumTestCase inherits from
StaticLiveServerTestCase, which serves static files during tests.
My plan is to create a PlaywrightTestCase base class that similarly
inherits from StaticLiveServerTestCase, exposing self.page instead
of self.selenium.
Regarding keyboard simulation — you are right, Playwright handles
keyboard events much better than Selenium. Playwright has built-in
methods like page.keyboard.press(“Tab”) and page.keyboard.type()
which are more reliable than Selenium’s send_keys(). This would
definitely benefit AdminSeleniumTestCase keyboard tests too.
I will keep this in mind as I work on the PlaywrightTestCase base
class design. Looking forward to sharing my proposal!