Protractor is deprecated; use nightwatch instead for e2e tests

Bug #1989195 reported by Jane Sandberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned

Bug Description

In Angular 12, protractor is deprecated: https://blog.angular.io/the-state-of-end-to-end-testing-with-angular-d175f751cb9c

It will reach EOL in Summer 2023.

It shouldn't be too burdensome to move to another e2e framework, since we never added too many e2e tests in the first place. At first glance, it seems like nightwatch would be a good option, since it is widely used and doesn't require X11 to be running.

Revision history for this message
Jane Sandberg (sandbergja) wrote (last edit ):

Here is a PR that removes protractor, adds in nightwatch, and adds a handful of e2e tests for the angular client: user/sandbergja/lp1989195_nightwatch_over_protractor

There are various notes about the new e2e tests here: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=commitdiff;h=38426cffd9cfbf182be312867de768a96f203ea6#patch2

Long story short, you will need firefox installed. Then cd into the eg2 directory and run `npm i`. If you have a GUI, run `ng e2e`; if not, run `MOZ_HEADLESS=1 ng e2e`.

tags: added: pullrequest
Changed in evergreen:
importance: Undecided → Medium
assignee: Jane Sandberg (sandbergja) → nobody
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Another note: if and when this is merged, it would be lovely to get it set up in buildbot.

Revision history for this message
Jane Sandberg (sandbergja) wrote (last edit ):

Force pushed a handful of changes:

* Simplifying the config file thanks to https://github.com/DefinitelyTyped/DefinitelyTyped/pull/62249
* change the test's file extension from _spec.ts to .spec.ts to match the unit tests
* make a flakey test less flakey

Revision history for this message
Jane Sandberg (sandbergja) wrote :

Rebased this, and made it compatible with evergreen servers that don't have this patch installed.

To try it out on an arbitrary server (say, demo.evergreencatalog.com), you can change the launch_url setting in Open-ILS/src/eg2/nightwatch.conf.js.

Here is a link: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/sandbergja/lp1989195_nightwatch_over_protractor

Bill Erickson (berick)
Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
status: New → Confirmed
Revision history for this message
Bill Erickson (berick) wrote :

Branch worked well for me, minus known test failures, both headless and on my desktop, talking to a local dev VM.

Here's another branch:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1989195-angular-nightwatch

* Sign-off for Jane's commit.
* Adds a commit to support optionally running e2e tests in Chrome.

Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks for the review and Chrome addition, Bill! I signed off on your commit, and added a third commit to this branch to remove that flakey test: user/sandbergja/lp1989195-angular-nightwatch-2

summary: - Protractor is deprecated
+ Protractor is deprecated; use nightwatch instead for e2e tests
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Just force-pushed an amended commit: the ngbnav work has caused some DOM selectors to change, so I updated those in the nightwatch tests.

Changed in evergreen:
milestone: none → 3.11-beta
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Another rebased branch: user/sandbergja/lp1989195-angular-nightwatch-3

Revision history for this message
Galen Charlton (gmc) wrote :

I've pushed this down rel_3_11. Thanks, Bill and Jane!

I also added a follow-up to add an explicit chrome-headless mode. Interestingly, there are a couple test failures with that mode (on Chromium 90) that pass in Firefox, with elements not becoming clickable or visible in time. However, I decided to weigh getting this in sooner rather than later; perhaps the Chrome e2e tests can be considered experimental for now.

Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.