Skip to content

Commit bd9efbd

Browse files
committed
Added log memory into login case
1 parent ef08412 commit bd9efbd

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

ui-tests/cypress.config.sample.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,26 @@ module.exports = defineConfig({
3535
launchOptions.args.push("--disable-gl-drawing-for-tests");
3636
launchOptions.args.push("--disable-gpu");
3737
launchOptions.args.push("--disable-dev-shm-usage");
38+
launchOptions.args.push('--enable-precise-memory-info');
39+
launchOptions.args.push('--js-flags="--expose-gc"');
3840
}
3941
launchOptions.args.push('--js-flags="--max_old_space_size=3500 --max_semi_space_size=1024"');
4042
}
4143
return launchOptions;
4244
});
45+
on('task', {
46+
logMemory() {
47+
if (global.gc) {
48+
global.gc();
49+
} else {
50+
console.warn('Garbage collection is not exposed. Run node with --expose-gc');
51+
}
52+
53+
const used = process.memoryUsage();
54+
console.log(`MEMORY USAGE: RSS: ${Math.round(used.rss / 1024 / 1024)} MB | Heap Used: ${Math.round(used.heapUsed / 1024 / 1024)} MB`);
55+
return null;
56+
}
57+
});
4358
},
4459
},
4560
});

ui-tests/cypress/e2e/dashboard/login/login.cy.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ describe('Login', () => {
1212
});
1313

1414
it('should successfully log in to with valid username and password', function() {
15+
cy.task('logMemory');
1516
loginHelpers.typeUsername(user.username);
1617
loginHelpers.typePassword(user.password);
1718
loginHelpers.clickLoginButton();
19+
cy.task('logMemory');
1820
navigationHelpers.isNavigatedToDashboard();
21+
cy.task('logMemory');
1922
});
2023

2124
it('should successfully log in to with valid e-mail and password', function() {

0 commit comments

Comments
 (0)