Actions
Abstract actions recognized through Natural Language Processing
Concordia Language contains a set of meta-actions that can be used by different testing frameworks for generating test scripts. Concordia Compiler uses Intent Recognition (yes, like chatbots do) to understand sentences and extract the desired action to perform. Later these actions are sent to testing frameworks for conversion into commands.
The following list presents the available actions and gives some examples on how to use them in sentences. We expect that you do not have to memorize them but, instead, see the things you can do. Try to write the sentences the way you speak, using first person singular (I) . When there is a UI Element in the sentence, embrace it with { and }, like {this}. The compiler will tell you whether it cannot understand some sentence you wrote. If you think it should have understood something, please tell us. We'll try to augment the compiler's vocabulary to understand it the next time.
accept
Accepts a browser message or app message.
# Simple alert
When I accept the alert
# Alert with a message
When I accept the alert "Do you want to continue?"
# Confirmation dialog
When I accept the confirmation
# Confirmation dialog with a message
When I accept the confirmation "Do you want to continue?"
# Popup dialog
When I accept the popup
# Popup dialog with a message
When I accept the popup "Are you sure?"
# Prompt dialog
When I accept the prompt
# Prompt dialog with a message
When I accept the prompt "What's your name?"amOn
Indicates a webpage or screen in which it is expected to be at.
append
Adds a value to an element.
attachFile
Attaches a file. It selects a file and confirms its choice (e.g., clicks Open).
cancel
Cancels a browser message or app message.
check
Checks a checkbox.
clear
Empties an input field or browser cookie
click
Clicks on something in the screen.
close
Closes a tab, a set of tabs, or an app (mobile only).
connect
Connects to a database.
The next sentence is for Test Events only:
disconnect
Disconnects from a database.
The next sentence is for Test Events only:
doubleClick
Performs a double click on something.
drag
Drags and drops something to a widget.
fill
Indicates that a field is being filled. If desired, a value can be given. Otherwise, a value will be generated for the corresponding Test Case.
fill + target
hide
Hides something.
install
Installs an app.
maximize
Maximizes a window or the browser.
move
Moves the mouse cursor to a place or element.
open
Opens something
press
Presses a key or key combination, separated by comma.
Some special keys (case sensitive!):
AddAltArrowDownorDown arrowArrowLeftorLeft arrowArrowRightorRight arrowArrowUporUp arrowBackspaceCommandControlDelDivideEndEnterEqualsEscapeF1toF12HomeInsertMetaMultiplyNumpad 0toNumpad 9PausePagedownorPageDownPageuporPageUpSemicolonShiftSpaceSubtractTab
pull
Extracts a device's resource from a path.
refresh
Refreshes/reloads the current page.
remove
Removes/uninstall an app by its internal name (mobile only).
resize
Resizes a window.
rightClick
Performs a right click on something.
run
Runs a console command or a database script (SQL command).
👉 Available for Test Events only.
👉 Commands and SQL scripts must be declared between single quotes ('), in a single line.
👉 SQL scripts must reference their database.
SQL Syntax
Concordia Compiler uses database-js to access databases and files through SQL-like commands. The supported SQL syntax may vary from one database to another. Please see the documentation of the corresponding driver.
JSON and CSV as databases: INSERT accepts JSON objects or arrays as values. Example:
Excel and Firebase databases: Syntax similar to JSON and CSV databases. However, it has some limitations, as pointed out in its documentation :
SQL commands are limited to SELECT, UPDATE, INSERT and DELETE. WHERE works well. JOINs are not allowed. GROUP BY is not supported. LIMIT and OFFSET are combined into a single LIMIT syntax: LIMIT [offset,]number
INI databases: INSERT and DELETE are not supported yet by database-js-ini. UPDATE example:
SQLite databases: Currently database-js-sqlite uses sql.js that doesn't persist the changes in the file (only in memory).
saveScreenshot
Takes a screenshot an saves into a file.
scrollTo
Scrolls to a certain element.
see
Indicates that something can be seen. You can also negate the sentence to indicate something cannot be seen.
select
Selects a value for an element.
shake
Shakes the device - MOBILE ONLY.
swipe
Performs a swipe action - MOBILE ONLY
switch
Switches to a certain iframe and back to the application page; OR
Switches to a certain tab; OR
Switches an app to native mode or web mode - MOBILE ONLY.
NOTE: When switching to an iframe, all the commands that follow it will be applied to it.
tap
Performs a tap on an element - MOBILE ONLY
uncheck
Unchecks a checkbox.
wait
Wait for something.
Last updated