vaadin / testbench

Vaadin TestBench is a tool for automated user interface testing of Vaadin applications.
https://vaadin.com/testbench
Other
20 stars 22 forks source link

Use Playwright #1731

Open mvysny opened 8 months ago

mvysny commented 8 months ago

Yes this is quite a tall order. However, Playwright simply works - it downloads the browser distribution, the appropriate driver for your OS, all this behind the scenes, automatically on first start, without any need for a Maven plugin. I don't have to do anything, and the test just works. I quite like that. Opposed to that, Selenium is always broken on my Linux box - always missing a driver or a browser, or the browser is not compatible with the driver, or the driver just fails for no apparent reason. I have to figure out where to download the browser and the appropriate driver, then how to set the paths to Selenium Driver to finally make Selenium work. Then this breaks upon next browser upgrade/OS upgrade/something changes. Selenium feels extremely fragile and very hard to set up, at least on a Linux box. I think it's time to ditch this broken piece of technology and replace it with something much more solid.

Artur- commented 8 months ago

Selenium downloads and uses the correct webdriver automatically through its Selenium Manager since maybe a year or so. Does it not work on Linux?

mvysny commented 8 months ago

Apparently not. Fails for Firefox installed via snap (the default in Ubuntu) with

WARNING: The geckodriver version (0.33.0) detected in PATH at /snap/bin/geckodriver might not be compatible with the detected firefox version (122.0); currently, geckodriver 0.34.0 is recommended for firefox 122.*, so it is advised to delete the driver in PATH and retry

No, I'm not going to delete the geckodriver that comes from the Firefox snap. Sure it might be outdated, but Selenium should download the right one.

With Chromium it's even worse: Chromium starts but sits there and does nothing: image After a while the test fails:

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: DevToolsActivePort file doesn't exist 

Basically I'm unable to run Selenium on Ubuntu 23.10.

TatuLund commented 8 months ago

@mvysny You might have better luck with web driver manager

https://github.com/TatuLund/bean-table/blob/v24/pom.xml#L104

https://github.com/TatuLund/bean-table/blob/v24/src/test/java/org/vaadin/tatu/AbstractViewTest.java#L48

mshabarov commented 7 months ago

For reference https://vaadin.com/blog/testing-vaadin-applications-and-add-ons-using-playwright.