1.1.0-beta.4 • Published 3 years ago

taclio v1.1.0-beta.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

tacl

Version

Tacl (Test Automation Controller Language) is a framework that enables the writing of complete end-to-end test automation as configurations. Tacl is simple and easy to learn.

Tacl Test consists of four modules: features, steps, elements and dataset. All four modules are defined in .tacl files that follows yaml file pattern.

Let's install tacl and run a playground test.

Installation

Tacl comes with a runner to run tacl test. The prerequisite to install tacl is node. For more information on installing Node.js, visit Node.js

To install the latest version of tacl, enter the following command

npm install -g taclio

Tacl has to be installed globally. Don't forget the -g option in the install command

Enter tacl -h to know more about the command line options.

Scaffolding Tacl Test

Once you have installed tacl, you can scaffold a tacl test by entering the following command.

tacl init

The above command will create all the base structure of the workspace and also comes with a tacl playground test. The folder structure would look like this:

tacl
├── data
│   ├── dataset.tacl
├── features
│   ├── playground.tacl
├── elements
│   ├── elements.tacl
├── steps
│   └── steps.tacl
tacl.json

Run Playground Test

Run your tacl playground test by entering the following command

tacl run

This should open Tacl Playground and run a test over all the actions and assertions currently supported by tacl.

Tacl Test

Tacl test consists of four modules: features, elements, steps, data. When you scaffolded the workspace, all these folders with a sample tacl file should have been created for you. Let's take a look into the files in details

Feature

A feature file, for example playground.tacl has the definition of the feature and scenarios that are part of the feature. A sample feature file would look like this:

name: "Tacl Playground"
description: "Tacl Playground to showcase the available actions and assertions"
scenarios:
  - name: Tacl Playground Test
    description: "Testing of Actions and Assertions in tacl playground"
    steps:
      - Given Open tacl playground
      - Then Interact with type
      - Then Interact with fill
      - Then Interact with select
....
....

Steps

A step file, for example steps.tacl contains the definition of all steps involved in a feature. It is a central place to define all steps and make them reusable in multiple scenarios. A sample step file would look like this:

# Steps can be reused in multiple scenarios
- Given: "Open tacl playground" # It's a step Then mentioned in feature file
  actions:
    - do: open $(start_url)

- Then: "Interact with type" # It's a step Then mentioned in feature file
  # Defining all actions needed to perform the step
  actions:
    - do: click type_menu
    - do: type $(simple_string) on type_simple
    - do: type $(multiline_string) on type_multiline
    - do: type $(char_string) on type_char

- Then: "Interact with fill" # It's a step Then mentioned in feature file
  actions:
    - do: click fill_menu
    - do: fill $(simple_string) on fill_simple # Values can also be variables. See dataset.tacl
    - do: fill $(multiline_string) on fill_multiline
    - do: fill $(char_string) on fill_char
    - do: assert fill_char_count
      condition: contains
      value: "4 / 5"
....
....

Elements

An element file, for example elements.tacl is the central place where all HTML elements involved in steps are declared. They can be reused in the element attribute of actions. A sample elements file will look like this:

#
# Type
#
- name: type_menu
  locator: "button[role='menuitem']:has-text('Type')"
- name: type_simple
  locator: '#mat-input-0'
- name: type_multiline
  locator: textarea
- name: type_char
  locator: "[placeholder=\"Ex\\. 12345\"]"
- name: char_count
  locator: text=4 / 5

#
# Fill
#
- name: fill_menu
  locator: "button[role='menuitem']:has-text('Fill')"
- name: fill_simple
  locator: '#mat-input-4'
- name: fill_multiline
  locator: textarea
- name: fill_char
  locator: "[placeholder=\"Ex\\. 12345\"]"
- name: fill_char_count
  locator: text=4 / 5
....
....

Dataset

A dataset file, for example dataset.tacl is the central place where all test data needed for the execution of the scenarios are declared. A sample dataset file will look like this:

variables:
  - name: simple_string
    value: Test Automation

  - name: multiline_string
    value: |-
      Tacl Testing
      This is a multiline string

  - name: char_string
    value: '1234'

  - name: start_url
    value: 'https://playground.tacl.io'

datasets:
  - name: dataset 1
    data:
      - variable: simple_string
        value: Testing with Tacl
  - name: dataset 2
    data:
      - variable: simple_string
        value: Tacl is great

Dataset is optional Dataset is an optional module. It is needed only if you want to use variables in your actions instead of a constant value.

Checkout our Documentation to start with tacl test

1.1.0-beta.2

3 years ago

1.1.0-beta.4

3 years ago

1.1.0-beta.3

3 years ago

1.1.0-beta.1

3 years ago

1.1.0-beta.0

3 years ago

1.0.21-beta

3 years ago

1.0.21-alpha

3 years ago

1.0.20-alpha

3 years ago

1.0.19-alpha

3 years ago

1.0.18-alpha

3 years ago

1.0.17-alpha

3 years ago

1.0.16-alpha

3 years ago

1.0.15-alpha

3 years ago

1.0.14-alpha

3 years ago

1.0.13-alpha

3 years ago

1.0.12-alpha

3 years ago

1.0.11-alpha

3 years ago

1.0.10-alpha

3 years ago

1.0.9-alpha

3 years ago

1.0.8-alpha

3 years ago

1.0.7-alpha

3 years ago

1.0.6-alpha

3 years ago

1.0.5-alpha

3 years ago

1.0.4-alpha

3 years ago

1.0.3-alpha

3 years ago

1.0.0-alpha

3 years ago