webdrivercss icon indicating copy to clipboard operation
webdrivercss copied to clipboard

Feature request : event callbacks

Open el3ment opened this issue 10 years ago • 1 comments

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

el3ment avatar Nov 18 '14 19:11 el3ment

:+1:

jamesdwilson avatar Jan 04 '16 23:01 jamesdwilson