Skip to content
This repository has been archived by the owner on Nov 15, 2020. It is now read-only.

Commit

Permalink
Merge pull request #33 from sbtqa/support-new-version-qutils
Browse files Browse the repository at this point in the history
Support new version qutils
  • Loading branch information
kosteman authored Apr 7, 2018
2 parents ae41519 + 2b335af commit bff718b
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 7 deletions.
12 changes: 9 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@
<dependency>
<groupId>ru.sbtqa.tag</groupId>
<artifactId>qa-utils</artifactId>
<version>1.2.6</version>
<version>1.3.1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>ru.sbtqa.tag</groupId>
<artifactId>allure-helper</artifactId>
<version>1.2.7</version>
<version>1.4.1</version>
<type>jar</type>
</dependency>
<dependency>
Expand All @@ -75,7 +75,7 @@
<dependency>
<groupId>ru.sbtqa.tag</groupId>
<artifactId>cucumber-runner</artifactId>
<version>1.0.6</version>
<version>1.0.10</version>
<type>jar</type>
</dependency>
<dependency>
Expand All @@ -102,6 +102,12 @@
<version>4.5.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<type>jar</type>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public class GenericStepDefs {
* @param action title value of the api entry annotation to execute
* @throws ApiException if there is an error while api entry executing
*/
@And("userSendRequestNoParams")
public void userSendRequestNoParams(String action) throws ApiException {
ApiFactory.getApiFactory().getApiEntry(action);
ApiFactory.getApiFactory().getCurrentApiEntry().fireRequest();
Expand All @@ -46,7 +45,6 @@ public void userSendRequestNoParams(String action) throws ApiException {
* @param dataTable table of parameters
* @throws ApiException if there is an error while api entry executing
*/
@And("userSendRequestTableParam")
public void userSendRequestTableParam(String action, DataTable dataTable) throws ApiException {
ApiFactory.getApiFactory().getApiEntry(action);
for (Map.Entry<String, String> dataTableRow : dataTable.asMap(String.class, String.class).entrySet()) {
Expand All @@ -64,7 +62,6 @@ public void userSendRequestTableParam(String action, DataTable dataTable) throws
* {@link ru.sbtqa.tag.apifactory.annotation.ApiValidationRule} annotation)
* @throws ApiException if there is an error while validation rule executing
*/
@And("userValidate")
public void userValidate(String rule) throws ApiException {
ApiFactory.getApiFactory().getCurrentApiEntry().fireValidationRule(rule);
}
Expand All @@ -79,7 +76,6 @@ public void userValidate(String rule) throws ApiException {
* @param dataTable table of parameters
* @throws ApiException if there is an error while validation rule executing
*/
@And("userValidateTable")
public void userValidateTable(String rule, DataTable dataTable) throws ApiException {
ApiFactory.getApiFactory().getCurrentApiEntry().fireValidationRule(rule, dataTable);
}
Expand Down
46 changes: 46 additions & 0 deletions src/main/java/ru/sbtqa/tag/apifactory/stepdefs/en/StepDefs.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package ru.sbtqa.tag.apifactory.stepdefs.en;

import cucumber.api.DataTable;
import cucumber.api.java.en.And;
import ru.sbtqa.tag.apifactory.exception.ApiException;
import ru.sbtqa.tag.apifactory.stepdefs.GenericStepDefs;


public class StepDefs extends GenericStepDefs {

/**
* {@inheritDoc}
*/
@Override
@And("^user sends request (?:for|to|about) \\((.*?)\\)$")
public void userSendRequestNoParams(String action) throws ApiException {
super.userSendRequestNoParams(action);
}

/**
* {@inheritDoc}
*/
@Override
@And("^user sends request (?:for|to|about) \\((.*?)\\) with parameters:?$")
public void userSendRequestTableParam(String action, DataTable dataTable) throws ApiException {
super.userSendRequestTableParam(action, dataTable);
}

/**
* {@inheritDoc}
*/
@Override
@And("^system returns \"([^\"]*)\"$")
public void userValidate(String rule) throws ApiException {
super.userValidate(rule);
}

/**
* {@inheritDoc}
*/
@Override
@And("^system returns \"([^\"]*)\" with parameters:?$")
public void userValidateTable(String rule, DataTable dataTable) throws ApiException {
super.userValidateTable(rule, dataTable);
}
}
46 changes: 46 additions & 0 deletions src/main/java/ru/sbtqa/tag/apifactory/stepdefs/ru/StepDefs.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package ru.sbtqa.tag.apifactory.stepdefs.ru;

import cucumber.api.DataTable;
import cucumber.api.java.bg.И;
import ru.sbtqa.tag.apifactory.exception.ApiException;
import ru.sbtqa.tag.apifactory.stepdefs.GenericStepDefs;


public class StepDefs extends GenericStepDefs {

/**
* {@inheritDoc}
*/
@Override
@И("^(?:пользователь |он |)отправляет запрос \\((.*?)\\)$")
public void userSendRequestNoParams(String action) throws ApiException {
super.userSendRequestNoParams(action);
}

/**
* {@inheritDoc}
*/
@Override
@И("^(?:пользователь |он |)отправляет запрос \\((.*?)\\) с параметрами:?$")
public void userSendRequestTableParam(String action, DataTable dataTable) throws ApiException {
super.userSendRequestTableParam(action, dataTable);
}

/**
* {@inheritDoc}
*/
@Override
@И("^система возвращает ответ \"([^\"]*)\"$")
public void userValidate(String rule) throws ApiException {
super.userValidate(rule);
}

/**
* {@inheritDoc}
*/
@Override
@И("^система возвращает ответ \"([^\"]*)\" с параметрами:?$")
public void userValidateTable(String rule, DataTable dataTable) throws ApiException {
super.userValidateTable(rule, dataTable);
}
}

0 comments on commit bff718b

Please sign in to comment.