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

Log output from commands using relative locators are hard to read #4229

Open
reallymello opened this issue Jul 5, 2024 · 0 comments
Open

Comments

@reallymello
Copy link
Contributor

reallymello commented Jul 5, 2024

Description of the bug/issue

When I use relative locators in an assert I expect to see friendly log messages that can help me understand what element was used in the command or assertion, but instead I get returned a large object that is hard to read at a glance in the logs.

In other words, I'd like to see something like this:
Expected element <By.css('input.rcpInput') below element with text 'Function Category'> to have value equal to '(1) File Notes')

but instead I get output like this

√ Expected element <RelativeBy({"relative":{"root":{"css selector":"input.rcbInput"},"filters":[{"kind":"below","args":[{"driver_":{"session_":{},"executor_":{"customCommands_":{},"log_":{"name_":"driver.http.Executor","level_":null,"parent_":{"name_":"driver.http","level_":null,"parent_":{"name_":"driver","level_":null,"parent_":{"name_":"","level_":{"name_":"OFF","value_":null},"parent_":null,"handlers_":null},"handlers_":null},"handlers_":null},"handlers_":null},"w3c":true},"fileDetector_":null,"authenticatorId_":null,"pinnedScripts_":{}},"id_":{},"log_":{"name_":"driver","level_":null,"parent_":{"name_":"","level_":{"name_":"OFF","value_":null},"parent_":null,"handlers_":null},"handlers_":null}}]}]}})> to have value equal: "(1) File Notes" (25ms)

Associated command

browser.expect.element(
  locateWith(By.css('input.rcbInput')).below(
    await browser.element.findByText('Function Category'))).value.to.equal('(1) File Notes');

Steps to reproduce

Run a test with a relative locator and findByText item combined in an expect

browser.expect.element(
  locateWith(By.css('input.rcbInput')).below(
    await browser.element.findByText('Function Category'))).value.to.equal('(1) File Notes');

Observe console ouput

Sample test

browser.expect.element(
  locateWith(By.css('input.rcbInput')).below(
    await browser.element.findByText('Function Category'))).value.to.equal('(1) File Notes');

Command to run

n/a

Verbose Output

n/a

Nightwatch Configuration

n/a

Nightwatch.js Version

3.6.3

Node Version

20

Browser

Chrome

Operating System

Windows 11

Additional Information

No response

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

No branches or pull requests

1 participant