Coder Social home page Coder Social logo

[🐛Bug]: Error in console `ENOENT: no such file or directory, open Video-reporter.log` after run tests about wdio-video-reporter HOT 7 OPEN

Oleksii-QA avatar Oleksii-QA commented on September 17, 2024
[🐛Bug]: Error in console `ENOENT: no such file or directory, open Video-reporter.log` after run tests

from wdio-video-reporter.

Comments (7)

christian-bromann avatar christian-bromann commented on September 17, 2024

Thanks for reporting!

We greatly appreciate any contributions that help resolve the bug. While we understand that active contributors have their own priorities, we kindly request your assistance if you rely on this bug being fixed. We encourage you to take a look at our contribution guidelines or join our friendly Discord development server, where you can ask any questions you may have. Thank you for your support, and cheers!

from wdio-video-reporter.

Oleksii-QA avatar Oleksii-QA commented on September 17, 2024

@christian-bromann I investigated this issue many times. And I think I found the reason.

First, logs are created:
wdio.log, wdio,browser.log, drivers log(chromedriver, geckodriver)
after 2 second logs are created:
Video-reporter.log and rawSeleniumVideoGrabs folder

That's why I think there were cases with bug;
Test run in 58-59 second of some minute, and wdio-0-0-Video-reporter.log could not be created, since the next minute had already arrived

I have added a temporary solution in wdio.conf.js, like:

import fs from 'fs'

const logsPath = './logs';
const folderName = moment().format('YYYY-MM-DD_HH-mm');
const folderPath = `${logsPath}/${folderName}`;
fs.mkdirSync(folderPath, { recursive: true });
const allFolders = fs.readdirSync(logsPath);
const sortedFolders = allFolders.sort((a, b) => {
    return fs.statSync(`${logsPath}/${b}`).ctime.getTime() - fs.statSync(`${logsPath}/${a}`).ctime.getTime();
});
const latestFolder = sortedFolders[0];
console.log('Latest test folder', latestFolder);

export const config = {

outputDir: `${logsPath}/${latestFolder}`,

In this case, the log folder will be created before each test run.

I think the permanent solution would be to create logs at the same time. Or need to look for other options.

from wdio-video-reporter.

christian-bromann avatar christian-bromann commented on September 17, 2024

Test run in 58-59 second of some minute, and wdio-0-0-Video-reporter.log could not be created, since the next minute had already arrived

So the reports are being overwritten by another test?

from wdio-video-reporter.

Oleksii-QA avatar Oleksii-QA commented on September 17, 2024

So the reports are being overwritten by another test?

In this case, the file is not created and the test fails

from wdio-video-reporter.

christian-bromann avatar christian-bromann commented on September 17, 2024

How does the test fail due to a non existing log file?

from wdio-video-reporter.

Oleksii-QA avatar Oleksii-QA commented on September 17, 2024

How does the test fail due to a non existing log file?

In this case, I think the error was not that the file does not exist. The problem is that it tried to create a log file in a non-existent folder.

from wdio-video-reporter.

christian-bromann avatar christian-bromann commented on September 17, 2024

Ah, I think this can be fixed. All contributions would be appreciated!

from wdio-video-reporter.

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.