Skip to content

Migrate to Selenium 4, add Scala 3 - #131

Open
kubukoz wants to merge 14 commits into
scala-js:mainfrom
kubukoz:selenium-4
Open

kubukoz wants to merge 14 commits into
scala-js:mainfrom
kubukoz:selenium-4

Conversation

@kubukoz

@kubukoz kubukoz commented Oct 12, 2024 •

Copy link
Copy Markdown
  • Drops Scala 2.11 (more recent Scala.js versions don't support it)
  • Updates sbt and its plugins, as well as Scala patch versions, to allow building on modern hardware (apple silicon wasn't supported well in older releases)
  • DriverFactory from Selenium isn't a thing so we make our own
  • Requires Java 11 because Selenium does as well
  • A DriverFactory has to be provided explicitly by the user.

@gzm0 gzm0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for taking the time to open this PR.

The overall approach looks good to me. I have left some specific comments about the interface.

A general note: We try to keep changes as isolated as possible, so ideally, we do the Scala and sbt upgrades in different PRs.

Regarding the Scala upgrade: IIUC for a library it is better to stay on the lowest possible version to not force upgrades downstream, so maybe we shouldn't do them? (dropping Scala 2.11 is of course OK). Regarding Scala 3: I have to defer to @sjrd

Lastly, there seem to be some unrelated formatting stylistic changes. We also try to avoid these as much as possible to remove noise in the diffs. If you like, I can point them out individually.

Comment thread build.sbt Resolved
@kubukoz

kubukoz commented Oct 12, 2024

Copy link
Copy Markdown
Author

A general note: We try to keep changes as isolated as possible, so ideally, we do the Scala and sbt upgrades in different PRs.

Fair enough, I'll split.

Regarding the Scala upgrade: IIUC for a library it is better to stay on the lowest possible version to not force upgrades downstream, so maybe we shouldn't do them? (dropping Scala 2.11 is of course OK). Regarding Scala 3: I have to defer to @sjrd

As far as I understand, as long as it's under the same minor series (3.3, 2.13, 2.12) it should be fine to use a more recent version, even if users don't

Lastly, there seem to be some unrelated formatting stylistic changes. We also try to avoid these as much as possible to remove noise in the diffs. If you like, I can point them out individually.

That's alright, I'll go through the diff to make these unnecessary changes minimal. I did run scalastyle locally, it just didn't do anything :)

Thanks for your comments, I'll update the PR soon!

@kubukoz

kubukoz commented Oct 13, 2024

Copy link
Copy Markdown
Author

I couldn't keep the sbt upgrade separate as it's a prerequisite for me to literally launch sbt in the project in the first place. I could move it to a separate PR and make that the base of this one, but I'm not sure that's adding a lot of value in a project with such low traffic.

Instead, I've made it a separate commit (first one, so that the others could be rolled back independently if needed), does that work for you?

Also, new change: I didn't notice it before, but Selenium now requires JDK 11 (compiles to the classfile version 55.0), so I updated the PR description and the CI setup.

@kubukoz

kubukoz commented Oct 13, 2024

Copy link
Copy Markdown
Author

Also updated the README.

@kubukoz
kubukoz marked this pull request as ready for review October 13, 2024 23:04

@gzm0 gzm0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the long silence on this one. It slipped through the cracks.

There is only one nit, otherwise this LGTM to merge.

I've noticed that the CI didn't run, but I don't seem to have a button to approve it.

@sjrd do you have one? From the actions tab, it looks like you approved this last time.

@sjrd

sjrd commented Nov 17, 2024

Copy link
Copy Markdown
Member

Huh, no, I don't have a button to run the CI. Perhaps it was too long ago? A force-push might make it appear.

@kubukoz

kubukoz commented Nov 17, 2024

Copy link
Copy Markdown
Author

try now please :)

@sjrd

sjrd commented Nov 17, 2024

Copy link
Copy Markdown
Member

The CI did run, but it has failures.

Selenium 4 - Fix CI Issues
@kubukoz

kubukoz commented May 5, 2026 •

Copy link
Copy Markdown
Author

I pulled in @arashi01's changes (which I hadn't noticed until now, thanks!), we could try the job again, but seeing as Selenium isn't really the hit anymore, I'm not sure I want to invest any more time into upgrading this in whatever this was meant for. (probably going to use another js env, like playwright or whatever)

that said, feel free to run CI on this, at least we'll see if it's far off

Chrome headless was rejecting ESModule loads from file:// URLs.
Add --headless=new, --no-sandbox, --disable-dev-shm-usage and
--allow-file-access-from-files to ChromeOptions in tests.

Validate inputs eagerly in SeleniumRun so UnsupportedInputException
propagates synchronously, as required by scalajs-js-envs-test-kit 1.6.0.

Bump selenium-java 4.35.0 -> 4.43.0, scalajs-js-envs(-test-kit)
1.4.0 -> 1.6.0, sbt-scalajs 1.20.1 -> 1.21.0, sbt-mima-plugin
1.1.4 -> 1.1.5, sbt 1.11.5 -> 1.12.11, Scala 2.12.20 -> 2.12.21
and 2.13.16 -> 2.13.18 (required by scalajs-js-envs 1.6.0 per SIP-51).
@kubukoz

kubukoz commented May 7, 2026

Copy link
Copy Markdown
Author

🤞

@kubukoz

kubukoz commented May 7, 2026

Copy link
Copy Markdown
Author

CI green!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants