Intents

step defs abstraction for cucumber jvm implementation

Лицензия

Лицензия

Категории

Категории

Ant Компиляция и сборка Vagrant Контейнер Виртуализация
Группа

Группа

com.testvagrant.intents
Идентификатор

Идентификатор

intents
Последняя версия

Последняя версия

2.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

Intents
step defs abstraction for cucumber jvm implementation
Ссылка на сайт

Ссылка на сайт

https://github.com/testvagrant/intents
Система контроля версий

Система контроля версий

https://github.com/testvagrant/intents

Скачать intents

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.testvagrant.intents/intents/ -->
<dependency>
    <groupId>com.testvagrant.intents</groupId>
    <artifactId>intents</artifactId>
    <version>2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.testvagrant.intents/intents/
implementation 'com.testvagrant.intents:intents:2.0'
// https://jarcasting.com/artifacts/com.testvagrant.intents/intents/
implementation ("com.testvagrant.intents:intents:2.0")
'com.testvagrant.intents:intents:jar:2.0'
<dependency org="com.testvagrant.intents" name="intents" rev="2.0">
  <artifact name="intents" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.testvagrant.intents', module='intents', version='2.0')
)
libraryDependencies += "com.testvagrant.intents" % "intents" % "2.0"
[com.testvagrant.intents/intents "2.0"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
com.google.guava : guava jar 22.0
org.reflections : reflections jar 0.9.11
com.google.code.gson : gson jar 2.8.1
com.testvagrant.optimus-commons : optimus-commons jar 3.0

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.11
org.mockito : mockito-core jar 2.8.47

Модули Проекта

Данный проект не имеет модулей.

INTENT

An Intent is a small reusable action, similar to a scenario. However, it has no purpose, if it isn't used in a context.

NOTE: Intents feature is not compatiable with Java8 step definitions

Eg:

      @Intent
      Scenario: Login
      Given User enters username as JohnNash
      And User enters password as NashJohn
      When User clicks on submit
      Then User is navigated to HomeScreen

Usage:

     Scenario: Book a cab
     Given  Intent: Login
     When  I enter to and from locations
     And   I click on BookACab
     Then  I should receive a booking confirmation

Sometimes it is needed to override default values as in the above example user would like to login other than 'JohnNash'. It is possible to modify the default values of Intent as below. Usage:

     Scenario: Book a cab
     Given   DataIntent: Login
     |Admin|pass@123|
     When I enter to and from locations
     And  I click on BookACab
     Then I should receive a booking confirmation

Using intent in code:

     String intentId = "Login";
     intentRunner(intentId).run();

If the default data is overridden, pass the datatable object to intent runner.

     String intentId = "Login";
     intentRunner(intentId).useDatatable(datatable).run();

If the step definitions are created in a package apart form the standard com.testvagrant.intents.steps package, you can let Intent know about it as below.

     String intentId = "Login";
     String stepDefinitionsPackage = "com.example.exampleStepsPackage";
     intentRunner(intentId)
     .useDatatable(datatable)
     .locateStepDefinitionsAt(stepDefinitionsPackage)
     .run();

Suggested Usage :

  • Intents are like the helper methods, though they look like Scenarios, it is adviced that they aren't executed as a scenario.

  • Choose any convenient tagname for Intents and ignore them while running Cucumber Features using ~.

    Eg: In cucumber command line options pass

      --tags, "~@Intent"
    
  • Create a common step definition matching your Intent and DataIntent.

    Eg: For an Intent, the step definition can be

      @Given("^(Intent):(.*)$")
      public void intent(String action, String intentId) throws Throwable {
          intentRunner(intentId).run();
      }
    

    Eg: For a DataIntent, the step definition can be

      @Given("^(DataIntent):(.*)$")
      public void intentWithDataTable(String action, String intentId, DataTable dataTables) throws Throwable {
          intentRunner(intentId).useDatatable(dataTables).run();
      }
    
com.testvagrant.intents

TestVagrant Technologies

Версии библиотеки

Версия
2.0
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0