Featuredefines a desired behavior for the software, a piece of functionality that gives some business value. A
Scenariois a high-level usage scenario of a
Feature. A Feature can have many Scenarios.
As a <role>
I would like to <goal to perform>
In order to <received benefit>(or
So that <received benefit>)
Given <some context or precondition>
When <some action is carried out>
Then <a result or postcondition is observed>
.feature. Only one feature per file is allowed.
Variantis a test-oriented declaration that describes a possible interaction between a user and the system in order to accomplish a
Scenario. You can write more than one
Variantfor a same
Variantmust use the GWT template and first person singular ("
I") in its sentences. Concordia Compiler uses Natural Language Processing (NLP) techniques to understand
Variantsentences, aiming to transform them into test cases. Example:
<#email>. Concordia adopts the well-known CSS query selectors to locate widgets, regardless the user interface (its plugins convert them to the format adopted by the testing framework). You can also use XPath (although some plug-ins may not accept it). Examples:
#(hashtag) to find a widget by its id. Example:
.(dot) to find a widget by its class, if applicable. Example:
@(at) to find a widget by its name. Example:
~(tilde) to find a widget by its mobile name, if applicable. Example:
//(double slash) to find a widget by its XPath. Example:
Then) sentences with a produced State; and
When) sentences with a required State by sentences from the Variant that can produce it.
Test Caserepresents a test case produced for a certain
Variant. Concordia Compiler can generate many
Test Casedeclarations from a same
Variant, each one covering different states, input combinations and oracles. The generation considers the following declarations:
Test Caseis one whose sentences are exactly equal to the
Variant's. That's the case when the Variant does not use other declarations and it explicits all the input test data to use.
with "Bob"from the sentence
When I fill <#name> with "Bob", Concordia Compiler will generate a pseudo-random value to complete the sentence, and it will be like this:
When I fill <#name> with "A~!39esljdns so2u1 *ns%".
--seed. By setting the seed, the compiler will pick the same paths and produce the same values - which is desirable for reproducing the same behavior in the application under test, but not for discovering new defects.
UI Elementrepresents a user interface element and can denote its expected behavior through properties.
UI Elementoffers properties that can describe the behavior related to it. These properties are used to infer the test data and test oracles to generate.
locator⇨ how to locate the widget
type⇨ widget type, like
editable⇨ whether the UI Element is editable (or not)
data type⇨ data type of an
required⇨ whether the UI Element is required (or not)
format⇨ data format, denoted by a regular expression
value⇨ defines how the value is produced
minimum value⇨ defines how the minimum value is produced
maximum value⇨ defines how the maximum value is produced
minimum length⇨ defines how the minimum length is produced
maximum length⇨ defines how the maximum length is produced
locatorequal to the UI Element name in camelCase (e.g., "Net Price" becomes "netPrice"). The adopted case is configurable.
data typeequal to
Importdeclaration allows you to import declarations from another
Constantsblock defines one or more constants. Every Constant holds an immutable value that is accessible through the declared name. Example:
UI Elementproperties and
Tabledeclares values in rows and columns to use in UI Element properties. Example:
]. Its table or view names are separated by a dot (
.). Database names are global and share the same namespace as Tables and Constants.
Before Each Scenario: executes before every test of each Scenario of the current Feature.
After Each Scenario: executes after every test of each Scenario of the current Feature.
Before Feature: executes once, before all the tests of the current Feature.
After Feature: executes once, after all the tests of the current Feature.
Before All: executes once, before all the tests of the application under test.
After All: executes once, after all the tests of the application under test.
Whenin most sentences. Example: