Skip to content

Other jQuery methods? #432

@paulfalgout

Description

@paulfalgout

Are there plans to add other jquery traversal methods? I ran into a case where nextAll would have been nice, but it isn't available. My use case was a calendar that has very little selectors in the DOM. I needed to pick the next day of the week in the month.

What I was looking to do was:

cy.get('.calendar').find('.selected').parent().nextAll().ep(6).click();

But I ended up having to do additional foot work.

cy
  .get('.calendar')
  .find('.selected').parent()
  .then(function($today) {
    _.times(7, function() {
      $today = $today.next();
    });
    return $today;
  })
  .click();

I mean it's fine this way.. I think I can do anything without the methods.. and I can certainly understand if the idea is to keep the API small.. but if you google something like "jquery chaining multiple next" the solution will point to nextAll.

Is there a methodology behind what was chosen to implement and is there a intention to add more?

Metadata

Metadata

Labels

pkg/driverThis is due to an issue in the packages/driver directory

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions