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

Support custom localisation and other yadda options #42

Closed
wants to merge 3 commits into from

Conversation

karoluck
Copy link

@karoluck karoluck commented Dec 13, 2016

At my work we're using fork of ember-cli-yadda everyday in cooperation with architects. There are already only 2 missing functionalities in this plugin which we need to use original plugin (BTW thanks for adding @ignore annotation, that is what we've also needed). I mean:

  • Support custom localisation (Our achitects are writing tests in our native language)
  • Support another yadda options

Our fork of ember-cli-yadda has hardcoded FeatureParser initialization, it looks like that:

var feature = new yadda.parsers.FeatureParser({
  language: yadda.localisation.Polish,
  leftPlaceholderChar: '<',
  rightPlaceholderChar: '>'
}).parse(content);

We need also possibility to change square brackets into angle brackets for using variables due to cooperation also with PHP Team. They are using Behat, and there are angle brackets for using variables behat docs. We've decided to be consistent with PHP Team.

With this PR changes we will be able to set custom yadda config in our app environment config by adding:

ENV.APP.yadda = {
  language: 'Polish',
  leftPlaceholderChar: '<',
  rightPlaceholderChar: '>'
};

So here is my PR which should resolve our problems and allows us to use official version of ember-cli-yadda. I'm open to any suggestions if it needs some improvements.

I wanted to write some tests, but it needs some tricky way to use custom acceptance tests directory. Because with custom configuration current tests will definetly fail (and thats correct, using another localisation, english tests can't work). I can add tests later in another PR (it really needs tricky way which i didn't want to include in this PR).

Note: this version of code is fully backward compatible.

@benwalder benwalder mentioned this pull request Mar 12, 2018
benwalder added a commit that referenced this pull request Mar 15, 2018
* Set Yadda options

* check for setup* annotation for scenario setup

* use default localisation in blueprint steps.js

* set localisation from configuration for both parsing features and steps

* update dummy app generated files

* update test fixtures

* bump version

* replaces #42
@albertjan
Copy link
Collaborator

closed in favour of #72 thanks @dejavs

@albertjan albertjan closed this Mar 15, 2018
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.

2 participants