GithubHelp home page GithubHelp logo

Comments (9)

SpacialCircumstances avatar SpacialCircumstances commented on June 14, 2024 1

@purnimashanti I'm not exactly sure if I'm understanding you right, but if you're talking about the code snippet commented by me above, your configuration should look like this:

cucumberReports { 
    outputDir = file('html-report')
    buildId = '0'
    reports = files('target/cucumber/cucumber.json')
    testTasksFinalizedByReport = false
}

from gradle-cucumber-reporting.

SpacialCircumstances avatar SpacialCircumstances commented on June 14, 2024 1

@purnimashanti Yes, that would be the correct way, causing the reports to be generated after the tests are run.

from gradle-cucumber-reporting.

SpacialCircumstances avatar SpacialCircumstances commented on June 14, 2024 1

@purnimashanti Well, have you checked if there is actually a cucumber report file target/cucumber/cucumber.json? That's a somewhat uncommon path, because target/ is usually used by Maven, while Gradle uses build/ to store such files.

from gradle-cucumber-reporting.

peacetrader avatar peacetrader commented on June 14, 2024 1

Hi, I changed the path to target/cucumber/cucumber.json and it's working. Thanks.

from gradle-cucumber-reporting.

SpacialCircumstances avatar SpacialCircumstances commented on June 14, 2024

You can avoid the error by adding testTasksFinalizedByReport = false to your cucumber reports configuration, so the reports are not generated automatically after running a test.
Then, you can manually attach them to your cucumber test task via yourCucumberTestTask.finalizedBy(generateCucumberReports) so they will only run after cucumber tests.

from gradle-cucumber-reporting.

nikhil6686 avatar nikhil6686 commented on June 14, 2024

Works like a charm, thanks alot for the tip :)
Nikhil

from gradle-cucumber-reporting.

peacetrader avatar peacetrader commented on June 14, 2024

Hi, I am having the same issue. I am new to gradle. Could someone help me on how to add these lines in build.gradle?.
My task looks like this :
test { testLogging { events "passed", "skipped", "failed" exceptionFormat "full" } doFirst { delete testResultsDir } useTestNG() scanForTestClasses = false }

cucumberReports { outputDir = file('html-report') buildId = '0' reports = files('target/cucumber/cucumber.json') }

from gradle-cucumber-reporting.

peacetrader avatar peacetrader commented on June 14, 2024

I am not sure how to use this yourCucumberTestTask.finalizedBy(generateCucumberReports)
Do I have to specify it like this :
`test {
useTestNG()
scanForTestClasses = false
}

test.finalizedBy(generateCucumberReports)`

from gradle-cucumber-reporting.

peacetrader avatar peacetrader commented on June 14, 2024

Hi, I still have the same issue. I am running gradle clean build.

18:28:42 > Task :compileTestJava
18:28:42 Note: /home/jenkins-slave/workspace/Nrem API tests/src/test/java/com/thales/library/common/ExcelLibrary.java uses unchecked or unsafe operations.
18:28:42 Note: Recompile with -Xlint:unchecked for details.
18:28:42
18:28:42 > Task :processTestResources
18:28:42 > Task :testClasses
18:28:44 > Task :test
18:28:44
18:28:44 > Task :generateCucumberReports FAILED
18:28:44 Reports file /home/jenkins-slave/workspace/Nrem API tests/target/cucumber/jsonreports/cucumber.json not found
18:28:44 No report files found, aborting...
18:28:44
18:28:44 FAILURE: Build failed with an exception.
18:28:44
18:28:44 * What went wrong:
18:28:44 Execution failed for task ':generateCucumberReports'.
18:28:44 > No test files found
18:28:44
18:28:44 * Try:
18:28:44 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
18:28:44
18:28:44 * Get more help at https://help.gradle.org

from gradle-cucumber-reporting.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.