Join us at DrupalCon Singapore from 9-11 December 2024, for three exciting days of Drupal content, training, contributions, networking, and the inaugural DrupalCon Splash Awards! Be part of this landmark event as we celebrate and expand Drupal's impact across Asia.
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
Issue fork test_helpers-3469602
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
Comment #4
murzAdded 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
.Comment #7
murz