5 ms·
I'm really excited by what Playwright has been up to on the python side recently with the pytest-playwright package. Browser-testing a Django app can be as simp
by JackC 6y ago
I'm really excited by what Playwright has been up to on the python side recently with the pytest-playwright package. Browser-testing a Django app can be as simple as:
def test_homepage(live_server, page):
page.goto(live_server.url)
assert page.innerText('#splash-quote') == 'our splash-quote'
$ pytest -k test_homepage --browser chromium --browser firefox --verbose
tests/test_browser.py::test_homepage[chromium] PASSED [ 50%]
tests/test_browser.py::test_homepage[firefox] PASSED [100%]
- WalterGR 6y agoIt’s been some time since I’ve used Selenium, but I don’t remember it being any more complicated than that to test arbitrary websites. What is that code doing that’s special?
- sharmi 6y agoNot OP. For one thing, Selenium was not super reliable, at least for me, especially when trying to run multiple instances. Do note that I used the official docker swarm method. When I was exploring that option, Playwright was still windows only. Super excited to see it is available on Linux and Mac.
- arjun27 6y agoPlaywright has always supported all platforms: Win, Linux and Mac. Is there something that didn’t work for you?
- sharmi 6y agoMaybe it didn't have python support? Sorry, I may have misremembered. I do remember something missing that I couldn't use it in my existing dev setup. As solo developer, I prefer to keep my dependencies minimal, mostly python.
- samdamsamma 6y agoIt would be neat if I could get coverage from these tests using python, but other than that I agree. Playwright is great.