dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.32k stars 9.97k forks source link

Can we drop Sellenium? #15949

Closed galvesribeiro closed 4 years ago

galvesribeiro commented 6 years ago

Hello all,

As pointed to @danroth27 on Gitter, I think Sellenium is too much of a friction to get set up and working and that blocks people to contribute more as they have to install Java and its friends and not to mention it has to be kept running.

So, my suggestion was to use a modern and simpler framework for E2E tests and I have two to suggest:

  1. https://www.cypress.io/ -> would be a good alternative that is simple to install and easy to code the tests
  2. http://phantomjs.org/ -> could be used as the core headless browser so any widely used test framework like Jasmine, QUnit, Mocha, Capybara, WebDriver, etc. could be used.

I'm all for the first option as it makes contributions easier.

That is for E2E tests. Unit tests would still be ran in C#.

What the others on the team think? Is a PR acceptable with that?

MovGP0 commented 6 years ago

Cypress isn't free software and the PhantomJS repository is archived. Both is not optimal.

SIkebe commented 6 years ago

Archiving the project: suspending the development https://github.com/ariya/phantomjs/issues/15344

PhantomJS Is Dead, Use Chrome Headless in Continuous Integration https://semaphoreci.com/blog/2018/03/27/phantomjs-is-dead-use-chrome-headless-in-continuous-integration.html

RemiBou commented 6 years ago

I absolutely agree but there is AFAIK no better alternative. Maybe you could drop the selenium standalone part. All the alternative are still based on selenium (like http://nightwatchjs.org)

I found https://www.cypress.io/ it might be worth testing it

SteveSandersonMS commented 6 years ago

I also agree that Selenium is inconvenient to set up. Unfortunately like others have pointed out, we don't have clear better alternatives.

Regarding cypress.io, we don't have a strong enough reason to take a bet on that any time soon. It would force us to rewrite all our E2E tests in TypeScript/JS, is not a free OSS product, is still in beta, has not been extensively battle-tested like Selenium is, and doesn't have broadly-established developer mindshare.

One small improvement we could make would be automating the startup and shutdown of selenium-standalone when the E2E tests run. That doesn't fix the installation inconvenience but helps with the day-to-day inconvenience.

I'll leave this issue open for a few days for visibility.

galvesribeiro commented 6 years ago

Absolutely there will need to be a rewrite of E2E tests and I’m ok doing that if that is the path.

I didnt noticed phantonjs has been abandoned.

Regarding Cypress, it is free for OSS projects forever. The only thing paid there will be the dashboard services only for closed source projects. And yes, it is open source as well.

It is a descent alternative.

Automate selenium startup still not ideal IMHO...

SteveSandersonMS commented 6 years ago

Thanks for the suggestion. However, we're not going to take a dependency on Cypress at this point for the reasons given above. Sorry!

SteveSandersonMS commented 6 years ago

I'll close this as we don't have any immediate plans to replace Selenium.