Skip to content

Conversation

@npgarcia
Copy link

  • Moving After and Before hooks to a class named Hooks
  • Starting steps to contain only steps
  • Added try-catch to screenshot in after hook

import java.io.IOException;


public class Hooks {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this class being used?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class will be used to contain the Before and After Hooks.
So will be used every time a scenario run.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok thanks. Probably it's a good idea to add documentation on how and why to use this methods.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That information is already in Cucumber page, I don't see the need of duplicating the information in here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NVM, I was not clear of how this was working :) But @ulisespulido was kind enough to explain to me.

try {
final byte[] screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES);
scenario.embed(screenshot, "image/png");
} catch (WebDriverException e){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@npgarcia npgarcia merged commit 33dfc7c into develop Jun 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants