Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Should be able to capture screenshots in all hooks #142

Closed
sswaroopgupta opened this issue Jul 19, 2018 · 7 comments
Closed

Should be able to capture screenshots in all hooks #142

sswaroopgupta opened this issue Jul 19, 2018 · 7 comments

Comments

@sswaroopgupta
Copy link
Contributor

Actual behavior
Captures screenshots in before and after step hooks only

Steps to replicate

  • Create a gauge-csharp project
  • Add the screenshot capture on all hooks.
 [BeforeSuite]
        public void BeforeSuite()
        {
            printMessageAndScreenshot("before Suite");
        }

        [AfterSuite]
        public void AfterSuite()
        {
            printMessageAndScreenshot("after Suite");
        }

        [BeforeSpec]
        public void BeforeSpec()
        {
            printMessageAndScreenshot("before Spec");
        }

        [AfterSpec]
        public void AfterSpec()
        {
            printMessageAndScreenshot("after spec");
        }

        [BeforeScenario]
        public void BeforeScenario()
        {
            printMessageAndScreenshot("before Scenario");
        }

        [AfterScenario]
        public void AfterScenario()
        {
            printMessageAndScreenshot("after Scenario");
        }

        [BeforeStep]
        public void BeforeStep()
        {
            printMessageAndScreenshot("before step");
        }

        [AfterStep]
        public void AfterStep()
        {
            printMessageAndScreenshot("after step");
        }
        private void printMessageAndScreenshot(string message)
        {
            Gauge.CSharp.Lib.GaugeScreenshots.Capture();
            Gauge.CSharp.Lib.GaugeMessages.WriteMessage(message);
        }

        
        private HashSet<char> _vowels;

        [Step("Vowels in English language are <vowelString>.")]
        public void SetLanguageVowels(string vowelString)
        {
            _vowels = new HashSet<char>();
            foreach (var c in vowelString)
            {
                _vowels.Add(c);
            }
        }
  • Run the specs gauge run
  • Open the html-report

The screenshots are displayed only for before and after steps.

Version

Gauge version: 1.0.1.nightly-2018-07-18
Commit Hash: e62f840

Plugins
-------
csharp (0.10.5.nightly-2018-07-19)

Blocks #137

@BugDiver
Copy link
Member

Should be available in nightly >= 24-07-2018

@sswaroopgupta
Copy link
Contributor Author

The html nightly does not have the required changes yet

@sswaroopgupta
Copy link
Contributor Author

Replicable on version

Gauge version: 1.0.1.nightly-2018-07-26
Commit Hash: 25546b9

Plugins
-------
csharp (0.10.5.nightly-2018-07-24)
html-report (4.0.5.nightly-2018-07-25)

@nehashri
Copy link
Contributor

@sguptatw Can you please eloborate on what is replicable on the version you have provided

@sswaroopgupta
Copy link
Contributor Author

The steps and the behavior are the same as mentioned in the original issue.

The screenshots are displayed only for before and after step hooks, but not all hooks.

@sswaroopgupta
Copy link
Contributor Author

May be related to #134

@sswaroopgupta
Copy link
Contributor Author

Verified with

Gauge version: 1.0.1.nightly-2018-08-01
Commit Hash: 6aa1ce2

Plugins
-------
csharp (0.10.5.nightly-2018-08-02)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants