2.0.0-alpha.20 β€’ Published 2 years ago

concordialang v2.0.0-alpha.20

Weekly downloads
8
License
AGPL-3.0
Repository
github
Last release
2 years ago

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

2.0.0-alpha.19

2 years ago

2.0.0-alpha.20

2 years ago

2.0.0-alpha.18

3 years ago

2.0.0-alpha.17

3 years ago

2.0.0-alpha.16

3 years ago

2.0.0-alpha.15

3 years ago

2.0.0-alpha.14

3 years ago

2.0.0-alpha.13

3 years ago

2.0.0-alpha.12

3 years ago

2.0.0-alpha.11

3 years ago

2.0.0-alpha.10

3 years ago

2.0.0-alpha.9

4 years ago

2.0.0-alpha.8

4 years ago

2.0.0-alpha.7

4 years ago

2.0.0-alpha.6

4 years ago

2.0.0-alpha.5

4 years ago

2.0.0-alpha.4

4 years ago

1.4.8

4 years ago

2.0.0-alpha.3

4 years ago

2.0.0-alpha.2

4 years ago

1.4.7

4 years ago

1.4.6

4 years ago

1.4.5

4 years ago

2.0.0-alpha.1

4 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0-rc.1

4 years ago

1.3.3

4 years ago

1.4.0

4 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

0.100.3

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

1.0.0-alpha.0

5 years ago

0.100.2

5 years ago

0.100.1

5 years ago

0.100.0

5 years ago

0.99.1

5 years ago

0.99.0

5 years ago

0.98.0

5 years ago

0.97.1

5 years ago

0.97.0

5 years ago

0.96.3

5 years ago

0.96.2

5 years ago

0.96.1

5 years ago

0.96.0

5 years ago

0.95.1

5 years ago

0.95.0

5 years ago

0.94.10

5 years ago

0.94.9

6 years ago

0.94.8

6 years ago

0.94.7

6 years ago

0.94.6

6 years ago

0.94.5

6 years ago

0.94.4

6 years ago

0.94.3

6 years ago

0.94.2

6 years ago

0.94.1

6 years ago

0.94.0

6 years ago

0.93.1

6 years ago

0.93.0

6 years ago

0.92.1

6 years ago

0.92.0

6 years ago

0.91.0

6 years ago

0.90.1

6 years ago

0.90.0

6 years ago

0.89.0

6 years ago

0.88.5

6 years ago

0.88.4

6 years ago

0.88.3

6 years ago

0.88.2

6 years ago

0.88.1

6 years ago

0.88.0

6 years ago

0.87.1

6 years ago

0.87.0

6 years ago

0.86.2

6 years ago

0.86.1

6 years ago

0.86.0

6 years ago

0.85.2

6 years ago

0.85.0

6 years ago

0.84.2

6 years ago

0.84.1

6 years ago

0.84.0

6 years ago

0.83.2

6 years ago

0.83.1

6 years ago

0.83.0

6 years ago

0.82.0

6 years ago

0.81.3

6 years ago

0.81.2

6 years ago

0.81.1

6 years ago

0.81.0

6 years ago

0.80.1

6 years ago

0.80.0

6 years ago

0.79.0

6 years ago

0.78.4

6 years ago

0.78.3

6 years ago

0.78.2

6 years ago

0.78.1

6 years ago

0.78.0

6 years ago

0.77.1

6 years ago

0.77.0

6 years ago

0.76.2

6 years ago

0.76.1

6 years ago

0.76.0

6 years ago

0.75.0

6 years ago

0.74.3

6 years ago

0.74.2

6 years ago

0.74.1

6 years ago