Skip to content

Problem with date in Function formatLogEntries #102

Closed
@vansari

Description

@vansari

Hi,

We use the Version 2.0.2 of the webdriver module with the PHPVersion 8.1.7. In Line 701 of WebDriver Class we got an Type Error for Timestamps which should be converted from milliseconds to seconds.
See: https://github.com/Codeception/module-webdriver/blob/2.0.2/src/Codeception/Module/WebDriver.php#L701

Error is: date(): Argument #2 ($timestamp) must be of type ?int, float given

Is it possible that we can fix this with the following little snippet:

             // Timestamp is in milliseconds, but date() requires seconds.
            $time = date('H:i:s', (intval($logEntry['timestamp'] / 1000))) .
                // Append the milliseconds to the end of the time string
                '.' . ($logEntry['timestamp'] % 1000);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions