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

Feature request: inside #15

Closed
david-boydell opened this issue Jan 5, 2021 · 5 comments
Closed

Feature request: inside #15

david-boydell opened this issue Jan 5, 2021 · 5 comments

Comments

@david-boydell
Copy link

david-boydell commented Jan 5, 2021

Hi,

One feature that would be incredibly useful is an assertion to check whether one element is inside another element. An example integration test could be:

  it('block-2 should be inside block-1', () => {
      cy.get('.block-2').should('be.inside', '.block-1');
  });

  it('block-2 should be inside block-1 by 25px', () => {
      cy.get('.block-4').should(
          'be.inside',
          '.block-1',
          { right: 25, left: 25, top: 25, bottom: 25 }
      );
  }); 

The html test page can be found here: https://gist.github.com/david-boydell/89c4fe1c11685341f533c31b29f7d37f

I have tried to come up with a working example but I can't seem to get the assertion to be built, the error is The chainer inside was not found. Could not build assertion. I imagine you may have more luck so thought I'd put in a request.

ghost pushed a commit that referenced this issue Jan 6, 2021
@ghost ghost mentioned this issue Jan 6, 2021
3 tasks
@ghost
Copy link

ghost commented Jan 6, 2021

Hi @david-boydell,

Thank you for your request, it has actually cropped up a few times not just as an issue but word of mouth!

I've finally had the time to do a first-pass, feel free to check it out and report back any issues you may encounter.

Thanks

@david-boydell
Copy link
Author

Great, thank you very much!

@david-boydell
Copy link
Author

david-boydell commented Jan 7, 2021

That works perfectly and exactly what I needed @msmps, I'm very grateful thank you.

@ghost
Copy link

ghost commented Jan 7, 2021

You're welcome, thank you for the contribution!

@all-contributors please add @david-boydell for ideas

@allcontributors
Copy link
Contributor

@msmps

I've put up a pull request to add @david-boydell! 🎉

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