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

Command Log Showing Object{11} when you pass {force: false} to .click() #2847

Closed
ntgussoni opened this issue Nov 27, 2018 · 1 comment
Closed
Labels
type: duplicate This issue or pull request already exists

Comments

@ntgussoni
Copy link

Current behavior:

Cypress.Commands.add('dropdownSelectByText', (selector, text = '', force = false) => {
  cy.get(selector).click({ force: force });
  cy.contains('some-other-selector', text).click({ force: true});
]});

This is the result of calling that method with force = false.

After some digging I can say that this happens when you pass { force: false } to the .click() method, which is the default value for force

Desired behavior:

Even if you are passing an option, with the default value we could just ignore it, or show the actual value you are passing. I think ignoring it, or displaying some hint text would be great.
Having an Object{11} is really misleading.

Steps to reproduce:

call .click({ force: false })
I haven't tested the defaults for other commands, but it could be happening.

The issue seems to be around here

filterOutOptions: (obj, filter = {}) ->

Versions

v3.1.2, Mac OSX Mojave, Chrome

#88

@chrisbreiding
Copy link
Contributor

This is a duplicate of #678. It's because we mutate the user options with the default options and then log them all. It's the case for probably all commands. There's some work that's been done towards fixing this in this PR. It could be fixed per command, though a solution that solves it for all commands (plus any future commands) would be ideal.

@jennifer-shehane jennifer-shehane added type: duplicate This issue or pull request already exists and removed good first issue Good for newcomers stage: ready for work The issue is reproducible and in scope type: unexpected behavior User expected result, but got another labels Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants