vendredi 28 août 2020

Karate software - simple if condition is not working in 0.9.6

Using Karate Software framework, I have problem with new released version (0.9.6). I have problems with simple IF condition

* if (locate('{h6}' + appName).exists) karate.call('classpath:ui/common/applicationDeletion.feature')

This condition works properly in version 0.9.5. But with last release there is error announced when the feature is run:

evaluation (js) failed: if (locate('{h6}' + appName).exists) karate.call('classpath:ui/common/applicationDeletion.feature'), java.lang.RuntimeException: cannot find locator: {h6}stx-fat-app-tst
stack trace: com.intuit.karate.driver.Driver.locate(Driver.java:275)
 ==> expected: <true> but was: <false>

It seems there is some change between versions 0.9.5 and 0.9.6. I would expect that the condition is FALSE, karate call will not be executed (skipped) and following code will be followed.

Could you please give me some hint why it is not working?

Thank you!

POM file

<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">
    <modelVersion>4.0.0</modelVersion>
 
    <groupId>testing</groupId>
    <artifactId>ssp-uc-tests</artifactId>
    <version>0.0.1</version>
    <packaging>jar</packaging>
 
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <maven.compiler.version>3.6.0</maven.compiler.version>
        <karate.version>0.9.6</karate.version>
    </properties>    

    <dependencies>
        <dependency>
            <groupId>com.intuit.karate</groupId>
            <artifactId>karate-apache</artifactId>
            <version>0.9.6</version>
            <scope>test</scope>
        </dependency>            
        <dependency>
            <groupId>com.intuit.karate</groupId>
            <artifactId>karate-junit5</artifactId>
            <version>0.9.6</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.4.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>net.masterthought</groupId>
            <artifactId>cucumber-reporting</artifactId>
            <version>5.3.1</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/java</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.version}</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <compilerArgument>-Werror</compilerArgument>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M5</version>
            </plugin>            
        </plugins>        
    </build>       
    
</project>

Aucun commentaire:

Enregistrer un commentaire