Skip to content

Commit e1042aa

Browse files
avoid timeout
1 parent dad071a commit e1042aa

File tree

1 file changed

+26
-27
lines changed

1 file changed

+26
-27
lines changed

cypress/integration/free-gutenberg.js

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -41,44 +41,43 @@ describe('Test Free - gutenberg', function() {
4141
}
4242
cy.wrap($pages).each((page, i, array) => {
4343
var charts = [];
44-
cy.wrap(charts).then( () => {
44+
cy.wrap(page).then( () => {
4545
for(var i = page * 6; i < ( ( (page * 6) + 6 ) > Cypress.env('chart_types').free ? Cypress.env('chart_types').free : ( (page * 6) + 6 ) ); i++){
4646
charts.push(i + 1);
4747
}
48-
});
49-
50-
cy.wrap(charts).each((num, i, array) => {
51-
if(page > 0){
52-
// click load more for every page except the first.
53-
cy.get('.visualizer-settings').then( ($div) => {
54-
cy.wrap($div).find('.visualizer-settings__charts .components-button').click();
55-
});
56-
cy.wait( Cypress.env('wait') );
57-
}
48+
}).then( () => {
49+
cy.wrap(charts).each((num, i, array) => {
50+
if(page > 0){
51+
// click load more for every page except the first.
52+
cy.get('.visualizer-settings').then( ($div) => {
53+
cy.wrap($div).find('.visualizer-settings__charts .components-button').click();
54+
});
55+
cy.wait( Cypress.env('wait') );
56+
}
5857

59-
cy.get('.visualizer-settings').then( ($div) => {
60-
// insert the chart.
61-
cy.wrap($div).find('.visualizer-settings__charts-single:nth-child(' + num + ')').then( ($chart) => {
62-
cy.wrap($chart).find('.visualizer-settings__charts-controls').click();
63-
});
64-
})
65-
.then( () => {
66-
cy.wait( Cypress.env('wait') );
6758
cy.get('.visualizer-settings').then( ($div) => {
68-
// check if inserted
69-
cy.wrap($div).find('.visualizer-settings__chart').should('have.length', 1);
70-
cy.wrap($div).find('.visualizer-settings__chart > div').should('have.length', 1);
71-
cy.wrap($div).find('.components-button-group button').should('have.length', 2);
72-
73-
// go back to insert another one.
74-
cy.wrap($div).find('.components-button-group button').first().click();
59+
// insert the chart.
60+
cy.wrap($div).find('.visualizer-settings__charts-single:nth-child(' + num + ')').then( ($chart) => {
61+
cy.wrap($chart).find('.visualizer-settings__charts-controls').click();
62+
});
63+
})
64+
.then( () => {
7565
cy.wait( Cypress.env('wait') );
66+
cy.get('.visualizer-settings').then( ($div) => {
67+
// check if inserted
68+
cy.wrap($div).find('.visualizer-settings__chart').should('have.length', 1);
69+
cy.wrap($div).find('.visualizer-settings__chart > div').should('have.length', 1);
70+
cy.wrap($div).find('.components-button-group button').should('have.length', 2);
71+
72+
// go back to insert another one.
73+
cy.wrap($div).find('.components-button-group button').first().click();
74+
cy.wait( Cypress.env('wait') );
75+
});
7676
});
7777
});
7878
});
7979
});
8080

81-
expect(1).to.equal(1);
8281
});
8382

8483
})

0 commit comments

Comments
 (0)