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

Add relationships support to cypress. #14103

Closed
4 tasks
mshima opened this issue Feb 28, 2021 · 6 comments · Fixed by #16617
Closed
4 tasks

Add relationships support to cypress. #14103

mshima opened this issue Feb 28, 2021 · 6 comments · Fixed by #16617
Labels
area: feature request 💡 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ theme: tests $500 https://www.jhipster.tech/bug-bounties/
Milestone

Comments

@mshima
Copy link
Member

mshima commented Feb 28, 2021

Overview of the feature request

This is the only feature missing when comparing to protractor.

Protractor implementation selects last item from select and use it.
This is really easy to implement, but it doesn't follow best practices:
https://docs.cypress.io/guides/references/best-practices.html#Having-tests-rely-on-the-state-of-previous-tests
This approach causes problems like #13645.

To follow best practices I suggest the following approach:

describe('should create an instance of Entity', () => {
  let entity;
  let requiredOtherEntity;

  before(() => {
    // create a entity at the relationship entity:
    cy.request('POST', 'otherEntity', {requiredField: requiredValue}).then(response => {
      otherEntity = response.body;
    });
  })

  describe('should create an instance of Entity', () => {
    .
    .
    cy.get(`[data-cy="otherEntity"]`).select(requiredOtherEntity.id);
    entity = cy.get(entityCreateSaveButtonSelector).click({force: true}).;
    .
    .
  });
});
  • It should work without fake data.
  • It should work if the added otherEntity is not returned from the server as a option (pagination)
  • It should work if otherEntity contains required fields/relationships.
Motivation for or Use Case
Related issues or PR
  • Checking this box is mandatory (this is just to show you read everything)
@pascalgrimaud
Copy link
Member

Big +1

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity.
Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted.
We are accepting PRs 😃.
Comment or this will be closed in 7 days

@github-actions github-actions bot closed this as completed Apr 8, 2021
@mshima mshima reopened this Apr 8, 2021
@pascalgrimaud pascalgrimaud added this to the 7.1.0 milestone May 28, 2021
@mshima mshima reopened this Sep 5, 2021
@pascalgrimaud pascalgrimaud added $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $500 https://www.jhipster.tech/bug-bounties/ labels Sep 25, 2021
@pascalgrimaud
Copy link
Member

Adding a bounty for this

@mshima
Copy link
Member Author

mshima commented Sep 25, 2021

Let's do this.

@mshima
Copy link
Member Author

mshima commented Oct 26, 2021

@pascalgrimaud
Copy link
Member

@mshima : approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: feature request 💡 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ theme: tests $500 https://www.jhipster.tech/bug-bounties/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants