Skip to content
18 changes: 18 additions & 0 deletions frontend/express/views/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,24 @@
<script type='text/javascript' src='<%- cdn %>sdk/web/countly.min.js?<%= countlyVersion %>'></script>
<script type='text/javascript'>

var initDestroyTimeOutPace = function () {
var counter = 0;
var refreshIntervalId = setInterval(function () {
var progress;
if (typeof document.querySelector('.pace-progress').getAttribute('data-progress-text') !== 'undefined') {
progress = Number(document.querySelector('.pace-progress').getAttribute('data-progress-text').replace("%", ''));
}
if (progress === 99) {
counter++;
}
if (counter > 50) {
clearInterval(refreshIntervalId);
Pace.stop();
}
}, 100);
}
initDestroyTimeOutPace();

Countly.getViewName = function(){
var view = "/dashboard#";
var fragment = Backbone.history.getFragment();
Expand Down
12 changes: 8 additions & 4 deletions ui-tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,17 +375,21 @@ Cypress.Commands.add("shouldNotExist", (element) => {
});

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

Cypress.Commands.add('checkPaceActive', () => {
cy.get('.pace-active', { timeout: 10000 }).should('not.exist');
cy.get('body', { timeout: 35000 })
.invoke('hasClass', 'pace-active')
.should('eq', false);
});

Cypress.Commands.add('checkLoading', () => {
cy.get('body').then($body => {
if ($body.find('.el-loading-mask').length) {
cy.get('.el-loading-mask', { timeout: 20000 })
cy.get('.el-loading-mask', { timeout: 35000 })
.should('not.be.visible');
}
});
Expand Down Expand Up @@ -568,4 +572,4 @@ Cypress.Commands.add('getElement', (selector, parent = null) => {
setDebugContext({ selector: finalSelector });

return cy.get(finalSelector);
});
});
Loading