view console.log output in angular protractor jasmine test

Use browser.manage().logs().get(‘browser’) browser.manage().logs().get(‘browser’).then(function(browserLogs) { // browserLogs is an array of objects with level and message fields browserLogs.forEach(function(log){ if (log.level.value > 900) { // it’s an error log console.log(‘Browser console error!’); console.log(log.message); } }); });

Jest clean up after all tests have run

There’s a sibling hook to setupFiles that will too fire before every test suite but right after your test runner (by default Jasmine2) has initialised global environment. It’s called setupFilesAfterEnv. Use it like this: { “setupFilesAfterEnv”: [“<rootDir>/setup.js”] } Example setup.js: beforeAll(() => console.log(‘beforeAll’)); afterAll(() => console.log(‘afterAll’)); setup.js doesn’t need to export anything. It will be … Read more

How to get Angular 2 element through class name in Jasmine

You use By.css to pass a css selector. So any selector you can use with css, you can use with By.css. And a selector for a class is simply .classname (with period). By.css(‘.classname’) // get by class name By.css(‘input[type=radio]’) // get input by type radio By.css(‘.parent .child’) // get child who has a parent These … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)