screenshot before popup window close
Opened this issue · 0 comments
csdhw commented
I have the following it block, which will cause a popup window appear. I want to have a screenshot of the expect statement for both pass or fail. Ideally I want to close the popup window before exit so my next it block don't need to worry about the popup window. However with the current code, the screenshot will be taken after the popup window closed. Is there a way to take a screenshot on the expect?
it{........
//some action cause a popup window
browser.getAllWindowHandles().then(function(handles){
browser.switchTo().window(handles[1]).then(function(){
expect(A).toEqual(B);
browser.driver.close();
browser.driver.switchTo().window(handles[0]);
});
});
}