The idea is to:
So far I have tried:
Any other ideas?
This can be done by invoking browser.executeScript()
Use window.performance.memory for Chrome to fetch the performance parameters The below code worked all good for me.
https://docs.webplatform.org/wiki/apis/timing/properties/memory
it('Dummy Test', function(){
//Fetch the browser memory parameters before execution
browser.executeScript('return window.performance.memory').then(function(memoryInfo){
console.log(memoryInfo)
var beforejsHeapSizeLimit = memoryInfo.jsHeapSizeLimit;
var beforeusedJSHeapSize = memoryInfo.usedJSHeapSize;
var beforetotalJSHeapSize = memoryInfo.totalJSHeapSize;
// Have all your code to open browser .. navigate pages etc
browser.driver.get("https://wordpress.com/");
browser.driver.get("http://www.adobe.com/software/flash/about/");
// Once you are done compare before and after values
//Fetch the browser memory parameters after execution and compare
browser.executeScript('return window.performance.memory').then(function(aftermemoryInfo) {
console.log(aftermemoryInfo)
var afterjsHeapSizeLimit = aftermemoryInfo.jsHeapSizeLimit;
var afterusedJSHeapSize = aftermemoryInfo.usedJSHeapSize;
var aftertotalJSHeapSize = aftermemoryInfo.totalJSHeapSize;
expect((parseInt(afterusedJSHeapSize)-parseInt(beforeusedJSHeapSize))<10000000).toBe.true;
});
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With