Skip to content

Commit

Permalink
Merge pull request #508 from jdi-testing/update_cucumber
Browse files Browse the repository at this point in the history
Update Cucumber version to 7.10.1
  • Loading branch information
pnatashap authored Jan 6, 2023
2 parents 593ea2e + 6c512d5 commit db46934
Show file tree
Hide file tree
Showing 19 changed files with 101 additions and 131 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Compile jdi code
id: jdi-compile
run: mvn clean install -DskipTests -Dsource.skip -Dmaven.source.skip -Dmaven.javadoc.skip=true
run: mvn clean install -DskipTests -Dsource.skip -Dmaven.source.skip -Dmaven.javadoc.skip=true -ntp

- name: Run tests - BDD
id: testsBdd
Expand Down
36 changes: 36 additions & 0 deletions clean_trello_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import requests

query = {
'key': '3445103a21ddca2619eaceb0e833d0db',
'token': 'a9b951262e529821308e7ecbc3e4b7cfb14a24fef5ea500a68c69d374009fcc0'
}

def get_boards():
url = "https://api.trello.com/1/members/me/boards"

response = requests.request(
"GET",
url,
params=query
)
return response.json()

def clean_board(board_id):
url = "https://api.trello.com/1/boards/"

response = requests.request(
"DELETE",
url+board_id,
params=query
)

def clean_boards():
board_list = get_boards()
for board in board_list:
print(board)
clean_board(board['id'])

# run in case of error that user have too many boards
if __name__ == '__main__':
clean_boards()

51 changes: 25 additions & 26 deletions jdi-dark-bdd-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,43 @@
<groupId>com.epam.jdi</groupId>
<artifactId>jdi-dark-bdd-tests</artifactId>
<name>JDI Dark BDD Tests</name>
<version>1.1.12</version>
<version>1.1.13</version>

<properties>
<includeTags>@smoke</includeTags>
<excludeTags>@skip</excludeTags>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<aspectj.version>1.9.5</aspectj.version>
<allure.maven.version>2.10.0</allure.maven.version>
<allure.cucumber.jvm.version>2.13.1</allure.cucumber.jvm.version>
<allure.common.version>2.13.1</allure.common.version>
<allure.common.version>2.20.1</allure.common.version>
<junit.version>4.12</junit.version>
<surefire.version>2.22.2</surefire.version>
<jdi.dark.bdd.version>1.1.12</jdi.dark.bdd.version>
<!-- - - add-opens java.base/java.lang=ALL-UNNAMED is needed for JDK 16+ -->
<surefire.version>3.0.0-M7</surefire.version>
<jdi.dark.version>1.1.13</jdi.dark.version>
<cucumber.version>7.10.1</cucumber.version>
<!-- use jdk16 profile for JDK 16+ -->
<aspectj.args></aspectj.args>
</properties>

<profiles>
<profile>
<id>jdk16</id>
<properties>
<aspectj.args>--add-opens java.base/java.lang=ALL-UNNAMED</aspectj.args>
</properties>
</profile>
</profiles>

<dependencies>
<!--JDI-->
<dependency>
<groupId>com.epam.jdi</groupId>
<artifactId>jdi-dark-bdd</artifactId>
<version>${jdi.dark.bdd.version}</version>
<version>${jdi.dark.version}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
Expand All @@ -37,8 +50,8 @@
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-cucumber4-jvm</artifactId>
<version>${allure.cucumber.jvm.version}</version>
<artifactId>allure-cucumber7-jvm</artifactId>
<version>${allure.common.version}</version>
</dependency>
</dependencies>
<build>
Expand All @@ -57,26 +70,12 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<failIfNoTests>true</failIfNoTests>
<systemPropertyVariables>
<allure.results.directory>${project.build.directory}/allure-results</allure.results.directory>
</systemPropertyVariables>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<!-- testFailureIgnore>true</testFailureIgnore -->
<argLine>
${aspectj.args}
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
-Dcucumber.options="--plugin io.qameta.allure.cucumber4jvm.AllureCucumber4Jvm"
</argLine>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>io.qameta.allure</groupId>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

15 changes: 15 additions & 0 deletions jdi-dark-bdd-tests/src/test/java/httptests/CucumberTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package httptests;

import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
@CucumberOptions(
features = "classpath:features",
glue = {"httptests/steps", "com/epam/jdi/http/stepdefs/en"},
plugin = {"io.qameta.allure.cucumber7jvm.AllureCucumber7Jvm"}
)
public class CucumberTest {

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.epam.jdi.httptests.steps;
package httptests.steps;

import com.epam.jdi.services.ServiceExample;
import io.cucumber.java.en.Given;
Expand Down
9 changes: 0 additions & 9 deletions jdi-dark-bdd-tests/src/test/resources/testng.xml

This file was deleted.

29 changes: 6 additions & 23 deletions jdi-dark-bdd/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
<name>JDI Dark BDD</name>
<description>BDD add-in for JDI Dark</description>
<url>http://jdi.epam.com/</url>
<version>1.1.12</version>
<version>1.1.13</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<cucumber.version>4.8.1</cucumber.version>
<junit.version>4.13.1</junit.version>
<testng.version>7.1.0</testng.version>
<jdi.dark.version>1.1.12</jdi.dark.version>
<cucumber.version>7.10.1</cucumber.version>
<jdi.dark.version>1.1.13</jdi.dark.version>
<gpg.key></gpg.key>
</properties>

Expand All @@ -26,30 +24,15 @@
<artifactId>jdi-dark</artifactId>
<version>${jdi.dark.version}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-testng</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
<groupId>io.cucumber</groupId>
<artifactId>gherkin</artifactId>
<version>26.0.2</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void performRequest(String methodName) throws IllegalAccessException, NoS
public void setRequestHeaders(DataTable headers) {
preparedHeader.set(null);
HashMap<String, String> hashMap = new HashMap<>();
for (Map.Entry<Object, Object> entry : headers.asMap(String.class, String.class).entrySet()) {
for (Map.Entry<String, String> entry : headers.asMap(String.class, String.class).entrySet()) {
hashMap.put((String) entry.getKey(), (String) entry.getValue());
}
preparedHeader.set(hashMap);
Expand Down
2 changes: 1 addition & 1 deletion jdi-dark-rest-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>
<groupId>com.epam.jdi</groupId>
<artifactId>jdi-dark-rest-service</artifactId>
<version>1.1.12</version>
<version>1.1.13</version>
<name>JDI Dark REST Service</name>
<description>Bookstore API project for JDI Dark</description>
<packaging>jar</packaging>
Expand Down
4 changes: 2 additions & 2 deletions jdi-dark-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.epam.jdi</groupId>
<version>1.1.12</version>
<version>1.1.13</version>
<artifactId>jdi-dark-tests</artifactId>
<name>JDI Dark Tests</name>

Expand All @@ -14,7 +14,7 @@
<allure.maven>2.10.0</allure.maven>
<aspectj.version>1.9.5</aspectj.version>
<suiteXML.file>general.xml</suiteXML.file>
<jdi.dark.version>1.1.12</jdi.dark.version>
<jdi.dark.version>1.1.13</jdi.dark.version>
<maven.dep.version>3.2.0</maven.dep.version>
<!-- - - add-opens java.base/java.lang=ALL-UNNAMED is needed for JDK 16+ -->
<aspectj.args></aspectj.args>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
import java.util.HashMap;
import java.util.Map;

import static com.epam.http.requests.RequestDataFactory.cookies;
import static com.epam.http.requests.RequestDataFactory.body;
import static com.epam.http.requests.RequestDataFactory.*;
import static com.epam.http.requests.ServiceInit.init;
import static com.epam.jdi.services.JettyService.getJsonStore;
import static io.restassured.config.JsonConfig.jsonConfig;
Expand Down Expand Up @@ -63,7 +62,7 @@ public void getCanReturnBodyAsString() {

@Test
public void whenParamsSpecifiedCanReturnBodyAsString() {
RestResponse response = JettyService.postGreetXml.call(body("firstName=John&lastName=Doe&"));
RestResponse response = JettyService.postGreetXml.queryParams("firstName=John&lastName=Doe").call();
final String body = response.getBody();
assertEquals("<greeting><firstName>John</firstName>\n" +
" <lastName>Doe</lastName>\n" +
Expand All @@ -80,7 +79,7 @@ public void whenNoExpectationsDefinedThenGetCanReturnAStringAsByteArray() {

@Test
public void postCanReturnBodyAsString() {
final String body = JettyService.postGreetXml.call(body("firstName=John&lastName=Doe")).getBody();
final String body = JettyService.postGreetXml.queryParams("firstName=John&lastName=Doe").call().getBody();
assertEquals("<greeting><firstName>John</firstName>\n" +
" <lastName>Doe</lastName>\n" +
" </greeting>", body);
Expand Down Expand Up @@ -149,7 +148,7 @@ public void usingJsonPathViewFromTheResponse() {

@Test
public void usingXmlPathViewFromTheResponse() {
final String firstName = JettyService.postGreetXml.call(body("firstName=John&lastName=Doe"))
final String firstName = JettyService.postGreetXml.queryParams("firstName=John&lastName=Doe").call()
.getRaResponse().xmlPath().getString("greeting.firstName");
assertThat(firstName, equalTo("John"));
}
Expand All @@ -174,7 +173,7 @@ public void usingPathWithContentTypeJsonFromTheResponse() {

@Test
public void usingPathWithContentTypeXmlFromTheResponse() {
String firstName = JettyService.postGreetXml.call(body("firstName=John&lastName=Doe"))
String firstName = JettyService.postGreetXml.queryParams("firstName=John&lastName=Doe").call()
.getRaResponse().path("greeting.firstName");
assertThat(firstName, equalTo("John"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import static com.epam.http.requests.RequestDataFactory.*;
import static com.epam.http.requests.ServiceInit.init;
import static com.epam.jdi.services.JettyService.*;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.testng.Assert.assertEquals;

/**
Expand Down Expand Up @@ -61,6 +61,6 @@ public void bodyHamcrestMatcherWithOutKey() {
@Test
public void deleteSupportsStringBody() {
RestResponse response = deleteBody.call(body(TEST_BODY_VALUE));
response.assertThat().body(is(TEST_BODY_VALUE));
response.assertThat().body(containsString(TEST_BODY_VALUE));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void before() {
init(GeoServices.class);
}

@Test
@Test(enabled = false)
public void checkGeocodeAddressNonParsed() {
GeocodeAddressNonParsedResponse response = GeoServices.geocodeAddressNonParsed.callSoap(new GeocodeAddressNonParsed()
.withStreetAddress("9355 Burton Way")
Expand All @@ -41,7 +41,7 @@ public void checkGeocodeAddressNonParsed() {
CensusYear.TWO_THOUSAND_TEN, CensusYear.TWO_THOUSAND_TWENTY));
}

@Test
@Test(enabled = false)
public void checkGeocodeAddressNonParsed12() {
GeocodeAddressNonParsedResponse response = GeoServices.geocodeAddressNonParsed12.callSoap(new GeocodeAddressNonParsed()
.withStreetAddress("9355 Burton Way")
Expand Down
Loading

0 comments on commit db46934

Please sign in to comment.