Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timestamp is not logged against nightwatch messages #4018

Open
syasareni1 opened this issue Feb 8, 2024 · 1 comment · May be fixed by #4134
Open

timestamp is not logged against nightwatch messages #4018

syasareni1 opened this issue Feb 8, 2024 · 1 comment · May be fixed by #4134

Comments

@syasareni1
Copy link

Description of the bug/issue

@gravityvi
@yashPratp983
@garg313

When I configure nightwatch.config.js to show timestamp on output log statements

var config = {
    src_folders: [
        // Folders with tests
    ],
    output_folder: './logs', // Where to output the test reports
    custom_commands_path: `commands`, //Where custom command files are located
    live_output: true,
    output_timestamp: true,
    test_settings: {
        default: {
            silent: true,
        },
        chrome: {
        },
        firefox: {
        }
    }
};

module.exports = config;

Shows timestamp only when
output_timestamp: true, and silent=false

But I need to log the timestamp when silent=true,
since when silent=false it gives lots of verbose logs.

some sample log statements when running nightwatch

 Running:  chrome: nightwatch-tests\mytest.js
 chrome: nightwatch-tests\mytest.js  √ Element <body> was visible after 1927 milliseconds.

I need log statements like below

2024-01-01 01:01:00.222 Running:  chrome: nightwatch-tests\mytest.js
2024-01-01 01:01:01.333 chrome: nightwatch-tests\mytest.js  √ Element <body> was visible after 1927 milliseconds.

Steps to reproduce

  1. Go to '...'
  2. Click on '...'
  3. Scroll down to '...'
  4. See error

Sample test

No response

Command to run

No response

Verbose Output

No response

Nightwatch Configuration

var config = {
    src_folders: [
        // Folders with tests
    ],
    output_folder: './logs', // Where to output the test reports
    custom_commands_path: `commands`, //Where custom command files are located
    live_output: true,
    output_timestamp: true,
    test_settings: {
        default: {
            silent: true,
        },
        chrome: {
        },
        firefox: {
        }
    }
};

Nightwatch.js Version

2.6.21

Node Version

20.0

Browser

chrome 121

Operating System

windows 11

Additional Information

No response

@matte23n
Copy link

It's actually easy to "fix", the timestamp is not currently handled in the method logDetailedMessage (which is the one who is being called when silent mode is set to true).
I can take care of this

SohaibMagrabi added a commit to SohaibMagrabi/nightwatch that referenced this issue Mar 26, 2024
SohaibMagrabi added a commit to SohaibMagrabi/nightwatch that referenced this issue Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants