Test actions
Actions in the Functional Testing Framework allow you to automate different scenarios of Adobe Commerce or Magento Open Source user's actions. They are mostly XML implementations of Codeception actions. Some actions drive browser elements, while others use REST APIs.
Common attributes
All <actions> contain the following attributes that are useful for merging needs.
stepKey
stepKey is a required attribute that stores a unique identifier of the action.
Example test step of the myAction action with the conditionalClickStep1 identifier:
<myAction stepKey="conditionalClickStep1"/>
This step can be referenced within the test using conditionalClickStep1.
The value format should met the following principles:
-
Must be unique within
<test>. -
Naming should be as descriptive as possible:
- Describe the action performed.
- Briefly describe the purpose.
- Describe which data is in use.
-
Should be in camelCase with lowercase first letter.
-
Should be the last attribute of an element.
before and after
before and after are optional attributes that insert the action into the test while merging. The action will be executed before or after the one set in these attributes. The value here is the stepKey of reference action.
Example with before:
<myAction before="fillField" stepKey="conditionalClickStep1"/>
myAction will be executed before the action, which has stepKey="fillField".
Example with after:
<myAction after="fillField" stepKey="seeResult"/>
myAction will be executed after the action, which has stepKey="fillField".
Examples
The following example contains four actions:
-
<amOnPage url="{{StorefrontCustomerSignInPage.url}}" stepKey="amOnSignInPage"/> <fillField userInput="$$customer.email$$" selector="{{StorefrontCustomerSignInFormSection.emailField}}" stepKey="fillEmail"/> <fillField userInput="$$customer.password$$" selector="{{StorefrontCustomerSignInFormSection.passwordField}}" stepKey="fillPassword"/> <click selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}" stepKey="clickSignInAccountButton"/>
1. Open the Sign In page for a customer
<amOnPage url="{{StorefrontCustomerSignInPage.url}}" stepKey="amOnSignInPage"/>
The Customer Sign In page is declared in the .../Customer/Page/StorefrontCustomerSignInPage.xml file. The given relative URI is declared in StorefrontCustomerSignInPage.url.
Source code (StorefrontCustomerSignInPage.xml ):
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="StorefrontCustomerSignInPage" url="/customer/account/login/" module="Magento_Customer">
<section name="StorefrontCustomerSignInFormSection" />
</page>
</config>
<amOnPage> is an action that opens a page for a given URI. It has a key "amOnSignInPage" that will be used as a reference for merging needs in other modules. This action uses the url attribute value for the given relative URI to open a browser page. Here, url contains a pointer to a url attribute of the StorefrontCustomerSignInPage.
2. Enter a customer's email
<fillField userInput="$customer.email$" selector="{{StorefrontCustomerSignInFormSection.emailField}}" stepKey="fillEmail"/>
<fillField> fills a text field with the given string.
The customer's email is stored in the email parameter of the customer entity created somewhere earlier in the test using a <createData> tag. userInput points to that data.
selector points to the field where you enter the data. A required selector is stored in the emailField element of the StorefrontCustomerSignInFormSection section.
This section is declared in .../Customer/Section/StorefrontCustomerSignInFormSection.xml file:
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontCustomerSignInFormSection">
<element name="emailField" type="input" selector="#email"/>
<element name="passwordField" type="input" selector="#pass"/>
<element name="signInAccountButton" type="button" selector="#send2" timeout="30"/>
</section>
</config>
3. Enter a customer's password
<fillField userInput="$customer.password$" selector="{{StorefrontCustomerSignInFormSection.passwordField}}" stepKey="fillPassword"/>
This <action> is very similar to the <action> in a previous step. The only difference is that different data is assigned to the attributes, which set a field with a password.
4. Click the Sign In button
<click selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}" stepKey="clickSignInAccountButton"/>
Here, <click> performs a click on a button that can be found by the selector that is stored in the signInAccountButton of the StorefrontCustomerSignInFormSection.
Actions returning a variable
The following test actions return a variable:
- grabAttributeFrom
- grabCookie
- grabCookieAttributes
- grabFromCurrentUrl
- grabMultiple
- grabPageSource
- grabTextFrom
- grabValueFrom
- executeJS
- getOTP
- return
Learn more in Using data returned by test actions.
Actions handling data entities
The following test actions handle data entities using metadata:
Learn more in Handling a REST API response.
Actions specifying HTML values
To use HTML in actions you must encode the HTML string. We recommend using CyberChef. Using CyberChef or a similar tool is straightforward: enter in your HTML string, copy the encoded result, and paste that value into your test.
For example, we want to ensure that this value is presented as a string and not rendered as a H1 tag: <h1 class="login-header">
After passing <h1 class="login-header"> through CyberChef we get <h1 class="login-header"> which can be used in a test like:
<dontSeeInSource html="<h1 class="login-header">" stepKey="dontSeeInSource"/>
Reference
The following list contains reference documentation about all action elements available in the MFTF. If the description of an element does not include a link to Codeception analogue, it means that the action is developed by ADobe for specific Functional Testing Framework needs.
acceptPopup
Accepts the current popup visible on the page.
See acceptPopup docs on codeception.com.
stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Accept the current popup visible on the page. -->
<acceptPopup stepKey="acceptPopup"/>
amOnPage
Opens the page by the URL relative to the one set in the MAGENTO_BASE_URL configuration variable.
See amOnPage docs on codeception.com.
urlMAGENTO_BASE_URL.stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Open the `(baseURL)/admin` page. -->
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="goToLogoutPage"/>
amOnSubdomain
Takes the base URL and changes the subdomain.
See amOnSubdomain docs on codeception.com.
urlstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
Precondition: the current base URL is https://www.magento.com.
<!-- Change the sub-domain to `https://devdocs.magento.com`. -->
<amOnSubdomain url="devdocs" stepKey="changeSubdomain"/>
<!-- Open the page `https://devdocs.magento.com` -->
<amOnPage url="/" stepKey="goToDataPage"/>
amOnUrl
Opens a page by the absolute URL.
See amOnUrl docs on codeception.com.
urlstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Set url to be used in the next steps to https://www.magento.com/ -->
<amOnUrl url="https://www.magento.com/" stepKey="amOnUrl"/>
appendField
See appendField docs on codeception.com.
selectoruserInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Append the "Sample Text" string to the selected input element -->
<appendField userInput="Sample Text" selector="input#name" stepKey="appendSuffix"/>
attachFile
See attachFile docs on codeception.com.
selector<input type="file">).userInputtests/_data directory.stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Upload a file from the `tests/_data` directory with the `image.png` name to the selected input element. -->
<attachFile userInput="image.png" selector="input#imgUpload" stepKey="uploadFile"/>
cancelPopup
See cancelPopup docs on codeception.com.
stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Cancel the current popup visible on the page. -->
<cancelPopup stepKey="cancelPopup"/>
checkOption
See checkOption docs on codeception.com.
selectorstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Ensure the checkbox `<input type="checkbox" id="checkbox" ... >...</input>` is checked. -->
<checkOption selector="input#checkbox" stepKey="checkCheckbox"/>
clearField
Clears a text input field. Equivalent to using <fillField> with an empty string.
selectorstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Clear the selected field. -->
<clearField selector="input#name" stepKey="clearField"/>
click
See click docs on codeception.com.
selectoruserInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Click the selected button. -->
<click selector="button#clickable" stepKey="clickButton"/>
<!-- Click on the "<a href=...>Login</a>" link. -->
<click selectorArray="['link' => 'Login']" stepKey="clickButton2"/>
clickWithLeftButton
See clickWithLeftButton docs on codeception.com.
selectorselectorArrayxystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Left click on the center of the `<button id="clickable" />` element. -->
<clickWithLeftButton selector="button#clickable" stepKey="clickButton1"/>
<!-- Left click on the point that is 50 px from the top of the window and 50 px from the left of the window. -->
<clickWithLeftButton x="50" y="50" stepKey="clickButton2"/>
<!-- Left click on the point that is 50 px from the top and 50 px from the left of of the `<button id="clickable" />` element.. -->
<clickWithLeftButton selector="button#clickable" x="50" y="50" stepKey="clickButton3"/>
clickWithRightButton
See clickWithRightButton docs on codeception.com.
selectorselectorArrayxystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Right click on the center of the `<button id="clickable" />` element. -->
<clickWithRightButton selector="button#clickable" stepKey="clickButton1"/>
<!-- Right click on the point that is 50 px from the top of the window and 50 px from the left of the window. -->
<clickWithRightButton x="50" y="50" stepKey="clickButton2"/>
<!-- Right click on the point that is 50 px from the top and 50 px from the left of of the `<button id="clickable" />` element.. -->
<clickWithRightButton selector="button#clickable" x="50" y="50" stepKey="clickButton3"/>
closeAdminNotification
Remove from the DOM all elements with the CSS classes .modal-popup or .modals-overlay.
stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Remove elements of the `.modal-popup` or `.modals-overlay` CSS classes. -->
<closeAdminNotification stepKey="closeAdminNotification"/>
closeTab
See closeTab docs on codeception.com.
stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Close the active tab. -->
<closeTab stepKey="closeTab"/>
comment
Allows input of a string as a PHP code comment. This tag is not executed. It is intended to aid documentation and clarity of tests.
userInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.<!-- Open the specified page and print a comment "I am on the login page" in the log during test execution. -->
<amOnPage url="/login" stepKey="goToLoginPage"/>
<comment userInput="I am on the login page" stepKey="loginPageComment"/>
conditionalClick
Conditionally clicks on an element if, and only if, another element is visible or not.
selectordependentSelectorvisiblestepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Click on the element with `id="foo"` if the element with `id="bar"` is visible. -->
<conditionalClick selector="#foo" dependentSelector="#bar" visible="true" stepKey="click1"/>
createData
Creates an entity (for example, a category or product). To create an entity, the Functional Testing Framework makes a POST request to the Adobe Commerce or Magento Open Source API according to the data and metadata of the entity to be created.
entitystoreCodestepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.It can optionally contain one or more requiredEntity child elements.
Example
<!-- Create an entity with the "SampleProduct" name. -->
<createData entity="SampleProduct" stepKey="createSampleProduct"/>
requiredEntity
Specify relationships amongst data to be created. For example, a complex Product object may contain within it a pointer (an ID) to a complex Category object.
Example
<!-- Create an entity with the "SampleCategory" name. -->
<createData entity="SampleCategory" stepKey="createCategory"/>
<!-- Create the "SampleProduct" product in that category. -->
<createData entity="SampleProduct" stepKey="createProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
createDataKeystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.field
Persists a custom field (as a part of the entity) overriding the matching declaration in static data. This field is replaced at a top level only (nested values such as custom attributes or extension attributes are not replaced).
keyExample
To overwrite the name field in a particular product, specify a field element during its creation.
<createData entity="SampleProduct" stepKey="createProduct">
<field key="name">myCustomProductName</field>
</createData>
deleteData
Delete an entity that was previously created.
createDataKeystepKey of the createData action .urlstoreCodestepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
Delete the entity that was previously created using createData in the scope of the test.
- Create SampleCategory:
<createData entity="SampleCategory" stepKey="createCategory"/>
- Delete SampleCategory:
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
Example of existing data deletion
Delete an entity using REST API request to the corresponding route:
<grabFromCurrentUrl regex="/^.+id\/([\d]+)/" stepKey="grabId"/>
<deleteData url="V1/categories/{$grabId}" stepKey="deleteCategory"/>
dontSee
See the codeception.com documentation for more information about this action.
userInputselectorselectorArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Check that the page does not contain the `<h2 id="title">Sample title</h2>` element. -->
<dontSee userInput="Sample title" selector="h2#title" stepKey="dontSeeTitle"/>
dontSeeCheckboxIsChecked
See dontSeeCheckboxIsChecked docs on codeception.com.
selectorstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that the page does not contain the `<input type="checkbox" id="option1" ... >...</input>` element. -->
<dontSeeCheckboxIsChecked selector="input#option1" stepKey="checkboxNotChecked"/>
dontSeeCookie
See dontSeeCookie docs on codeception.com.
userInputparameterArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Verify that there is no cookie with the given name `cookie1`. -->
<dontSeeCookie userInput="cookie1" stepKey="cookie1NotPresent"/>
<!-- Verify that there is no cookie with the given name `cookie1` from the domain `www.example.com`. -->
<dontSeeCookie userInput="cookie1" parameterArray="['domainName' => '.example.com']" stepKey="dontSeeCookieInExampleDomain"/>
dontSeeCurrentUrlEquals
See dontSeeCurrentUrlEquals docs on codeception.com.
urlstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that the relative URL of the current page does not match `/admin`. -->
<dontSeeCurrentUrlEquals url="/admin" stepKey="notOnAdminPage"/>
dontSeeCurrentUrlMatches
See dontSeeCurrentUrlMatches docs on codeception.com
regexstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that the relative URL of the current page does not match the `~$/users/(\d+)~` regular expression. -->
<dontSeeCurrentUrlMatches regex="~$/users/(\d+)~" stepKey="dontSeeCurrentUrlMatches"/>
dontSeeElement
See dontSeeElement docs on codeception.com.
selectorparameterArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that `<div id="box" ... >...</div>` is missing or invisible on the current page. -->
<dontSeeElement selector="div#box" stepKey="dontSeeBox"/>
dontSeeElementInDOM
See dontSeeElementInDOM docs on codeception.com.
selectorparameterArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that `<div id="box" ... >...</div>` is completely missing on the current page. -->
<dontSeeElementInDOM selector="div#box" stepKey="dontSeeBoxInDOM"/>
dontSeeInCurrentUrl
See dontSeeInCurrentUrl docs on codeception.com.
urlstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that the url of the current active tab does not contain the string "/users/". -->
<dontSeeInCurrentUrl url="/users/" stepKey="dontSeeInCurrentUrl"/>
dontSeeInField
See dontSeeInField docs on codeception.com.
selectorselectorArrayuserInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that `<input id="field" ... >...</input>` does not contain the text "Sample text". -->
<dontSeeInField userInput="Sample text" selector="input#field" stepKey="dontSeeInField1"/>
dontSeeInFormFields
See dontSeeInFormFields docs on codeception.com.
selectorparameterArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that `<form name="myform" ... >...</form>` with the input elements `<input name="input1">...</input>` and `<input name="input2">...</input>`, do not have the values of `value1` and `value2` respectively. -->
<dontSeeInFormFields selector="form[name=myform]" parameterArray="['input1' => 'value1', 'input2' => 'value2']" stepKey="dontSeeInFormFields"/>
dontSeeInPageSource
See dontSeeInPageSource docs on codeception.com.
htmlstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that the page source does not contain the raw source code `<h1 class="login-header">`. -->
<dontSeeInPageSource userInput="<h1 class="login-header">" stepKey="dontSeeInPageSource"/>
dontSeeInSource
See dontSeeInSource docs on codeception.com.
htmlstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
You must encode the html using a tool such as CyberChef.
<!-- Verify that the page source does not contain the raw source code `<h1 class="login-header">`. -->
<dontSeeInSource html="<h1 class="login-header">" stepKey="dontSeeInSource"/>
dontSeeInTitle
See dontSeeInTitle docs on codeception.com.
userInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that the title of the current active window does not contain the text "Page Title". -->
<dontSeeInTitle userInput="Page Title" stepKey="dontSeeInTitle"/>
dontSeeJsError
Ensure that the current page does not have JavaScript errors.
stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify there are no JavaScript errors in the current active window. -->
<dontSeeJsError stepKey="dontSeeJsError"/>
dontSeeLink
See dontSeeLink docs on codeception.com.
userInputurlstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Verify that there is no hyperlink tag on the page with the text "External link". -->
<dontSeeLink userInput="External link" stepKey="dontSeeLink"/>
<!-- Verify that there is no hyperlink tag with the text "External link" and the `href` attribute of `/admin`. -->
<dontSeeLink userInput="External link" url="/admin" stepKey="dontSeeAdminLink"/>
dontSeeOptionIsSelected
See dontSeeOptionIsSelected docs on codeception.com.
selectoruserInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that `<select id="myselect" ... >...</select>` does not have the option `option1` selected -->
<dontSeeOptionIsSelected userInput="option1" selector="select#myselect" stepKey="dontSeeOption1"/>
doubleClick
See doubleClick docs on codeception.com.
selectorstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Click the selected element twice in succession. -->
<doubleClick selector="button#mybutton" stepKey="doubleClickButton"/>
dragAndDrop
See dragAndDrop docs on codeception.com.
selector1selector2xystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Click and drag `<div id="block1" ... >...</div>` to the middle of `<div id="block2" ... >...</div>` -->
<dragAndDrop selector1="div#block1" selector2="div#block2" stepKey="dragAndDrop"/>
<!-- Click and drag `<div id="block1" ... >...</div>` to the middle of `<div id="block2" ... >...</div>` with a left offset of 50px and top offset of 50px. -->
<dragAndDrop selector1="#block1" selector2="#block2" x="50" y="50" stepKey="dragAndDrop"/>
rapidClick
See rapidClick docs on codeception.com.
selectorcountstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Rapid click the selected element as per given count number -->
<rapidClick selector="#selector" count="50" stepKey="rapidClick"/>
executeJS
See executeJS docs on codeception.com.
functionstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Return the time in seconds since Unix Epoch (January 1, 1970) using the JavaScript Date() function.
To access this value, use `{$returnTime}` in later actions. -->
<executeJS function="return Math.floor(new Date() / 1000);" stepKey="returnTime"/>
To access this value you would use {$returnTime} in later actions.
fillField
See fillField docs on codeception.com.
selectorselectorArrayuserInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Fill in `<input id="myfield" ... >...</input>` with the text "Sample text". -->
<fillField userInput="Sample text" selector="input#myfield" stepKey="fillField"/>
formatCurrency
Format input to specified currency according to the locale specified. Returns formatted string for test use. Use NumberFormatter::formatCurrency(), see https://www.php.net/manual/en/numberformatter.formatcurrency.php
userInputlocalecurrencystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.generateDate
Generates a date for use in {$stepKey} format in other test actions.
datestrtotime() function.formatdate() function.timezoneAmerica/Los_Angeles.stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Generate a date that is 1 minute after the current date using Pacific Standard Time. For example "07/11/2020 7:00 AM".
To access this value, use `{$generateDate}` in later actions. -->
<generateDate date="+1 minute" format="m/d/Y g:i A" stepKey="generateDate"/>
getData
Gets an entity (for example, a category), from the Adobe Commerce or Magento Open Source API according to the data and metadata of the entity type that is requested.
storeCodeindexentitystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Get the product attribute that was created using `<createData stepKey="productAttributeHandle" ... />`. -->
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getAttributeOption1Handle">
<requiredEntity createDataKey="productAttributeHandle"/>
</getData>
The ProductAttributeOptionGetter entity must be defined in the corresponding data *.xml.
This action can optionally contain one or more requiredEntity child elements.
getOTP
Generate a one-time password (OTP) based on a saved secret at path magento/tfa/OTP_SHARED_SECRET in the Functional Testing Framework credential storage. The one-time password (OTP) is returned and accessible through the stepkey.
The Functional Testing Framework use TOTP from Spomky-Labs/otphp, if you want to learn more about this action.
stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<getOTP stepKey="getOtp"/>
grabAttributeFrom
See grabAttributeFrom docs on codeception.com.
selectoruserInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Grab the `title` attribute from `<input id="myinput" ... >...</input>`.
To access this value, use `{$grabAttributeFromInput}` in later actions. -->
<grabAttributeFrom userInput="title" selector="input#myinput" stepKey="grabAttributeFromInput"/>
grabCookie
See grabCookie docs on codeception.com.
userInputparameterArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Grab the cookie with the given name `cookie1`.
To access this value, use `{$grabCookie1}` in later actions. -->
<grabCookie userInput="cookie1" stepKey="grabCookie1"/>
<!-- Grab the cookie with the given name `cookie1` from the domain `www.example.com`.
To access this value, use `{$grabCookieExampleDomain}` in later actions. -->
<grabCookie userInput="cookie1" parameterArray="['domainName' => '.example.com']" stepKey="grabCookieExampleDomain"/>
grabCookieAttributes
See grabCookieAttributes docs on codeception.com.
userInputparameterArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Grab the cookie attributes with the given name `cookie1`.
To access these values, use `{$grabCookie1}` in later actions. -->
<grabCookieAttributes userInput="cookie1" stepKey="grabCookie1"/>
<!-- Grab the cookie attributes with the given name `cookie1` from the domain `www.example.com`.
To access these values, use `{$grabCookieExampleDomain}` in later actions.
To access expiry date, use `{$grabCookieExampleDomain.expiry}` in later actions.
-->
<grabCookieAttributes userInput="cookie1" parameterArray="['domainName' => '.example.com']" stepKey="grabCookieExampleDomain"/>
grabFromCurrentUrl
See grabFromCurrentUrl docs on codeception.com..
regexstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Grab the text from the current URL that matches the regex expression `~$/user/(\d+)/~`.
To access this value, use `{$grabFromCurrentUrl}` in later actions. -->
<grabFromCurrentUrl regex="~$/user/(\d+)/~" stepKey="grabFromCurrentUrl"/>
grabMultiple
See grabMultiple docs on codeception.com..
selectoruserInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Grab every element on the page with the class `myElement` and return them as an array.
To access this value, use `{$grabAllMyElements}` in later actions. -->
<grabMultiple selector="div.myElement" stepKey="grabAllMyElements"/>
<!-- Grab the `href` tag from every `a` element on the page and return them as an array.
To access this value, use `{$grabAllLinks}` in later actions. -->
<grabMultiple userInput="href" selector="a" stepKey="grabAllLinks"/>
grabPageSource
See grabPageSource docs on codeception.com.
stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Store the page source code as text
To access this value, use `{$grabPageSource}` in later actions. -->
<grabPageSource stepKey="grabPageSource"/>
grabTextFrom
See grabTextFrom docs on codeception.com.
selectorstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Store the text currently displayed by the selected element.
To access this value, use `{$grabTitle}` in later actions. -->
<grabTextFrom selector="h2#title" stepKey="grabTitle"/>
grabValueFrom
See grabValueFrom docs on codeception.com.
selectorselectorArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Store the value currently entered in <input id="name" ... >...</input>.
To access this value, use `{$grabInputName}` in later actions. -->
<grabValueFrom selector="input#name" stepKey="grabInputName"/>
return
Specifies what value is returned by an action group. The value can be then accessed in later steps using the action group stepKey. See Action groups returning a value for usage information.
valuestepKeyExample
<!-- Returns value of $grabInputName to the calling -->
<return value="{$grabInputName}" stepKey="returnInputName"/>
loadSessionSnapshot
See loadSessionSnapshot docs on codeception.com.
userInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Load all cookies saved via `<saveSessionSnapshot name="savedSnapshot" ... />`.
To access this value, use the `loadSessionSnapshot` action -->
<loadSessionSnapshot userInput="savedSnapshot" stepKey="loadSnapshot"/>
magentoCLI
Specifies a CLI command to execute in a Adobe Commerce or Magento Open Source.
commandargumentstimeoutstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Re-index all indices via the command line. -->
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
magentoCron
Used to execute Adobe Commerce or Magento Open Source Cron jobs. Groups may be provided optionally. Internal mechanism of <magentoCron> ensures that Cron Job of single group is ran with 60 seconds interval.
groupsargumentstimeoutstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<magentoCron stepKey="runStagingCronJobs" groups="staging"/>
<!-- No interval here -->
<magentoCron stepKey="runIndexCronJobs" groups="index"/>
<!-- 60 seconds interval takes place here -->
<magentoCron stepKey="runAllCronJobs"/>
makeScreenshot
See makeScreenshot docs on codeception.com.
userInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Note that the makeScreenshot action does not automatically add the screenshot to Allure reports.
Example
<!-- Take a screenshot of the page and save it to the directory `tests/_output/debug` under the name `example.png`. -->
<makeScreenshot userInput="example" stepKey="screenshotPage"/>
maximizeWindow
See maximizeWindow docs on codeception.com.
stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Maximize the current window. -->
<maximizeWindow stepKey="maximizeWindow"/>
moveBack
See moveBack docs on codeception.com.
stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Move back one page in history. -->
<moveBack stepKey="moveBack"/>
moveForward
See moveForward docs on codeception.com..
stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.<!-- Move forward one page in history. -->
<moveForward stepKey="moveForward"/>
moveMouseOver
See moveMouseOver docs on codeception.com.
selectorselectorArrayxystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Move the mouse cursor over the selected element. -->
<moveMouseOver selector="button#product1" stepKey="hoverOverProduct1"/>
<!-- Move the mouse cursor over the selected element with an offset of 50px from the top and 50px from the left. -->
<moveMouseOver selector="button#product1" x="50" y="50" stepKey="hoverOverProduct2"/>
mSetLocale
userInputlocalestepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.mResetLocale
stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.openNewTab
See openNewTab docs on codeception.com.
stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Open and switch to a new browser tab. -->
<openNewTab stepKey="openNewTab"/>
parseFloat
Parses float number with thousands separator.
userInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.pause
See usage of <pause in interactive-pause and pause docs on codeception.com.
stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Halt test execution until the `enter` key is pressed to continue. -->
<pause stepKey="pause"/>
pressKey
See pressKey docs on codeception.com.
selectoruserInputparameterArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Press the `a` key within the selected area. -->
<pressKey userInput="a" selector="#targetElement" stepKey="pressA"/>
The parameterArray attribute value must begin with [ and end with ]. To press more than one key at a time, wrap the keys in secondary [].
<!-- Press the delete within the selected area uses key constants from the WebDriverKeys class. -->
<pressKey selector="#targetElement" parameterArray="[['ctrl', 'a'], \Facebook\WebDriver\WebDriverKeys::DELETE]" stepKey="pressDelete"/>
reloadPage
See reloadPage docs on codeception.com.
stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Reload the current page. -->
<reloadPage stepKey="reloadPage"/>
remove
Removes action by its stepKey.
keyForRemovalstepKey of the action you want to remove.Example
<!-- Remove an action in the test with the stepKey of `stepKeyToRemove`. -->
<remove keyForRemoval="stepKeyToRemove"/>
resetCookie
See resetCookie docs on codeception.com.
userInputparameterArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Reset a cookie with the name `cookie1`. -->
<resetCookie userInput="cookie1" stepKey="resetCookie1"/>
<!-- Reset a cookie with the given name `cookie1` from the domain `www.example.com`. -->
<resetCookie userInput="cookie1" parameterArray="['domainName' => '.example.com']" stepKey="resetCookieExampleDomain"/>
resizeWindow
See resizeWindow docs on codeception.com.
widthheightstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Resize the current window to a width of 800px and a height of 600px. -->
<resizeWindow width="800" height="600" stepKey="resizeWindow"/>
saveSessionSnapshot
See saveSessionSnapshot docs on codeception.com.
userInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Save all of the current cookies under the name `savedSnapshot`. -->
<saveSessionSnapshot userInput="savedSnapshot" stepKey="saveCurrentCookies"/>
scrollTo
See scrollTo docs on codeception.com.
selectorselectorArrayxystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Move the page to the middle of the selected area. -->
<scrollTo selector="div#anchor" stepKey="scrollToAnchor"/>
<!-- Move the page to the middle of the selected area with an offset of 50px from the top and 50px from the left. -->
<scrollTo selector="div#anchor" x="50" y="50" stepKey="scrollToAnchor2"/>
scrollToTopOfPage
A convenience function that executes window.scrollTo(0,0) as JavaScript, thus returning to the top of the page.
stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Move the page to the uppermost, leftmost position. -->
<scrollToTopOfPage stepKey="scrollToTopOfPages"/>
searchAndMultiSelectOption
Search for and select options from a multi-select drop-down menu. For example, the drop-down menu you use to assign Products to Categories.
selectorparameterArrayrequiredActiontrue.stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Search and select for "Item 1" amd "Item 2" in the multiselect element with the id of `multiSelect`. -->
<searchAndMultiSelectOption selector="#multiSelect" parameterArray="['Item 1', 'Item 2']" stepKey="searchAndMultiSelect1"/>
On this test step the MFTF:
- Searches for a drop-down HTML element that matches the
#stuffselector. - Opens the drop-down menu.
- Enters Item 1 in a search field of the drop-down element.
- Selects first element from the filtered results.
- Enters Item 2 in a search field of the drop-down element.
- Selects first element from the filtered results.
see
See see docs on codeception.com.
userInputselectorselectorArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that the selected element contains the text "Sample title". -->
<see userInput="Sample title" selector="h2#title" stepKey="seeTitle"/>
seeCheckboxIsChecked
See seeCheckboxIsChecked docs on codeception.com.
selectorstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify `<input type="checkbox" id="option1" ... >...</input>` is checked. -->
<seeCheckboxIsChecked selector="input#option1" stepKey="seeCheckboxChecked"/>
seeCookie
See seeCookie docs on codeception.com.
userInputparameterArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Verify that there is a cookie with the given name `cookie1`. -->
<seeCookie userInput="cookie1" stepKey="cookie1Present"/>
<!-- Verify that there is a cookie with the given name `cookie1` from the domain `www.example.com`. -->
<seeCookie userInput="cookie1" parameterArray="['domainName' => 'www.example.com']" stepKey="seeCookieInExampleDomain"/>
seeCurrentUrlEquals
See seeCurrentUrlEquals docs on codeception.com.
urlstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that the relative URL of the current page matches `/admin`. -->
<seeCurrentUrlEquals url="/admin" stepKey="onAdminPage"/>
seeCurrentUrlMatches
See seeCurrentUrlMatches docs on codeception.com.
regexstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that the relative URL of the current page matches the `~$/users/(\d+)~` regular expression. -->
<seeCurrentUrlMatches regex="~$/users/(\d+)~" stepKey="seeCurrentUrlMatches"/>
seeElement
See seeElement docs on codeception.com.
selectorselectorArrayparameterArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that `<div id="box" ... >...</div>` is available and visible on the current page. -->
<seeElement selector="div#box" stepKey="seeBox"/>
seeElementInDOM
See seeElementInDOM docs on codeception.com.
selectorparameterArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that `<div id="box" ... >...</div>` is available on the current page. -->
<seeElementInDOM selector="div#box" stepKey="seeBoxInDOM"/>
seeInCurrentUrl
See seeInCurrentUrl docs on codeception.com.
urlstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that the url of the current active tab contains the string "/users/". -->
<seeInCurrentUrl url="/users/" stepKey="seeInCurrentUrl"/>
seeInField
See seeInField docs on codeception.com.
selectorselectorArrayuserInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that `<input id="field" ... >...</input>` contains the text "Sample text". -->
<seeInField userInput="Sample text" selector="input#field" stepKey="seeInField"/>
seeInFormFields
See seeInFormFields docs on codeception.com.
selectorparameterArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that `<form name="myform" ... >...</form>` with the input elements `<input name="input1">...</input>` and `<input name="input2">...</input>`, has the values of `value1` and `value2` respectively. -->
<seeInFormFields selector="form[name=myform]" parameterArray="['input1' => 'value1', 'input2' => 'value2']" stepKey="seeInFormFields"/>
seeInPageSource
See seeInPageSource docs on codeception.com.
htmlstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
You must encode the html using a tool such as CyberChef.
<!-- Verify that the page source contains the raw source code `<h1 class="login-header">`. -->
<seeInPageSource html="<h1 class="login-header">" stepKey="seeInPageSource"/>
seeInPopup
See seeInPopup docs on codeception.com.
userInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify the current popup on the page contains the string "Sample text". -->
<seeInPopup userInput="Sample text" stepKey="seeInPopup"/>
seeInSource
See seeInSource docs on codeception.com.
htmlstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
You must encode the html using a tool such as CyberChef.
<!-- Verify that the page source contains the raw source code `<h1 class="login-header">`. -->
<seeInSource html="<h1 class="login-header">" stepKey="seeInSource"/>
seeInTitle
See seeInTitle docs on codeception.com.
userInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that the title of the current active window contains the text "Page Title". -->
<seeInTitle userInput="Page Title" stepKey="seeInTitle"/>
seeLink
See seeLink docs on codeception.com.
userInputurlstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that there is a hyperlink tag on the page with the text "External link". -->
<seeLink userInput="External link" stepKey="seeLink"/>
<!-- Verify that there is a hyperlink tag with the text "External link" and the `href` attribute of `/admin`. -->
<seeLink userInput="External link" url="/admin" stepKey="seeAdminLink"/>
seeNumberOfElements
See seeNumberOfElements docs on codeception.com.
selectoruserInputparameterArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Verify there are 10 `<div class="product" ... >...</div>` elements on the page. -->
<seeNumberOfElements userInput="10" selector="div.product" stepKey="seeTenProducts"/>
<!-- Verify there are between 5 and 10 `<div class="product" ... >...</div>` elements on the page. -->
<seeNumberOfElements parameterArray="[5, 10]" selector="div.product" stepKey="seeFiveToTenProducts"/>
seeOptionIsSelected
See seeOptionIsSelected docs on codeception.com.
selectoruserInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Verify that `<select id="myselect" ... >...</select>` has the option `option1` selected -->
<seeOptionIsSelected userInput="option1" selector="select#myselect" stepKey="seeOption1"/>
selectOption
See selectOption docs on codeception.com.
selectoruserInputparameterArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Select `option1` from `<select id="mySelect" ... >...</select>`. -->
<selectOption userInput="option1" selector="select#mySelect" stepKey="selectOption1"/>
selectMultipleOptions
Selects all given options in the given drop-down element.
filterSelectoroptionSelectorstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.It contains a child element <array> where you specify the options that must be selected using an array format like ['opt1', 'opt2'].
Example
<!-- Select the options `opt1` and `opt2` from `<option class="option" ... >...</option>` and `<input class="filter" ...>...</input>` -->
<selectMultipleOptions filterSelector=".filter" optionSelector=".option" stepKey="selectMultipleOpts1">
<array>['opt1', 'opt2']</array>
</selectMultipleOptions>
setCookie
See setCookie docs on codeception.com.
userInputparameterArrayvaluestepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Set a cookie with the name of `cookieName` and value of `cookieValue`. -->
<setCookie userInput="cookieName" value="cookieValue" stepKey="setCookie"/>
submitForm
See submitForm docs on codeception.com.
selectorparameterArraybuttonstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Submit a value of `admin` for `<input name="username" ... >...</input>`, a value of `123123q` for `<input name="password" ... >...</input>` for the form `<form id="loginForm" ...>...</form>` and a submit button of `<button id="submit" ... >...</button>` -->
<submitForm selector="#loginForm" parameterArray="['username' => 'admin','password' => '123123q']" button="#submit" stepKey="submitForm"/>
switchToIFrame
See switchToIFrame docs on codeception.com.
selectoruserInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Set the focus to <iframe name="embeddedFrame" ... /> -->
<switchToIFrame userInput="embeddedFrame" stepKey="switchToIFrame"/>
switchToNextTab
See switchToNextTab docs on codeception.com.
userInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Switch to the next tab. -->
<switchToNextTab stepKey="switchToNextTab"/>
<!-- Switch to the third next tab. -->
<switchToNextTab userInput="3" stepKey="switchToThirdNextTab"/>
switchToPreviousTab
See switchToPreviousTab docs on codeception.com.
userInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Examples
<!-- Switch to the previous tab. -->
<switchToPreviousTab stepKey="switchToPreviousTab"/>
<!-- Switch to the third previous tab. -->
<switchToPreviousTab userInput="3" stepKey="switchToThirdPreviousTab"/>
switchToWindow
See switchToWindow docs on codeception.com.
userInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Switch to a window with the `name` parameter of `newWindow`. -->
<switchToWindow userInput="newWindow" stepKey="switchToWindow"/>
typeInPopup
See typeInPopup docs on codeception.com.
userInputstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Type the text "Sample Text" into the current popup visible on the page. -->
<typeInPopup userInput="Sample Text" stepKey="typeInPopup"/>
uncheckOption
See uncheckOption docs on codeception.com.
selectorstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Ensure the checkbox `<input type="checkbox" id="checkbox" ... >...</input>` is unchecked. -->
<uncheckOption selector="input#checkbox" stepKey="uncheckCheckbox"/>
unselectOption
See unselectOption docs on codeception.com.
selectoruserInputparameterArraystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Deselect `option1` from `<select id="mySelect" ... >...</select>`. -->
<unselectOption userInput="option1" selector="select#myselect" stepKey="unselectOption1"/>
updateData
When you create a data entity using createData, you may need to update it later in the test. The updateData action allows this.
For example, to change the price of a product:
<updateData entity="AdjustPriceProduct" createDataKey="productHandle" stepKey="updateProduct"/>
Where AdjustPriceProduct simply looks like this:
<entity name="AdjustPriceProduct" type="product">
<data key="price">321.00</data>
</entity>
Only the fields that you want to update are set.
storeCodeentityupdateData entity being created.createDataKeystepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.This action can optionally contain one or more requiredEntity child elements.
wait
See wait docs on codeception.com.
timestepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Halt test execution for 10 seconds before continuing. -->
<wait time="10" stepKey="waitTenSeconds"/>
waitForAjaxLoad
Wait for all Ajax calls to finish.
timestepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Wait up to 30 seconds for all AJAX calls to finish before continuing. -->
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
waitForElementChange
See waitForElementChange docs on codeception.com.
selectorfunctiontimestepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Wait up to 30 seconds for `<div id="changedElement" ... >...</div>` to change to displayed before continuing. -->
<waitForElementChange selector="div#changedElement" function="function(\WebDriverElement $el) {return $el->isDisplayed();}" stepKey="waitForElementChange"/>
waitForElement
See waitForElement docs on codeception.com.
selectortimestepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Wait up to 30 seconds for `<div id="changedElement" ... >...</div>` to be appear on the page before continuing. -->
<waitForElement selector="#changedElement" stepKey="waitForElement"/>
waitForElementNotVisible
See waitForElementNotVisible docs on codeception.com.
selectortimestepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Wait up to 30 seconds for `<div id="changedElement" ... >...</div>` to become non-visible on the page before continuing. -->
<waitForElementNotVisible selector="#changedElement" stepKey="waitForElementNotVisible"/>
waitForElementVisible
See waitForElementVisible docs on codeception.com.
selectortimestepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<waitForElementVisible selector="#changedElement" stepKey="waitForElementVisible"/>
waitForElementClickable
See waitForElementClickable docs on codeception.com.
selectortimestepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Waits up to $timeout seconds for the given element to be clickable. If element doesn't become clickable, a timeout exception is thrown. -->
<waitForElementClickable selector="#changedElement" stepKey="waitForElementClickable"/>
waitForJS
See waitForJS docs on codeception.com.
functiontimestepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Wait for all jQuery AJAX requests to finish before continuing. -->
<waitForJS function="return $.active == 0;" stepKey="waitForJS"/>
waitForLoadingMaskToDisappear
Wait for all loading overlays to disappear.
data-variant=info
data-slots=text
# Wait for these classes to not be visible
//div[contains(@class, "loading-mask")]
//div[contains(@class, "admin_data-grid-loading-mask")]
//div[contains(@class, "admin__data-grid-loading-mask")]
//div[contains(@class, "admin__form-loading-mask")]
//div[@data-role="spinner"]
stepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Wait up to 30 seconds for all loading overlays to disappear before continuing. -->
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
waitForPageLoad
Wait for Ajax, loading overlays, and document.readyState == "complete".
timestepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Wait up to 30 seconds for the current page to fully load before continuing. -->
<waitForPageLoad stepKey="waitForPageLoad"/>
waitForPwaElementNotVisible
Waits up to the given time for a PWA Element to disappear from the screen.
timeselectorstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Wait for the PWA element to disappear. -->
<waitForPwaElementNotVisible time="1" stepKey="waitForPwaElementNotVisible"/>
waitForPwaElementVisible
Waits up to the given 'time' for a PWA Element to appear on the screen.
timeselectorstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Wait for the selected element to appear. -->
<waitForPwaElementVisible stepKey="waitForPwaElementVisible"/>
waitForText
See waitForText docs on codeception.com.
userInputtimeselectorstepKeybeforestepKey of action that must be executed next.afterstepKey of preceding action.Example
<!-- Wait for text "Sample Text" to appear in the selected area before continuing. -->
<waitForText userInput="Sample Text" selector="div#page" stepKey="waitForText"/>