getgauge / gauge-csharp

Csharp runner for Gauge
https://gauge.org
GNU General Public License v3.0
33 stars 21 forks source link

TakeScreenShot does not get called when implementing ICustomeScreenshotGrabber #128

Closed ocary closed 6 years ago

ocary commented 6 years ago

Expected behavior

TakeScreenShot() to be called when implementingICustomScreenshotGrabber

Actual behavior

TakeScreenShot() is not called.

Note: TakeScreenShot() is called if IScreenGrabberis used, but a deprecated message is given.

Sample code

public class ScreenGrabber : IScreenGrabber
   {
        public byte[] TakeScreenShot()
        {
            System.Console.WriteLine("in takescreenshot");
            ...Custom screenshot implementation here....

With the above code: I see a deprecated message (expected) and the console.writeline message shows. Changing just to use ICustomScreenshotGrabber, results in the TakeScreenShotmethod not being called.

Gauge version

Gauge version: 0.9.7

Plugins
-------
csharp (0.10.3)
flash (0.0.1)
html-report (4.0.3)
java (0.6.6)
json-report (0.2.1)
screenshot (0.0.1)
spectacle (0.1.2)
xml-report (0.2.0)
ocary commented 6 years ago

Does ICustomScreenshotGrabber need to be added to the find list in ScanForScreengrabber? ~line 168 in AssemblyLoader.cs --- https://github.com/getgauge/gauge-csharp/blob/0794e69ce696fa67a21106bf594c77233fc146e6/Runner/AssemblyLoader.cs

Note: This is the commit that added ICustomScreenshotGrabber - https://github.com/getgauge/gauge-csharp/commit/acce19d74f1d914eac2c783854a35f2ad78e6940