Skip to content
Generate functional tests automatically from your Agile specification
TypeScript JavaScript
Branch: master
Clone or download
Latest commit 97cd057 Jan 15, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode Add tasks.json Sep 8, 2018
__tests__ Change vocabulary files and priority Jan 16, 2020
bin Renames bin/concordia to bin/concordia.js Apr 30, 2018
data Change vocabulary files and priority Jan 16, 2020
dist Change vocabulary files and priority Jan 16, 2020
docs Change vocabulary files and priority Jan 16, 2020
lib Closes #3 about fixing diacritic support in Bravey lib May 28, 2018
media Update media/concordia-init.gif Mar 11, 2019
modules Change vocabulary files and priority Jan 16, 2020
.editorconfig Files from 'src' moved to the root folder. Feb 8, 2018
.gitignore Add example of Feature in Portuguese with all the supported actions Jun 23, 2018
.travis.yml Change CI to check only with Node 8 and 12 Dec 21, 2019
CHANGELOG.md Change changelog files Apr 9, 2019
LICENSE.txt Configuration files updated. Feb 8, 2018
README.md Update readme files Sep 9, 2019
code-of-conduct.md code of conduct added. Feb 8, 2018
contributing.md Change documentation structure and content Apr 25, 2019
copy.js Remove `__tests__` from the `dist ` directory Apr 21, 2019
launch.json Adds lauch.json with debugging configuration for Jest Tests Apr 11, 2018
main.ts Add more variations of the same CLI options Jun 13, 2018
mkdocs.yml Rename .mkdocs.yml to mkdocs.yml Feb 22, 2019
package-lock.json 1.4.2 Jan 16, 2020
package.json 1.4.2 Jan 16, 2020
readme-pt.md Update readme files Sep 9, 2019
tsconfig.json Update dependencies Jun 22, 2019

README.md

Build Status npm version GitHub last commit npm slack

🌎 Translations: Português

Concordia

Generate functional tests automatically from your Agile specification.

At a glance:

  1. Write agile requirements specifications in Concordia Language.

  2. Use the Concordia Compiler to setup the testing environment for you.

  3. Use the Concordia Compiler to generate and execute functional test scripts from your Concordia specification. No coding required.

👉 Are you migrating from version 0.x to 1.x? Please read the Migration Guide.

Contents

About

Concordia is a business-readable, agile requirements specification metalanguage inspired by Gherkin. Currently it supports English and Portuguese. New languages can be added easily.

Concordia Compiler generates and executes functional test cases and test scripts from documents written in Concordia Language. It uses NLP and many other techniques in the process.

Both test cases and test scripts receive test data and test oracles. You don't have to produce them manually - they are inferred from your specification.

Concordia Compiler uses plug-ins for transforming test cases (.testcase files) into test scripts, i.e. source code, and for setting the test environment up for you. Every plug-in can generate test scripts for a different programming language and testing framework, for web, mobile, or desktop applications.

Why using it ?

  1. Simple, flexible syntax.

  2. Separate high-level, business language declarations from medium-low-level, computing language declarations, improving the communication between your team, customers, and other stakeholders. Thus, you can use a same document to discuss features with stakeholders, analysts, testers, and developers, and facilitate the adoption of BDD/ATDD/SbE.

  3. Make your specifications more useful. Get automated functional tests from your specification easily and drive your development covered by tests.

  4. Add test automation to new or legacy applications without having to write code.

  5. Generate relevant test cases and test scripts in a few milliseconds. Get tests that adopt techniques such as equivalence partitioning, boundary value analysis, combinatorial testing (n-wise), and random testing without having to think about (and invest your time in) them all.

  6. Reduce the need of writing negative scenarios (those scenarios that handle incorrect or invalid input) by describing system rules of user interface elements. Concordia supports complex, dynamic system rules.

  7. Create rules with data from files or databases and Concordia will use them for producing the test cases.

  8. Track your specification from the produced test cases and test scripts. They receive special line (code) comments that refer to the specification and the adopted testing techniques.

  9. Add test cases without coding. Write them with Concordia and let the compiler convert them into source code.

  10. Use a plain text requirements specification that is version control-friendly and can evolve with your application.

Installation

Concordia Compiler works on Windows, Linux, and MacOS, and requires NodeJS version 8 or above. If you want to test web-based applications, you also need to install Java Runtime Environment (JRE).

After installing the dependencies, open the console/terminal to execute the installation command.

1. Recommend Installation

Windows

npm install -g concordialang

Linux or MacOS

sudo npm install -g concordialang

Advanced tip: How to install globally with NPM on Linux or MacOS without sudo

Checking the installation

concordia --version

👉 Note that concordia is the command to be used from now on, which is different from concordialang (used to install).

2. Local Installation

Concordia Compiler can also be installed locally, inside your application's directory, and executed with NPX. NPX is already included in NodeJS 8.2.0 or above.

Windows, Linux or MacOS

cd my-application
npm install concordialang

However, you will need to use npx before all the Concordia commands. Example:

npx concordia --version

Getting Started

Let's create a basic, "hello world"-like example. In order to run its tests, you will need an Internet connection and the Google Chrome web browser installed.

Step 1: Create a directory

Create a directory named search and then access it using the terminal:

mkdir search
cd search

💬 Quick Tip: If you are using Windows, you may create a empty folder using Windows Explorer, open it, and then type cmd in the address bar.

Step 2: Configure

Execute the following command to guide the setup process:

concordia --init

👉 On Linux or MacOS you may need to use sudo before the command, whether your NodeJS' version is less than 8.2 or you are using Concordia 0.x.

You'll be asked about your preferences and they will be stored in a configuration file named .concordiarc. LET ALL THE DEFAULT VALUES, by typing Enter for all the questions.

Plug-ins will also be installed during the process. If you want to install them manually, please take a look at the plugins page.

Step 3: Start the test server

Test automation tools often use a test server to control a web browser, a device emulator or a real device. So, first you start a test server, then you run all the test scripts.

Since a test server usually blocks the current terminal/console, open a new terminal/console.

💬 Quick Tip: If you are using Windows, you can start a new terminal from you current directory by running:

start cmd .

Concordia Compiler facilitates to start a test server by giving you a parameter --plugin-serve. In the new terminal, run the following command:

concordia --plugin-serve

It is likely that your testing server remain open. To stop it later (not now, please), just type Ctrl + C.

Step 4: Create a feature

Create the directory features, which is the place for feature files:

mkdir features

Now use your favorite (UTF-8) text editor to create a file named search.feature, inside the directory features, with the following content:

Feature: Search
  As a visitor
  I would like to search using keywords
  In order to find what I need

Scenario: Search returns the expected result
  Given that I am in the search screen
  When I enter with the search content
    and I choose the search option
  Then I see a result that matches the search content

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

Feature and Scenario are high-level, business-focused descriptions about the problem to solve. A Variant describes the expected interaction with the application's user interface in order to perform a Scenario. Thus, a Variant uses a more technological vocabulary.

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

Step 5: Execute

In the search directory, just execute:

concordia

Congratulations!

Concordia Compiler will:

  • setup the testing environment;
  • generate a test case;
  • transform the test case into a test script;
  • execute the test script; and
  • report the test script result.

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

Some generated files:

features/search.testcase, that will contain the produced test case:

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

import "search.feature"

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

In the example above, there is a Test Case generated from the Variant declared in search.feature. The import clause imports that file's content. The tag @generated indicates that the Test Case was produced automatically, while the tags @scenario and @variant refers to its Scenario and Variant by their positions (indexes).

test/search.js, that will contain the test script produced from features/search.testcase for the framework CodeceptJS with WebDriverIO:

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

Feature("Search");

Scenario("Search returns the expected result | Search content on pressing Enter - 1", (I) => {
    I.amOnPage("https://google.com"); // (10,5)
    I.fillField("q", "concordialang.org"); // (11,5)
    I.pressKey("Enter"); // (12,7)
    I.see("npm"); // (13,5)
});

To generate and run the test again, just repeat the last command.

👉 Remember, this is just a "hello word". Concordia has much more to offer!

See Next

Related Projects

  • katalon-concordia: browser extension for Chrome and Firefox that converts recordings from Katalon Recorder to Concordia Language. It's very useful for discovering the elements' identification in web applications (e.g., their id properties or their XPath).

  • concordialang-codeceptjs-webdriverio: plug-in to generate and execute test scripts for CodeceptJS and WebDriverIO. Use it to test web applications.

  • concordialang-codeceptjs-appium: plug-in to generate and execute test scripts for CodeceptJS and Appium. Use it to test mobile or desktop applications.

Contributing

  • Did you liked it? Give it a Star ⭐ on GitHub
  • Help translating the documentation. You may create a Fork and submit a Pull Request with any translated documents. Partial translations also help us a lot!
  • Chat with us on Slack or open an Issue with a question or suggestion.
  • Report bugs or typos.
  • Create a new plug-in for your favorite programming language or testing framework or develop Concordia with us.
  • Include this badge in your project's page → Concordia e2e
    [![Concordia e2e](https://img.shields.io/badge/e2e-concordia-brightgreen.svg)](http://concordialang.org)
    

License

AGPL © Thiago Delgado Pinto

GNU Affero General Public License version 3

You can’t perform that action at this time.