getgauge / gauge-csharp

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

GaugeScreenshots.Capture() is not capturing screenshot #155

Closed manavghaigithub closed 5 years ago

manavghaigithub commented 5 years ago

Expected behavior

I should be able to capture screenshot using GaugeScreenshots.Capture()

Actual behavior

Gauge is not capturing screenshot when using GaugeScreenshots.Capture();

Steps to reproduce

  1. Create a .Net Core project using Gauge
  2. Create a step implementation
  3. Use GaugeScreenshots.Capture(); in step implementation\ I have html plugin installed and i am not getting any error message during execution but it just doesn't capture any screenshot. As per my understanding i should see screenshot in Gauge html report. Please advise.

Gauge version

Gauge version: 1.0.2 Commit Hash: b4288bb

Plugins

csharp (0.10.5) dotnet (0.1.0) html-report (4.0.6) screenshot (0.0.1)

NivedhaSenthil commented 5 years ago

I could see the screenshots getting added to reports, screenshot will not get generated as images they are directly added to reports as base64 string.

mrbcmorris commented 5 years ago

I've run into this myself. however I'm using Gauge 1.0.3 Commit Hash ff6c0c3

manavghaigithub commented 5 years ago

@NivedhaSenthil I am not seeing any screenshot in the report with .Net Core. Can you share sample report to show how it looks like?

NivedhaSenthil commented 5 years ago

It gets added to steps in report like below from where ever it is captured.

screen shot 2019-02-06 at 9 41 50 am
manavghaigithub commented 5 years ago

Are you trying it in .Net Core? I dont see screenshots in report in .Net Core project


From: Nivedha notifications@github.com Sent: Tuesday, February 5, 2019 11:14:08 PM To: getgauge/gauge-csharp Cc: Ghai, Manav (Cognizant); Author Subject: Re: [getgauge/gauge-csharp] GaugeScreenshots.Capture() is not capturing screenshot (#155)

It gets added to steps in report like below from where ever it is captured. [screen shot 2019-02-06 at 9 41 50 am]https://user-images.githubusercontent.com/6358540/52320147-a72c4980-29f3-11e9-8965-6b3c0a03678e.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/getgauge/gauge-csharp/issues/155#issuecomment-460895629, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AsNVIDz7_pX_apTMg-0ATurhTeThIU5uks5vKlaQgaJpZM4ahliY.

NivedhaSenthil commented 5 years ago

Yes, I am trying with .Net core

NivedhaSenthil commented 5 years ago

Dint realise I was in a different version of html-report plugin, could replicate the issue with 4.0.6 https://github.com/getgauge/html-report/issues/211. Please try using the nightly build or older version html-report while we release the fix.

manavghaigithub commented 5 years ago

Nightly builds are not yet available due to restricts in the company. When do you think this can be fixed?


From: Nivedha notifications@github.com Sent: Wednesday, February 6, 2019 6:43:49 AM To: getgauge/gauge-csharp Cc: Ghai, Manav (Cognizant); Author Subject: Re: [getgauge/gauge-csharp] GaugeScreenshots.Capture() is not capturing screenshot (#155)

Dint realise I was in a different version of html-report plugin, could replicate the issue with 4.0.6 getgauge/html-report#211https://github.com/getgauge/html-report/issues/211. Please try using the nightly build or older version html-report while we release the fix.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/getgauge/gauge-csharp/issues/155#issuecomment-460994429, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AsNVIH8gIY9aunxZ8i3mnSaUTqZcoYi-ks5vKr_1gaJpZM4ahliY.

mrbcmorris commented 5 years ago

I'm using gauge-csharp and encountering the same issue. I've tried 4.0.5 and 4.0.7.nightly-2019-02-05 of html-report to no avail.

Apoorva-GA commented 5 years ago

Html-report 4.0.7 is released. Update the plugin to get the latest changes and do let us know if the issue is fixed.

mrbcmorris commented 5 years ago

hi @Apoorva-GA , I'm still encountering the issue after installing 4.0.7

Gauge version: 1.0.3
Commit Hash: ff6c0c3

Plugins
-------
csharp (0.10.5)
dotnet (0.1.0)
html-report (4.0.7)
screenshot (0.0.1)
xml-report (0.2.0)
manavghaigithub commented 5 years ago

Yeah it’s not working for me as well after upgrading html report plugin to 4.0.7

Get Outlook for iOShttps://aka.ms/o0ukef


From: Chris Morris notifications@github.com Sent: Thursday, February 7, 2019 8:56 AM To: getgauge/gauge-csharp Cc: Ghai, Manav (Cognizant); Author Subject: Re: [getgauge/gauge-csharp] GaugeScreenshots.Capture() is not capturing screenshot (#155)

hi @Apoorva-GAhttps://github.com/Apoorva-GA , I'm still encountering the issue after installing4.0.7

Gauge version: 1.0.3Commit Hash: ff6c0c3Plugins-------csharp (0.10.5)dotnet (0.1.0)html-report (4.0.7)screenshot (0.0.1)xml-report (0.2.0)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/getgauge/gauge-csharp/issues/155#issuecomment-461428263, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AsNVIIDb0St4Xv6Yn4qpdqM0RYELuk6hks5vLDB5gaJpZM4ahliY.

NivedhaSenthil commented 5 years ago

@manavghaigithub and @mrbcmorris can you please try uninstalling the html-report plugin and try with a fresh sample project ?

mrbcmorris commented 5 years ago

Hi @NivedhaSenthil,

I have tried the recommended steps and resulted in the same issue. After uninstalling gauge wasn't able to locate html-report so I downloaded 4.0.7 from the gauge/html-report repo.

My StepImplentation after scaffolding:

using System;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using Gauge.CSharp.Lib;
using Gauge.CSharp.Lib.Attribute;

namespace screenshot
{
    public class StepImplementation
    {
        private HashSet<char> _vowels;

        [Step("Vowels in English language are <vowelString>.")]
        public void SetLanguageVowels(string vowelString)
        {
            GaugeScreenshots.Capture();
            _vowels = new HashSet<char>();
            foreach (var c in vowelString)
            {
                _vowels.Add(c);
            }
        }

        [Step("The word <word> has <expectedCount> vowels.")]
        public void VerifyVowelsCountInWord(string word, int expectedCount)
        {
            var actualCount = CountVowels(word);
            actualCount.Should().Be(expectedCount);
        }

        [Step("Almost all words have vowels <wordsTable>")]
        public void VerifyVowelsCountInMultipleWords(Table wordsTable)
        {
            var rows = wordsTable.GetTableRows();
            foreach (var row in rows)
            {
                var word = row.GetCell("Word");
                var expectedCount = Convert.ToInt32(row.GetCell("Vowel Count"));
                var actualCount = CountVowels(word);

                actualCount.Should().Be(expectedCount);
            }
        }

        private int CountVowels(string word)
        {
            return word.Count(c => _vowels.Contains(c));
        }
    }
}
manavghaigithub commented 5 years ago

Hi @NivedhaSenthil - It is the same behavior happening with me as well. I uninstalled and reinstalled htl-report plugin but due to some reason it is not capturing screenshots in report.

manavghaigithub commented 5 years ago

@NivedhaSenthil Sorry for bugging you on this, just wanted to check whether you got a chance to look into this? Please advise.

BugDiver commented 5 years ago

@manavghaigithub, @mrbcmorris I could replicate the issue with gauge-dotnet: 0.1.0. This has been fixed but the plugin is not released yet. We will be making a release soon. Meanwhile, you can try installing gauge-dotnet nightly version and see if it fixes the issue. Refer this to see install instructions.

Debashis9012 commented 5 years ago

We are able to reproduce this in gauge-dotnet: 0.1.0 But its woking properly with the below version

Gauge version: 1.0.5.nightly-2019-02-08
Commit Hash: 6971850

Plugins
-------
dotnet (0.1.1.nightly-2019-01-29)
mrbcmorris commented 5 years ago

hi @Debashis9012,

I can confirm this nightly builds for dotnet and csharp have remedied the issue.

Gauge version: 1.0.3
Commit Hash: ff6c0c3

Plugins
-------
csharp (0.10.6.nightly-2019-01-11)
dotnet (0.1.1.nightly-2019-01-29)
html-report (4.0.7)
screenshot (0.0.1)
xml-report (0.2.0)