Coder Social home page Coder Social logo

Comments (10)

sriv avatar sriv commented on July 24, 2024 1

@Vishnu1067 - sure. will check this out as well.

from html-report.

freedombycrypto avatar freedombycrypto commented on July 24, 2024

Waiting for this release. I am also having folder structure as

specs
    - teamName
           - regression
                  - ui
                       - file.spec
                  -api
                       - file.spec.

would be nice if it accepts for any folder structure under specs.

from html-report.

cyberjaime45 avatar cyberjaime45 commented on July 24, 2024

@Vishnu1067 I tested this branch (251_nested_dir_images). The bug has been fixed. I downloaded the source code and compiled myself. Let me know if you need the zip file for your machine. I hope they release soon.

from html-report.

freedombycrypto avatar freedombycrypto commented on July 24, 2024

I have checkout this branch (251_nested_dir_images) and compiled go run build/make.go && go run build/make.go --install

and now gauge -v

Gauge version: 1.0.7

Plugins
-------
html-report (4.0.10)
java (0.7.4)
screenshot (0.0.1)
spectacle (0.1.3)
xml-report (0.2.1)

When i use ICustomScreenshotGrabber, screenshots are showing in the report (deprecated ICustomScreenshotGrabber)

public class CustomScreenGrabber implements ICustomScreenshotGrabber {

@Override
    public byte[] takeScreenshot() {
       return ((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES);
   }

But if i use CustomScreenshotWriter, screenshot not placed in images and it is crashed.

public class CustomScreenGrabber implements CustomScreenshotWriter {

 @Override
    public String takeScreenshot() {
        return ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE).getName();
  }

Correct me if i am doing anything wrong here.

Also not sure i must put env gauge_screenshots_dir as per this PR
getgauge/gauge-java#333

from html-report.

freedombycrypto avatar freedombycrypto commented on July 24, 2024

@sriv can you please consider to fix this issue or am i missing something? Please advise.

I have checkout this branch (251_nested_dir_images) and compiled go run build/make.go && go run build/make.go --install

and now gauge -v

Gauge version: 1.0.7

Plugins
-------
html-report (4.0.10)
java (0.7.4)
screenshot (0.0.1)
spectacle (0.1.3)
xml-report (0.2.1)

When i use ICustomScreenshotGrabber, screenshots are showing in the report (deprecated ICustomScreenshotGrabber)

public class CustomScreenGrabber implements ICustomScreenshotGrabber {

@Override
    public byte[] takeScreenshot() {
       return ((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES);
   }

But if i use CustomScreenshotWriter, screenshot not placed in images and it is crashed.

public class CustomScreenGrabber implements CustomScreenshotWriter {

 @Override
    public String takeScreenshot() {
        return ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE).getName();
  }

Correct me if i am doing anything wrong here.

Also not sure i must put env gauge_screenshots_dir as per this PR
getgauge/gauge-java#333

from html-report.

sriv avatar sriv commented on July 24, 2024

@Vishnu1067 - your custom screengrabber imlpementation is incorrect. You need to write the file and then return the path. The location of screenshot should be read from gauge_screenshots_dir. Something like this:

    // Return a screenshot file name
    @Override
    public String takeScreenshot() {
        TakesScreenshot driver = (TakesScreenshot) DriverFactory.getDriver();
        String screenshotFileName = String.format("screenshot-%s.png", UUID.randomUUID().toString());
        File screenshotFile = new File(Paths.get(System.getenv("gauge_screenshots_dir"), screenshotFileName).toString());
        File tmpFile = driver.getScreenshotAs(OutputType.FILE);
        try {
            FileUtils.copyFile(tmpFile, screenshotFile);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return screenshotFileName;
    }

I tried this and am able to see the screenshots in all pages (even the nested ones).

PS - the docs mention this: https://docs.gauge.org/writing-specifications.html?os=windows&language=java&ide=vscode#taking-custom-screenshots

from html-report.

freedombycrypto avatar freedombycrypto commented on July 24, 2024

Ok thank you @sriv. I will try it out

from html-report.

freedombycrypto avatar freedombycrypto commented on July 24, 2024

@sriv It works, Thanks.

from html-report.

freedombycrypto avatar freedombycrypto commented on July 24, 2024

@sriv When will be expected to release this fix?

from html-report.

sriv avatar sriv commented on July 24, 2024

The fix is being tested, please watch out for the PR #253 to be merged.

from html-report.

Related Issues (20)

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.