Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hooks - Edit & add java and javascript examples #56

Merged
merged 5 commits into from
Oct 31, 2017
Merged

Hooks - Edit & add java and javascript examples #56

merged 5 commits into from
Oct 31, 2017

Conversation

mlvandijk
Copy link
Member

Review document, add polyglot to frontmatter, add examples for java and javascript, as well as NOT tag. Js examples taken from cucumber-js documentation on github (https://github.com/cucumber/cucumber-js/blob/2.x/docs/support_files/hooks.md), java examples inspired by examples in blogs / on StackOverflow.

Tested by running locally and reading Hooks page for Java/Javascript/Ruby, to make sure page is readable considering text & examples marked for specific languages.

Note: a few js examples are still marked "TODO" inline. As I don't use js myself, I'm not sure what would be the best examples to put for these particular examples. Do note there are plenty of js examples provided. I'm open to suggestions here.

@mlvandijk
Copy link
Member Author

@jaysonesmith - Would you please have a look at the Ruby text & examples to see if they're still up to date? (esp. the Tagged Hooks) and suggest corrections as needed?

There is no association between where a Hook is defined and which Scenario or Step it is run for.
But if you want more fine grained control, you can use Tagged Hooks (see below).
There is no link between where a Hook is defined and which Scenario or Step it is run for.
If you want more fine grained control, you can use [Tagged Hooks](#tagged-hooks).
Copy link
Contributor

Choose a reason for hiding this comment

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

fine grained control => fine-grained control


## Scenario hooks

`Before` hooks will be run before the first Step of each Scenario.
They are run in the same order they are registered.
`Before` hooks will be run before the first Step of each Scenario. They will run in the **same order** in which they are registered.
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that you want to avoid the indirectness of the expression will be run.

The first sentence of this paragraph still uses that turn of phrase.

```

{{% text "javascript" %}}
Hooks are used for setup and teardown the environment before and after each scenario.
Copy link
Contributor

Choose a reason for hiding this comment

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

for setup and teardown the environment => for setup and teardown of the environment

```

See more documentation on [tag expressions](https://docs.cucumber.io/tag-expressions/).
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this link meant to be a local relative link?

Copy link
Member Author

Choose a reason for hiding this comment

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

Atm it's not; perhaps it should be? (i.e. the info on Tag Expressions should be added to these docs)

Copy link
Contributor

Choose a reason for hiding this comment

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

This repository has source code for a Web site which is not currently officially live, is it?


## Global Hooks

{{% text "ruby" %}}
Copy link
Contributor

Choose a reason for hiding this comment

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

A note on the paragraph after this {{% text "ruby" %}} annotation: Can we somehow get rid of the "just" in that sentence?

Copy link
Contributor

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

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

The addition of these changes ease navigation for the reader who's interested in one language: that's a great improvement.

@mlvandijk mlvandijk changed the title Add java and javascript examples Hooks - Edit & add java and javascript examples Oct 29, 2017
@mlvandijk
Copy link
Member Author

Thanks for the review @olleolleolle !

@@ -260,7 +260,7 @@ defineSupportCode(function({After, Before}) {
});
```

See more documentation on [tag expressions](https://docs.cucumber.io/tag-expressions/).
See more documentation on [tag expressions](https:/tag-expressions/).
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, the link got wonky (non-local)

@mlvandijk mlvandijk merged commit 1545c95 into cucumber:master Oct 31, 2017
@mlvandijk mlvandijk deleted the hooks branch October 31, 2017 05:48
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.

None yet

2 participants