@@ -0,0 +1,1125 @@
+/**%0A * Created with IntelliJ IDEA.%0A * User: jhasmanyquiroz%0A * Date: 11/25/15%0A * Time: 12:12 PM%0A * To change this template use File %7C Settings %7C File Templates.%0A */%0Apackage steps.hooks;%0A%0Aimport cucumber.api.Scenario;%0Aimport cucumber.api.java.After;%0Aimport org.openqa.selenium.OutputType;%0Aimport org.openqa.selenium.TakesScreenshot;%0Aimport org.openqa.selenium.WebDriverException;%0A%0Aimport static framework.BrowserManager.getInstance;%0A%0Apublic class GlobalHooks %7B%0A    @After%0A    public void embedScreenShot(Scenario scenario) %7B%0A        if (scenario.isFailed()) %7B%0A            try %7B%0A                System.out.println(%22#########################Take a snapshot#######################%22);%0A                byte%5B%5D screenshot = ((TakesScreenshot)getInstance().getDriver()).getScreenshotAs(OutputType.BYTES);%0A                scenario.embed(screenshot, %22image/png%22);%0A                System.out.println(%22#######SCENARIO: %22+scenario.getName());%0A            %7D catch (WebDriverException somePlatformsDontSupportScreenshots) %7B%0A                System.err.println(somePlatformsDontSupportScreenshots.getMessage());%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Create the GlobalHooks and method after for create the screenshot