Problem/Motivation

Branched from #2885127: Refactor tests as Unit and Functional.

Nightwatch documentation for contrib. is very sparse. And my previous efforts failed to get a Nightwatch test running on drupalci (let alone locally because chromedriver is required).

Proposed resolution

  1. Get a test working on drupalci
  2. See what needs to happen to make it work for geckodriver locally

Remaining tasks

  • Start with what I had before
  • Fix

Comments

mradcliffe created an issue. See original summary.

mradcliffe’s picture

Status: Active » Needs review
StatusFileSize
new6.38 KB

Old patch refactored to remind myself what it was doing before.

mradcliffe’s picture

Tries to install config for nodes manually?

mradcliffe’s picture

Confirmed that testing profile is the one in-use so we do need to create content types ourselves.

Let's see if this will work. It didn't work in ddev, but I may not have nightwatch setup correctly. Ugh, it's a pain.

mradcliffe’s picture

Okay, this should get the site installed with node + configuration enough to run a test.

But it still fails. I've tried going to /admin/structure/types/manage/page/form-display and confirming that the field is in the Content region and even saving it again, but it won't show up on /node/add/page. :|

testing profile sure doesn't make it easy to test.

mradcliffe’s picture

This patch only adds debug data because it's not possible to get screenshots yet and I can't run anything locally because my chromium is too old and chromium is worse than firefox at compiling.

Hope my debug statements work!

mradcliffe’s picture

Nope. PHPStorm decided to not give the actual API because it was guessing and not sure :|

Maybe manually adding a screenshot will just show up?

mradcliffe’s picture

Status: Needs review » Postponed

I give up again. It's taking too much of my time to figure out how to get Nightwatch to debug anything.

mradcliffe’s picture

Status: Postponed » Needs review
StatusFileSize
new9.02 KB
new5.52 KB

All this patch does is re-order things so I don't expect anything since it was still failing locally yesterday. The form display some how either isn't being saved (it is, I can confirm it in the admin ui) or something else is utterly broken with the testing profile.

I don't find Nightwatch, the testing profile and the hard-coded use of chromedriver very easy to use with Drupal. It is not obvious how I can debug, console.log debug, screenshot debug, print_r debug without running out of memory. Documentation is still very sparse about how to get something actually working. I thought I found a core bug, but then it wasn't broken on the test bot so all I can think is that Nightwatch, like protractor, is very brittle.

mradcliffe’s picture

Worked up on testing infrastructure. Sigh. I guess that's enough for a "working Nightwatch test" for some regression testing.

  • mradcliffe committed cb6e32d on 8.x-1.x
    Issue #3070113 by mradcliffe: Adds a Nightwatch test for asserting basic...
mradcliffe’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.