Miscellaneous step definitions
Key commands
The following step definition is available to enter key commands:
the user hits tab
the user hits enter
the user hits escape
Use of waits
The following step definitions are available to add a pause in a test:
the user waits
the user waits (.*) seconds
Examples
Extract from sample: 0313B-WaitsManagement
A time delay is added in a test by using Waits. For example, if you want to confirm that the journal entry generated after you posted a document, you must wait for the accounting task to process the document. It is required to add a temporization of 60 seconds in the test, as the accounting task is executed every minute.
Then the user clicks the "Post" secondary action button on the right panel
And an alert box with the text containing "The document will be validated!" appears
And the user clicks the "Ok" opinion in the alert box
And a log panel appears
And the user clicks the close page action icon on the header panel
#Waits: add a timer of 60 seconds to wait for the accounting task to process the purchase invoice posting.
Then the user waits 60 seconds
Then the user opens the header drop-down
Then the user opens the "Zooms" section on the right panel
And the user clicks the "Accounting document" secondary action button on the right panel
Site depositor interaction (for Sage X3 Warehousing)
The following step definition is available:
the user clicks on the site depositor action in the profile bar
Examples
Scenario: Set Site and Depositor values
Given the user clicks on the site depositor action in the profile bar
When the modal dialog "GEODE connection properties" is displayed
Then the user selects the text field with name: "Site"
And the user writes "01" to the selected text field
And the user selects the text field with name: "Depositor"
And the user writes "ALPHA" to the selected text field and hits tab key
And the user clicks the "Ok" button in the header
Take screenshots on demand
Screenshots are taken when the test fails. With Sage X3 Automated Test Platform 2.8.0, the following step definition has been added to give you the possibility to also take screenshots on demand:
the user takes a screenshot
Examples
Extract from sample: 0315C-TakeScreenshotsOnDemand
Like when the test fails, you can consult the screenshot in the generated Allure report.
-
Refer to the user guide's Working with Allure chapter to learn more about generating Allure reports from VS Code.
-
Refer to the Understanding the Allure report chapter to learn more about generating allure report from Jenkins.
And the user selects the text field with name: "Invoice - tax"
Then the value of the selected text field is "137828.50"
And the user selects the text field with name: "Calculated - tax"
Then the value of the selected text field is "137828.50"
# Screenshot on demand
And the user takes a screenshot
Navigate to the first or last browser tab opened
The following step definitions are available:
the user switches to the first opened tab
the user switches to the last opened tab
Lock management (for parallel execution)
The following step definitions are available to add or remove a lock in a test.
Those step definitions are used to prevent the tests from colliding with each other, when the tests are executed in parallel.
the user adds the lock entry "(.*)"
the user removes the lock entry "(.*)
Examples
Extract from sample: 0316A-LockManagmentExample01 / 0316B-LockManagmentExample02
Refer to the Sage X3 Automated Test Platform – user guide Executing tests in parallel for further information.