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

Closed
sainthkh opened this issue Feb 6, 2020 · 6 comments · Fixed by #6668
Closed

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

sainthkh opened this issue Feb 6, 2020 · 6 comments · Fixed by #6668
Labels
good first issue type: typings

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

@sainthkh sainthkh added good first issue stage: ready for work topic: typescript labels Feb 6, 2020
@markoelez
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
Copy link
Collaborator Author

@sainthkh sainthkh commented Feb 13, 2020

Good. Go on.

@markoelez
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
Copy link
Collaborator Author

@sainthkh sainthkh commented Feb 13, 2020

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

@jennifer-shehane jennifer-shehane added type: typings and removed topic: typescript labels Mar 3, 2020
@cypress-bot cypress-bot bot added stage: work in progress stage: needs review and removed stage: ready for work stage: work in progress stage: needs review labels Mar 6, 2020
@cypress-bot cypress-bot bot added stage: pending release and removed stage: work in progress labels Mar 6, 2020
@cypress-bot
Copy link

@cypress-bot cypress-bot bot commented Mar 6, 2020

The code for this is done in cypress-io/cypress#6668, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link

@cypress-bot cypress-bot bot commented Mar 16, 2020

Released in 4.2.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v4.2.0, please open a new issue.

@cypress-bot cypress-bot bot removed the stage: pending release label Mar 16, 2020
@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Mar 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue type: typings
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants