Skip to content

Commit 303f22f

Browse files
authored
Merge pull request #7432 from Countly/can-angun-patch-4
[QA] Increase timeout for checkPaceRunning command
2 parents 1b88161 + 1d79c6d commit 303f22f

2 files changed

Lines changed: 26 additions & 4 deletions

File tree

frontend/express/views/dashboard.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,24 @@
304304
<script type='text/javascript' src='<%- cdn %>sdk/web/countly.min.js?<%= countlyVersion %>'></script>
305305
<script type='text/javascript'>
306306

307+
var initDestroyTimeOutPace = function () {
308+
var counter = 0;
309+
var refreshIntervalId = setInterval(function () {
310+
var progress;
311+
if (typeof document.querySelector('.pace-progress').getAttribute('data-progress-text') !== 'undefined') {
312+
progress = Number(document.querySelector('.pace-progress').getAttribute('data-progress-text').replace("%", ''));
313+
}
314+
if (progress === 99) {
315+
counter++;
316+
}
317+
if (counter > 50) {
318+
clearInterval(refreshIntervalId);
319+
Pace.stop();
320+
}
321+
}, 100);
322+
}
323+
initDestroyTimeOutPace();
324+
307325
Countly.getViewName = function(){
308326
var view = "/dashboard#";
309327
var fragment = Backbone.history.getFragment();

ui-tests/cypress/support/commands.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,17 +375,21 @@ Cypress.Commands.add("shouldNotExist", (element) => {
375375
});
376376

377377
Cypress.Commands.add('checkPaceRunning', () => {
378-
cy.get('.pace-running', { timeout: 10000 }).should('not.exist');
378+
cy.get('body', { timeout: 35000 })
379+
.invoke('hasClass', 'pace-running')
380+
.should('eq', false);
379381
});
380382

381383
Cypress.Commands.add('checkPaceActive', () => {
382-
cy.get('.pace-active', { timeout: 10000 }).should('not.exist');
384+
cy.get('body', { timeout: 35000 })
385+
.invoke('hasClass', 'pace-active')
386+
.should('eq', false);
383387
});
384388

385389
Cypress.Commands.add('checkLoading', () => {
386390
cy.get('body').then($body => {
387391
if ($body.find('.el-loading-mask').length) {
388-
cy.get('.el-loading-mask', { timeout: 20000 })
392+
cy.get('.el-loading-mask', { timeout: 35000 })
389393
.should('not.be.visible');
390394
}
391395
});
@@ -568,4 +572,4 @@ Cypress.Commands.add('getElement', (selector, parent = null) => {
568572
setDebugContext({ selector: finalSelector });
569573

570574
return cy.get(finalSelector);
571-
});
575+
});

0 commit comments

Comments
 (0)