Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
}));
});
});
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
export async function flushLastBrowserLogs(length = 1000) {
const browserLog = await browser.manage().logs().get('browser');
const lastNLog = browserLog.reverse().slice(0, length);
lastNLog.forEach((logEntry) => {
switch (logEntry.level.name_) {
case 'SEVERE':
Logger.error(`${logEntry.timestamp}: ${logEntry.message}`);
break;
case 'WARNING':
Logger.warn(`${logEntry.timestamp}: ${logEntry.message}`);
break;
default:
Logger.log(`${logEntry.timestamp}: ${logEntry.message}`);
}
});
setMediumBrowserSize() {
browser
.manage()
.window()
.setSize(defaultConfig.medium + scrollBarAndPaddingOffset, 1024);
}
setExtraLargeBrowserSize() {
browser
.manage()
.window()
.setSize(defaultConfig.extraLarge + scrollBarAndPaddingOffset, 1024);
}
}
async function checkErrors() {
await browser.manage().logs().get('browser').then((browserLog) => {
let str = '' + browserLog.length + ' errors';
let errorLog = '\n';
browserLog.map((item) => { errorLog += JSON.stringify(item.message) + '\n' });
expect(str).to.equal('0 errors', errorLog);
})
}