Skip to content

Commit 718d974

Browse files
remove irrelevant code
1 parent f41a902 commit 718d974

File tree

1 file changed

+1
-72
lines changed

1 file changed

+1
-72
lines changed

cypress/integration/free-gutenberg.js

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -11,79 +11,9 @@ describe('Test Free - gutenberg', function() {
1111

1212
it('Create all charts', function() {
1313
cy.create_available_charts(Cypress.env('chart_types').free);
14-
//cy.create_available_charts(1);
1514
});
1615

17-
it.skip('Verify insertion of charts - using load more', function() {
18-
cy.visit('/post-new.php');
19-
20-
// get rid of that irritating popup
21-
cy.get('.nux-dot-tip__disable').click();
22-
23-
// insert a visualizer block
24-
cy.get('div.edit-post-header-toolbar .block-editor-inserter button').click();
25-
cy.get('.components-popover__content').then(function ($popup) {
26-
cy.wrap($popup).find('.block-editor-inserter__search').type('visua');
27-
cy.wrap($popup).find('.block-editor-inserter__results ul.block-editor-block-types-list li').should('have.length', 1);
28-
cy.wrap($popup).find('.block-editor-inserter__results ul.block-editor-block-types-list li button').click();
29-
});
30-
31-
// see the block has the correct elements.
32-
cy.get('div[data-type="visualizer/chart"]').should('have.length', 1);
33-
cy.get('.visualizer-settings__content-option').should('have.length', 2);
34-
35-
cy.get('.visualizer-settings__content-option').last().click();
36-
cy.wait( Cypress.env('wait') );
37-
38-
// add all charts one by one - insert, go back, insert, go back...
39-
var $pages = [];
40-
for(var i = 0; i < Math.ceil(parseInt(Cypress.env('chart_types').free)/6); i++){
41-
$pages.push(i);
42-
}
43-
$pages = [0];
44-
cy.wrap($pages).each((page, i, array) => {
45-
var charts = [];
46-
cy.wrap(page).then( () => {
47-
for(var i = page * 6; i < ( ( (page * 6) + 6 ) > Cypress.env('chart_types').free ? Cypress.env('chart_types').free : ( (page * 6) + 6 ) ); i++){
48-
charts.push(i + 1);
49-
}
50-
charts = [1];
51-
}).then( () => {
52-
cy.wrap(charts).each((num, i, array) => {
53-
if(page > 0){
54-
// click load more for every page except the first.
55-
cy.get('.visualizer-settings').then( ($div) => {
56-
cy.wrap($div).find('.visualizer-settings__charts .components-button').click();
57-
});
58-
cy.wait( Cypress.env('wait') );
59-
}
60-
61-
cy.get('.visualizer-settings').then( ($div) => {
62-
// insert the chart.
63-
cy.wrap($div).find('.visualizer-settings__charts-single:nth-child(' + num + ')').then( ($chart) => {
64-
cy.wrap($chart).find('.visualizer-settings__charts-controls').click();
65-
});
66-
})
67-
.then( () => {
68-
cy.wait( Cypress.env('wait') );
69-
cy.get('.visualizer-settings').then( ($div) => {
70-
// check if inserted
71-
cy.wrap($div).find('.visualizer-settings__chart').should('have.length', 1);
72-
cy.wrap($div).find('.visualizer-settings__chart > div').should('have.length', 1);
73-
cy.wrap($div).find('.components-button-group button').should('have.length', 2);
74-
75-
// go back to insert another one.
76-
cy.wrap($div).find('.components-button-group button').first().click();
77-
cy.wait( Cypress.env('wait') );
78-
});
79-
});
80-
});
81-
});
82-
});
83-
});
84-
85-
86-
it('Verify insertion of charts - not using load more', function() {
16+
it('Verify insertion of charts', function() {
8717
cy.visit('/post-new.php');
8818

8919
// get rid of that irritating popup
@@ -109,7 +39,6 @@ charts = [1];
10939
for(var i = 1; i <= parseInt(Cypress.env('chart_types').free); i++){
11040
charts.push(i);
11141
}
112-
//charts.push(1);
11342

11443
cy.wrap(charts).each((num, i, array) => {
11544
cy.get('.visualizer-settings .visualizer-settings__charts-single:nth-child(' + num + ')').then( ($chart) => {

0 commit comments

Comments
 (0)