unic / ScalaWebTest

ScalaWebTest is a library for writing ScalaTest/Selenium based integration tests for web applications. It helps you with your basic setup and provides a new and very efficient approach to testing.
https://scalawebtest.org
Apache License 2.0
29 stars 9 forks source link

Update ScalaTest to 3.1.0 #108

Closed exoego closed 4 years ago

exoego commented 4 years ago

Closes #106

claassistantio commented 4 years ago

CLA assistant check
All committers have signed the CLA.

exoego commented 4 years ago

https://travis-ci.org/unic/ScalaWebTest/jobs/650286515#L18177

info] org.scalawebtest.integration.gauge.VariablesInGaugeDefinitionSpec ABORTED

[info] The code passed to eventually never returned normally. Attempted 231 times over 5.003468278000001 seconds. Last failure message: Javascript is not enabled for this HtmlUnitDriver instance. (Login.scala:63)

Any help ? 🤔

DaniRey commented 4 years ago

Thank you for that valuable PR, you just made my day. I'll look into the issue next week.

DaniRey commented 4 years ago

The problem is caused by https://github.com/scalatest/scalatest/commit/15290627f49c0cdbabcd2ca08dbfaa5d48209759

Due to this change, changing the value of a org.scalatestplus.selenium.WebBrowser.ValueElement requires JavaScript to be enabled, for all WebDrivers, that could execute JavaScript.

@exoego Enabling JavaScript during HtmlUnitDriver initialization is not possible, as it is managed by the loginConfig.

I anyway think we should not force our users to activate JavaScript during login, when using org.scalawebtest.core.FormBasedLogin. HtmlUnit is not the most reliable thing to execute JavaScript, as it is based on Rhino.

I will raise an issue with scalatestplus-selenium to understand why they made that change. One option which we have, would be to use

      click on username_fieldname
      emailField(username_fieldname).underlying.sendKeys(username)
      click on password_fieldname
      pwdField(password_fieldname).underlying.sendKeys(password)

in org.scalawebtest.core.FormBasedLogin

DaniRey commented 4 years ago

I opened https://github.com/scalatest/scalatestplus-selenium/issues/10

exoego commented 4 years ago

@DaniRey Applied the workaround and now CI is all green !!

DaniRey commented 4 years ago

@exoego Great and thank you.

Let's wait for feedback on scalatest/scalatestplus-selenium#10 before proceeding with this PR. I want to avoid having an issue in ScalaWebTest, which ScalaTest solved when using JavaScript to check the current value of a form field. As soon as we understand the motivation behind this change, we can make an informed decision.

exoego commented 4 years ago

Closing since superseded by #111