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

Make the position argument type of click, dblclick, rightclick more specific #6341

Open
sainthkh opened this issue Feb 6, 2020 · 4 comments
Open

Comments

@sainthkh
Copy link
Collaborator

@sainthkh sainthkh commented Feb 6, 2020

Current behavior:

Currently, the type of position in click, dblclick, rightclick is just string. Because of this, we cannot get the help of Intellisense.

Desired behavior:

They should be replaced to PositionType like scrollTo, etc.

Test code to reproduce

it('test', () => {
  cy.get('#button').click('top')`. 
}

Intellisense doesn't work.

Screenshot from 2020-02-06 15-41-09

Versions

3.8.3

@markoelez

This comment has been minimized.

Copy link

@markoelez markoelez commented Feb 13, 2020

@sainthkh Could I try tackling this issue? I am new to the codebase but would like to start contributing if possible :)

@sainthkh

This comment has been minimized.

Copy link
Collaborator Author

@sainthkh sainthkh commented Feb 13, 2020

Good. Go on.

@markoelez

This comment has been minimized.

Copy link

@markoelez markoelez commented Feb 13, 2020

@sainthkh So I found the VALID_POSITIONS in packages/driver/src/cy/ensures.coffee, but I am not sure where to define the PositionType object. For Intellisense to work, I assume we would need to restrict the type in packages/driver/src/cy/commands/actions/click.js correct?

@sainthkh

This comment has been minimized.

Copy link
Collaborator Author

@sainthkh sainthkh commented Feb 13, 2020

Cypress types are defined in cli/type/index.d.ts. Check the file, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.