grasshopper7 / extentreports-cucumber7-adapter

Cucumber-JVM 7 Adapter for Extent Framework
https://ghchirp.online/3196/
MIT License
17 stars 7 forks source link

404 Not Found #6

Closed OmarElfatatry closed 2 years ago

OmarElfatatry commented 2 years ago

After generating the report and trying to open it in the chrome browser from IntelliJ IDE it gives me the error "404 Not Found" and the URL is like this

http://localhost:63342/Cucumber_Try%20-%20Copy/Cucumber_Try/target/Report.html?_ijt=s1lilo6mimu3mtjk5vhm1evv0s&_ij_reload=RELOAD_ON_SAVE

But if I try to open it from windows explorer it's working as intended and the URL is

file:///C:/Users/OmarTarek/Pictures/Cucumber_Try%20-%20Copy/target/Report.html

So why I can't open it directly from IntelliJ? please help me and thank you

grasshopper7 commented 2 years ago

What happens when you open chrome window (or any other browser) and paste the url? Also what are the parameters in the URL, is it appended by intellij?

OmarElfatatry commented 2 years ago

Thank you for your fast reply If I paste this URL in a browser that is opened when I right-click on the report in IntelliJ (Open in --> browser --> chrome)

http://localhost:63342/Cucumber_Try%20-%20Copy/Cucumber_Try/target/Report.html?_ijt=s1lilo6mimu3mtjk5vhm1evv0s&_ij_reload=RELOAD_ON_SAVE

The same error appeared to me "404 Not Found", but if I try to open it from windows explorer it's working as intended

grasshopper7 commented 2 years ago

There is a difference between the two paths. Maybe it is some configuration. Are u running a web server at this port? I am not that familiar with intellij.

OmarElfatatry commented 2 years ago

I didn't run any webserver and this is the extent.properties file

extent.reporter.html.start=true

extent.reporter.html.config=src/test/resources/html-config.xml

extent.reporter.html.out=target/Report.html

And this is the html-config.xml file

<?xml version="1.0" encoding="UTF-8"?>

dark UTF-8 https HTML Extent GhChirp Report true top true true true true true true

And finally, this is the pom.xml file

<?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>Cucumber_Try</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
    <maven.compiler.source>8</maven.compiler.source>
    <maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>4.1.1</version>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-testng</artifactId>
        <version>7.2.3</version>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>7.2.3</version>
    </dependency>
    <dependency>
        <groupId>tech.grasshopper</groupId>
        <artifactId>extentreports-cucumber7-adapter</artifactId>
        <version>1.3.0</version>
    </dependency>
</dependencies>

grasshopper7 commented 2 years ago

This looks correct. Can u generate the spark report which is also html based. Check if it works from intellij

OmarElfatatry commented 2 years ago

Unfortunately I generate it and I get the same error

OmarElfatatry commented 2 years ago

Anyways, could you please help me take screenshots for failed scenarios inside the report?

OmarElfatatry commented 2 years ago

Sir how to configure "screenshot.rel.path" if the HTML report and the screenshots are in the same directory?

grasshopper7 commented 2 years ago

Add screenshot.rel.path=./

OmarElfatatry commented 2 years ago

Alright, thanks man it's working. By the way, the HTML 404 error is fixed when I try it for another project and it's working right now correctly so it's seemed that's there's something wrong related to this only specific project as it's working for any new project.

OmarElfatatry commented 2 years ago

😁