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.
Concordia actions are recognized in Variants, Test Cases, and Test Events.
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 alertWhen I accept the alert # Alert with a messageWhen I accept the alert "Do you want to continue?" # Confirmation dialogWhen I accept the confirmation # Confirmation dialog with a messageWhen I accept the confirmation "Do you want to continue?" # Popup dialogWhen I accept the popup # Popup dialog with a messageWhen I accept the popup "Are you sure?" # Prompt dialogWhen I accept the prompt # Prompt dialog with a messageWhen I accept the prompt "What's your name?"
amOn
Indicates a webpage or screen in which it is expected to be at.
# URLGiven that I am on "http://concordialang.org" # ContantGiven that I am on [Some Page]
append
Adds a value to an element.
# Append a value to a UI ElementWhen I append "Foo" to {Foo}When I append 100 to {Bar}When I append [My Contant] to {Zoo} # Append a value to a UI literalWhen I append "Bar" to <#foo>When I append 200 to <#foo>When I append [My Contant] to <#zoo>
attachFile
Attaches a file. It selects a file and confirms its choice (e.g., clicks Open).
When I attach the file "/path/to/file" to {Foo}When I attach the file [My File] to {Foo}When I attach the file "/path/to/file" to <#bar>When I attach the file [My File] to <#bar>
cancel
Cancels a browser message or app message.
When I cancel the alertWhen I cancel the confirmationWhen I cancel the popupWhen I cancel the prompt
check
Checks a checkbox.
When I check {Foo}When I check <#bar>
clear
Empties an input field or browser cookie
When I clear {Foo}When I clear <#bar>When I clear the cookie "app"When I clear the cookie [App Cookie]
click
Clicks on something in the screen.
When I click on {Foo}When I click on <#bar>When I click on "Some Text"When I click on [Value From Contant]
close
Closes a tab, a set of tabs, or an app (mobile only).
When I close the current tabWhen I close the other tabs # Mobile onlyWhen I close the app
When I double click {Foo}When I double click <#bar>When I double click "Some Text"When I double click [My Contant]
drag
Drags and drops something to a widget.
When I drag {Foo} to {Bar}When I drag <#foo> to <#bar>
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
When I fill {Foo}When I inform {Foo}When I enter {Foo}When I type {Foo}When I fill {Foo} with "foo"When I fill {Foo} with [My Contant]When I fill <#bar> with "bar"When I fill <#bar> with 3.1415When I type "bar" in {Foo}When I type "foo" in <#bar>When I type 3.1416 in {Zoo}When I type [My Contant] in <#zoo>
hide
Hides something.
# Hides the device's keyboard - Mobile onlyWhen I hide the keyboard
install
Installs an app.
When I install the app "com.example.android.myapp"
maximize
Maximizes a window or the browser.
When I maximize the window
move
Moves the mouse cursor to a place or element.
When I move the cursor to {Foo}When I move the cursor to <#bar>When I move the cursor to {Foo} at 100, 200
open
Opens something
# Opens the device's notifications panel - Mobile onlyWhen I open the notifications panel
press
Presses a key or key combination, separated by comma.
When I press "Enter"When I press "Control", "Alt", "Delete"When I press "Control", "S"