serenity-bdd / serenity-cucumber-starter

A skeleton project for Serenity BDD and Cucumber JVM
Apache License 2.0
178 stars 280 forks source link

Not able to use the Ensure dependency #140

Closed Warren25 closed 3 months ago

Warren25 commented 4 months ago

I am trying to run the sample serenity cumber project here: https://github.com/serenity-bdd/serenity-cucumber-starter.

I have ran into an issue with the SearchStepDefinitions file. Here is the screenshot. I'm running serenity-core version 4.1.0 in the pom file. I'm not sure if I need to upgrade my serenity version or the serenity-ensure dependency in the pom file. Any help would be greatly appreciated.

Screen Shot 2024-03-18 at 3 29 07 PM Screen Shot 2024-03-18 at 5 02 15 PM
wakaleo commented 4 months ago

It's an IDE issue - sometimes clearing the cache can help.

Warren25 commented 4 months ago

@wakaleo Hi John, I chose the highlighted option in the screenshot below to help clear my cache for IntelliJ IDE. I am still presented with the same issue.

Screen Shot 2024-03-19 at 1 23 39 PM
wakaleo commented 4 months ago

Maybe raise the issue with JetBrains? Could be JVM-related? Not sure what else I can propose here - the class is present in the library, so there's not a lot more we can do on the Serenity side.

image

Warren25 commented 4 months ago

@wakaleo Thank you John for your investigation. Although this is unfortunate, is there another class from the Library that I can use similar to Ensure?

Also, may I see the import line for Ensure class? I just want to make sure I have everything correct

wakaleo commented 4 months ago

The Ensure class is pretty important. Maybe also check your dependencies or your version of IntelliJ - since the Ensure library is written in Kotlin that might have some effect.

image

Warren25 commented 4 months ago

@wakaleo My version of IntelliJ and pom file listed below of my dependencies that I copied from the starter cucumber project

Screen Shot 2024-03-19 at 2 34 18 PM

`<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0
<groupId>org.example</groupId>
<artifactId>CentralDispatch</artifactId>
<version>1.0-SNAPSHOT</version>

<name>Sample Serenity BDD project using Cucumber</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <serenity.version>4.1.0</serenity.version>
    <junit-vintage-engine.version>5.10.1</junit-vintage-engine.version>
    <junit-platform-suite.version>1.10.1</junit-platform-suite.version>
    <cucumber-junit-platform-engine.version>7.15.0</cucumber-junit-platform-engine.version>
    <encoding>UTF-8</encoding>
    <tags></tags>
    <webdriver.base.url></webdriver.base.url>
</properties>
<dependencies>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-core</artifactId>
        <version>${serenity.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-cucumber</artifactId>
        <version>${serenity.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-screenplay</artifactId>
        <version>${serenity.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-screenplay-webdriver</artifactId>
        <version>${serenity.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-ensure</artifactId>
        <version>${serenity.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-launcher</artifactId>
        <version>${junit-platform-suite.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit-platform-engine</artifactId>
        <version>${cucumber-junit-platform-engine.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-suite</artifactId>
        <version>${junit-platform-suite.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${junit-vintage-engine.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.vintage</groupId>
        <artifactId>junit-vintage-engine</artifactId>
        <version>${junit-vintage-engine.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.2.10</version>
    </dependency>
    <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>3.23.1</version>
        <scope>test</scope>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.1.2</version>
            <configuration>
                <skip>true</skip>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>3.0.0-M5</version>
            <configuration>
                <includes>
                    <include>**/*Test.java</include>
                    <include>**/Test*.java</include>
                    <include>**/*TestSuite.java</include>
                    <include>**/When*.java</include>
                </includes>
                <systemPropertyVariables>
                    <webdriver.base.url>${webdriver.base.url}</webdriver.base.url>
                </systemPropertyVariables>
                <parallel>classes</parallel>
                <parallel>methods</parallel>
                <useUnlimitedThreads>true</useUnlimitedThreads>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>integration-test</goal>
                        <goal>verify</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>net.serenity-bdd.maven.plugins</groupId>
            <artifactId>serenity-maven-plugin</artifactId>
            <version>${serenity.version}</version>
            <configuration>
                <tags>${tags}</tags>
                <reports>single-page-html</reports>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>net.serenity-bdd</groupId>
                    <artifactId>serenity-single-page-report</artifactId>
                    <version>${serenity.version}</version>
                </dependency>
            </dependencies>
            <executions>
                <execution>
                    <id>serenity-reports</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

`

wakaleo commented 4 months ago

You will need at least Java 11 for Serenity 4.x

Warren25 commented 4 months ago

@wakaleo I am using Java 18

Screen Shot 2024-03-19 at 3 01 37 PM
Warren25 commented 4 months ago

Adding this IntelliJ issue request that I created here for context: https://intellij-support.jetbrains.com/hc/en-us/requests/6189765

Warren25 commented 4 months ago

@wakaleo May I ask, what do you see here?

Screen Shot 2024-03-21 at 4 44 06 PM
Warren25 commented 4 months ago

@wakaleo And finally, last but not least, is there a command to git clone the Serenity Cucumber project? I would really like to use the Screenplay pattern and I wanted to try to create a new project by cloning instead of manually creating

Warren25 commented 3 months ago

@wakaleo This issue should be closed as I confirmed that this was an IDE issue as you said