我想在我的量角器e2e测试用例中使用console.log()
来获得angular2。
import { HomePage } from './home.page.ts';
describe('App', () => {
let homePage;
beforeEach(() => {
homePage = new HomePage();
browser.get('/#/home');
});
it('should find the nested class using a page', () => {
let addElem = element(by.css('.add-btn'));
console.log(addElem); // I tried this, but it doesnt work .I am expecting this can be logged in console
})
})
任何输入? 感谢。
答案 0 :(得分:1)
方法console.log
是同步执行的,所以你需要在控制流程中推送它:
function log(arg) {
browser.call(function() {
console.log(arg);
});
}
let addElem = element(by.css('.add-btn'));
log(addElem);