Function
Description
createRandomString(length)
Return a string of random characters of specified length.
createRandomUser()
Return a user object with random name, email, and password.
createUserWithUserObject(user, roles, args, options)
Create a user via Drush using a JSON user object. See qaUsers.json for the definition. TODO: cy.exec is failing to capture the result of user:create, which should provide the UID. See issue: https://github.com/drush-ops/drush/issues/5660
(async) deleteCurrentNodeViaUi(page) → {Promise.<void>}
Delete currently opened node.
(async) deleteNodeViaUiWithNid(page, context, nid)
Delete node via UI given a nid.
deleteNodeWithNid(nid) → {string}
Delete node via drush with a given nid.
deleteUserWithEmail(email, optionsopt) → {void}
This function uses Drush to delete a user account based on the given email address. It includes a workaround for a Drush issue where the --mail option requires an argument.
deleteUserWithUid(uid, optionsopt) → {string}
This function uses Drush to delete a user account based on the given Drupal user ID. It automatically includes the '--delete-content' option to remove user content along with the account. A workaround is implemented due to a Drush issue where the --uid option requires a name argument.
deleteUserWithUserName(userName, argsopt, optionsopt) → {string}
Deletes a Drupal user using Drush command. This function executes a Drush command to delete a user from a Drupal site. It uses the `user:cancel` Drush command with the `-y` option for automatic confirmation.
execDrush(cmd, args, options) → {string}
Run drush command locally or remotely depending on the environment. Generally you'll use this function and let it figure out how to execute Drush (locally, remotely, native OS, inside container, etc.).
execPantheonDrush(cmd) → {string}
Run a Pantheon Drush command via Terminus. Called by execDrush().
execViaSsh(cmd) → {string}
Run a command via SSH.
(async) expectEmail(mailto, subject) → {Promise.<void>}
Assert that email has been received to the given address and subject. It is done with one of mail capture software which is configured in atkConfig. If it's not configured, email verification is skipped.
(async) expectMessage(page, text) → {Promise.<void>}
Assert presence of a message with given text on the page.
getDrupalConfiguration(objectName, key) → {*}
Get Drupal configuration via drush.
getDrushAlias() → {string}
Returns Drush alias per environment. Adapt this to the mechanism that communicates to the remote server.
(async) getMid(imageLocator) → {Promise.<string>}
Extract the media id that was added by automated_testing_kit_preprocess_image().
(async) getNid(page) → {Promise.<number>}
Extract the nid placed in the body class by this hook: automated_testing_kit.module:automated_testing_kit_preprocess_html().
getProperty(object, key) → {*}
Get multi-level property from an object. E.g. if object is {"foo":{"bar":"buzz"}} and key is "foo.bar", "buzz" will be returned. If key at some level does not exist, null is returned.
getUidWithEmail(email) → {number}
Return the UID of a user given an email.
getUsernameWithEmail(email) → {string}
Return the Username of a user given an email.
(async) inputTextIntoCKEditor(page, text, instanceNumberopt) → {Promise.<void>}
Inputs text into a specific CKEditor instance on a Playwright-controlled page. This function waits for CKEditor elements to be present on the page, then attempts to input the provided text into the specified editor instance. If no instance number is provided, it defaults to the first editor found.
(async) logInViaForm(page, context, account)
Log in via the login form.
(async) logInViaUli(page, context, uid)
Log in with user:login given a user id.
(async) logOutViaUi(page)
Log out user via the UI.
readYAML(filename) → {object}
Read data from a YAML file located in tests/data.
setDrupalConfiguration(objectName, key, value)
Set Drupal configuration via drush.