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
acceptAccepts 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
amOnIndicates a webpage or screen in which it is expected to be at.
append
appendAdds a value to an element.
attachFile
attachFileAttaches a file. It selects a file and confirms its choice (e.g., clicks Open).
cancel
cancelCancels a browser message or app message.
check
checkChecks a checkbox.
clear
clearEmpties an input field or browser cookie
click
clickClicks on something in the screen.
close
closeCloses a tab, a set of tabs, or an app (mobile only).
connect
connectConnects to a database.
The next sentence is for Test Events only:
disconnect
disconnectDisconnects from a database.
The next sentence is for Test Events only:
doubleClick
doubleClickPerforms a double click on something.
drag
dragDrags and drops something to a widget.
fill
fillIndicates 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
hideHides something.
install
installInstalls an app.
maximize
maximizeMaximizes a window or the browser.
move
moveMoves the mouse cursor to a place or element.
open
openOpens something
press
pressPresses a key or key combination, separated by comma.
Some special keys (case sensitive!):
AddAltArrowDownorDown arrowArrowLeftorLeft arrowArrowRightorRight arrowArrowUporUp arrowBackspaceCommandControlDelDivideEndEnterEqualsEscapeF1toF12HomeInsertMetaMultiplyNumpad 0toNumpad 9PausePagedownorPageDownPageuporPageUpSemicolonShiftSpaceSubtractTab
pull
pullExtracts a device's resource from a path.
refresh
refreshRefreshes/reloads the current page.
remove
removeRemoves/uninstall an app by its internal name (mobile only).
resize
resizeResizes a window.
rightClick
rightClickPerforms a right click on something.
run
runRuns 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
saveScreenshotTakes a screenshot an saves into a file.
scrollTo
scrollToScrolls to a certain element.
see
seeIndicates that something can be seen. You can also negate the sentence to indicate something cannot be seen.
select
selectSelects a value for an element.
shake
shakeShakes the device - MOBILE ONLY.
swipe
swipePerforms a swipe action - MOBILE ONLY
switch
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
tapPerforms a tap on an element - MOBILE ONLY
uncheck
uncheckUnchecks a checkbox.
wait
waitWait for something.
Last updated