News for hackers. Stuff that matters.
Re:Minimal APIs at a glance in .NET 6 by tester34 on Monday September 13, 2021 @10:05AM (#28511657)
For Selenium tests I've been setting up an actual instance of application in test with different Startup (e.g sqlite instead of real database) and running at different port

This way you can test those fancy things, but I agree it's kinda "hard" to get it working for the first time

Re:Minimal APIs at a glance in .NET 6 by Jenk on Monday September 13, 2021 @10:22AM (#28511864)
and wasteful. Starting up selenium et al is painfully slow compared to tests that run in <seconds.
Re:Minimal APIs at a glance in .NET 6 by tester34 on Tuesday September 14, 2021 @04:43AM (#28521953)
While I do agree, then you don't have to run Selenium tests on your PC, but let it be done by e.g ci/cd

Also depends how many pages do you want to test with Selenium - if you want to test e.g 5 pages, then it'll be fast enough I guess.

There are a few tricks/configurations that make Selenium significantly faster - https://stackoverflow.com/a/57720610

A lot of is also on how do you write your "testing infrastructure" - maybe you could reuse engine/browser instance? execute tests parallelly?

There's also alternative to Selenium by Microsoft: https://github.com/microsoft/playwright

AFAIK it's way more reliable than Selenium (false errors)

__________

Overall you can still start application inside tests with different startup, without Selenium and send http requests, so you'll have end-to-end tests done fast.

Re:Minimal APIs at a glance in .NET 6 by Jenk on Tuesday September 14, 2021 @11:09AM (#28526015)
Relying on CI server to run tests is even slower :) Note I am not stating "don't use CI" as that is still an invaluable tool.

The waste I am referring to is time it takes to get that feedback whilst the work is being actively developed.

A simple feature of a controller (to borrow someone else's example) is to change the response based on an attribute's configuration. It is wholly astonishing that one needs a _web-server_ to test that.