Skip to content

Commit

Permalink
fix: command
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyeYoung committed Aug 23, 2022
1 parent 0d64f94 commit cca085a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions web/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ Cypress.Commands.add('configurePlugin', ({ name, content }) => {
});

// NOTE: wait for the Drawer to appear on the DOM
cy.focused(domSelector.drawer)
cy.get(domSelector.drawer)
.should('exist')
.within(() => {
cy.wait(timeout);
// trick for stable
cy.contains('Enable').should('exist');
cy.get(domSelector.switch, { timeout }).should('exist').click({
force: true,
});
Expand Down Expand Up @@ -99,8 +101,8 @@ Cypress.Commands.add('configurePlugin', ({ name, content }) => {
});
});

cy.wait(timeout);
if (shouldValid) {
cy.wait(timeout);
cy.get(domSelector.drawer, { timeout }).should('not.exist');
} else {
cy.get(domSelector.notification).should('contain', 'Invalid plugin data');
Expand All @@ -110,6 +112,7 @@ Cypress.Commands.add('configurePlugin', ({ name, content }) => {
multiple: true,
});

cy.wait(timeout);
cy.get(domSelector.drawer)
.invoke('show')
.within(() => {
Expand Down

0 comments on commit cca085a

Please sign in to comment.