Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update to cucumber-jvm 7 #9

Merged
merged 1 commit into from
Apr 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
</parent>
<groupId>com.github.kripaliz</groupId>
<artifactId>unifiedbdd-automation-framework</artifactId>
<version>0.2.0</version>
<version>0.3.0</version>

<properties>
<allure.version>2.21.0</allure.version>
<appium.version>7.2.0</appium.version>
<cucumber.version>5.7.0</cucumber.version>
<cucumber.version>7.8.1</cucumber.version>
<java.version>11</java.version>
<lombok.version>1.18.26</lombok.version>
<okhttp.version>3.12.0</okhttp.version>
Expand Down Expand Up @@ -53,7 +53,7 @@
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-cucumber5-jvm</artifactId>
<artifactId>allure-cucumber7-jvm</artifactId>
<version>${allure.version}</version>
</dependency>
<dependency>
Expand Down Expand Up @@ -90,6 +90,10 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
</dependencies>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.github.kripaliz.automation.cucumber.glue;

import java.lang.reflect.Type;

import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;

import io.cucumber.java.DefaultDataTableCellTransformer;
import io.cucumber.java.DefaultDataTableEntryTransformer;
import io.cucumber.java.DefaultParameterTransformer;

/**
*
* @see https://cucumber.io/blog/open-source/announcing-cucumber-jvm-v5-0-0-rc1/
* @author kkurian
*/
public class DefaultTransformer {

private final ObjectMapper objectMapper = new ObjectMapper().registerModule(new JavaTimeModule());

@DefaultParameterTransformer
@DefaultDataTableEntryTransformer
@DefaultDataTableCellTransformer
public Object defaultTransformer(final Object fromValue, final Type toValueType) {
final JavaType javaType = objectMapper.constructType(toValueType);
return objectMapper.convertValue(fromValue, javaType);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private void handleTestStepFinished(final TestStepFinished event) {
* @return
*/
private boolean isNotOk(final TestStepFinished event) {
return !event.getResult().getStatus().isOk(true);
return !event.getResult().getStatus().isOk();
}

/**
Expand Down