✔️
Concordia
  • Quick Start
  • Introduction
    • Understanding Concordia
    • Overview of the Language
    • A Small Example
    • Using a Plug-in
    • Using Databases
    • Command Line Interface
    • Configuration file
    • Related things
  • Language
    • Concordia Language
    • Actions
  • How It Works
    • Overview
    • Test Coverage and Techniques
  • Upgrade
    • How to Upgrade
    • Migration Guide
    • Breaking Changes
    • What's Next
  • Development
    • Creating a Plug-in
    • Actions vs APIs
    • Language Additions
Powered by GitBook
On this page
  • Notes on installation options
Export as PDF

Quick Start

NextUnderstanding Concordia

Last updated 3 years ago

Welcome to the Concordia 2 documentation! This page will help you to get started fast. If you run into problems, you can find help on our .

See in case you don't know it yet.

System Requirements

Concordia Compiler requires only version 12.20 (or above) and works on Linux, MacOS and Windows.

In this Quick Start, we'll create a simple specification of an interaction with a search page and use . Therefore, download it before continuing.

Step 0: Initialize

If you are starting a new project or whether your project does not have a file named package.json, then run:

npm init --yes

You can use NPM, Yarn or PNPM.

Step 1: Install

Install Concordia Compiler :

npm i -D concordialang

It will install version 2 that is in alpha stage, although stable.

Note that the needed package name is concordialang (with lang). After installing it, we'll always use npx concordia to execute it.

Step 2: Configure

npx concordia --init

Step 3: Create a feature

Create the folderfeatures :

mkdir features

Now create the file search.feature withinfeatures, with the following content:

Feature: Search

Scenario: Shows results that correspond to the term

  Variant: Search by pressing Enter
    Given that I am on "https://google.com"
    When I type "concordialang" in <q>
      And I press "Enter"
      And I wait for 2 seconds
    Then I see "npm"

About the file:

  • Feature and Scenario are high-level, business-focused descriptions about the problem to solve. Their sentences are not used to generate test cases. The above example does not describe them.

  • A Variant describes the expected interaction with the application's user interface (UI) in order to perform a Scenario. Thus, a Variant uses technological vocabulary.

  • In Concordia, all the interactions with the UI use first person singular ("I"). That "I" represents the actor that is interacting with the application (in the example above, a visitor).

Step 4: Execute

Finally, run

npx concordia

It will:

  • set the testing environment up (once);

  • generate a test case file and transformed it into a test script file;

  • execute the test script file; and

  • report the test script results.

Your browser should open automatically during this process and the console will report the execution results.

Your directory should now look like this:

 ┃
 ┣ features/          
 ┃ ┣ search.feature
 ┃ ┗ search.testcase     🡐 generated test case
 ┣ node_modules/
 ┣ test/              
 ┃ ┗ search.js           🡐 generated test script
 ┣ .concordiarc
 ┣ codecept.json
 ┣ package.json  
 ┗ package-lock.json

The file features/search.testcase should look like this:

# Generated with ❤ by Concordia
#
# THIS IS A GENERATED FILE - MODIFICATIONS CAN BE LOST !

import "search.feature"

@generated
@scenario(1)
@variant(1)
Test Case: Search by pressing Enter - 1
  Given that I am on "https://google.com"
  When I type "concordialang.org" in <q>
    And I press "Enter"
    And I wait for 2 seconds
  Then I see "npm"

The Test Case above was produced from the Variant declared in features/search.feature. Some notes about it:

  • The import clause (line 5) imports the declared file's content.

  • The tag @generated (line 7) indicates that the Test Case was produced automatically.

  • The tag @scenario(1) (line 8) indicates that the Test Case belongs to the first Scenario (1).

  • The tag @variant(1) (line 9) indicates that the Test Case belongs to the first Variant (1) of the Scenario declared previously.

  • The Test Case (line 10) is named using the Variant's name plus dash (-) and some (incremental) number. Its content is basically the same as the Variant's, since we did not use any other declarations.

The file test/search.js contains the test script produced from features/search.testcase using the selected plug-in. It also contains line comments with references to their corresponding lines and columns in the .testcase file:

// Generated with ❤ by Concordia
// source: search.testcase
//
// THIS IS A GENERATED FILE - MODIFICATIONS CAN BE LOST !

Feature("Search");

Scenario("Shows results that correspond to the term | Search by pressing Enter - 1", (I) => {
    I.amOnPage("https://google.com"); // (11,2)
    I.fillField("q", "concordialang.org"); // (12,2)
    I.pressKey("Enter"); // (13,4)
    I.wait(2); // (14,4)
    I.see("npm"); // (15,2)
});

Notes on installation options

You can opt to install Concordia Compiler locally (per project) or globally.

Local installation (recommended)

  • does not require administrative privileges (i.e., using sudo on Linux or MacOS) to install;

  • allows every project to have its own, independent installation;

Global installation

  • requires administrative privilegies (i.e., using sudo on Linux or MacOS) to install;

  • lets you execute the compiler direcly from any folder;

  • needs more attention when upgrading, especially for plug-ins.

Example:

sudo npm install -g concordialang
concordia --version

Note: On Windows, you must omit sudo.

Additional tips:

  • Whether Windows requires administrative privileges to install, right click Windows (Start) menu, click "Command Prompt (Admin)" or alternatively "Windows PowerShell (Admin)", and then proceed with the installation command.

  • To upgrade Concordia later, change the installation command from install to upgrade.

Concordia Compiler will ask you about some preferences. Press Enter to answer every question with their default values. It will create a configuration file named .concordiarc and install the selected and .

That's it. Congratulations!

The directory node_modules contains installed dependencies, like tools and frameworks, whose versions are managed with package.json and package-lock.json. The file codecept.json has a basic configuration to run CodeceptJS with Google Chrome and you can to fit your needs.

Concordia Compiler can also generate and for you. All the test cases and test scripts receive line comments that detail the and reference declarations used to produce oracles and test data.

demands using before every command.

Follow the for a install installation.

is included in NodeJS 8.2.0 or above.

.

✨
✨
plug-in
database drivers
change it
test data
test oracles
kind of data test case being explored
NPX
Quick Start
NPX
How to install globally with NPM on Linux or MacOS without sudo
Slack channel
Understanding Concordia
NodeJS
Google Chrome
locally