Skip to content

Commit

Permalink
fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
ankri committed Feb 17, 2021
1 parent 7d8c843 commit 05c84af
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cypress/integration/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,27 @@ describe('Test History', () => {
});

it('should be possible to undo and redo changes made via drag and drop', () => {
cy.getByTestId('root-container')
.as('root')
.children()
.should('have.length', 4);

// The first plan is to drag every component into the frame-container component
cy.getByTestId('frame-container')
.as('container')
.children()
.should('have.length', 1);

// TODO currently I do not know why but without the wait. test gets flaky
// and fails randomly because cypress is not able to drag the card into the container
cy.wait(100);
cy.getByTestId('frame-card')
.as('card')
.dragAndDrop('@container', { position: 'inside' });
cy.getByTestId('frame-button')
.as('button')
.dragAndDrop('@container', { position: 'inside' });

cy.getByTestId('frame-text')
.as('text')
.dragAndDrop('@container', { position: 'inside' });
Expand Down

0 comments on commit 05c84af

Please sign in to comment.