Problem/Motivation

It would be great to add helpers to speed up Nightwatch tests to install modules, create users, etc, as a workaround for the issue #3464642: [PP-1] Provide PHP helpers for Nightwatch tests to speed up routine operations

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

murz created an issue. See original summary.

  • murz committed 9bbd3521 on 1.5.x
    Issue #3469602 by murz: Add helpers for Nightwatch tests to install...
murz’s picture

Status: Active » Fixed

Added API endpoints and helper commands for Nightwatch:

  • thCreateUser(): Creates a new user, with optionally adding permissions and log-in.
  • thLogin(): Performs a login for the given user.
  • thInstallModules(): Installs one or several modules at once, optionally with dependencies.
  • thUninstallModules(): Uninstalls one or several modules at once.
  • thSetEnvs(): Sets the environment variables on the Drupal side.
  • thGetEnv(): Gets the environment variable value from the Drupal side.

Those functions perform actions on the Drupal side, and work many times faster, than Drupal Core alternatives (drupalInstall(), drupalCreateUser(), etc).

See the usage examples in the included self-tests in the directory tests/modules/test_helpers_functional/tests/src/Nightwatch/Tests.

  • murz committed 365d3ec2 on 1.5.x
    Issue #3469602 by murz: Add helpers for Nightwatch tests to install...
murz’s picture

Status: Fixed » Closed (fixed)