webdrivercss
webdrivercss copied to clipboard
Feature request : event callbacks
It would be great to get event hooks before and after each important event in the screenshot phase as a starting list
beforeTest afterTest (this is the only one that exists right now) beforeDocumentScreenshot afterDocumentScreenshot beforeElementScreenshot afterElementScreenshot beforeContextSwitch afterContextSwitch beforeDocumentScroll afterDocumentScroll
as a use case -- you might imagine a dropdown menu that hides itself when switching from desktop to mobile view. If I want a screenshot of the menu open, I need to be able to "click" on the menu after the window has been sized for each of the mobile sizes
one way of implementing this would be to retool the webdrivercss function like so
browser.webdrivercss(
name,
elements,
function afterTestCallback(err, res){},
{beforeScreenshot : function(),
afterScreenshot : function()})
v2.0 could do away with the afterTestCallback parameter and just include it as a member of the config or callback object
:+1: