2

I'm using meteor-cucumber meteor-cucumber in my Meteor project, which in turn uses cucumber.js.

I want the test to navigate to a url, but I am expecting an error if it is invalid. In this case, the valid url is /articles

this.When(/^I navigate to '\/articles'$/, function () {
  this.browser.url(process.env.ROOT_URL, 'articles'; 
});

This produces a passing test.

Scenario: View list of articles                     #   features/articles/read_article.feature:8
  Given I am logged in                              # features/articles/read_article.feature:9
  When I navigate to '/articles'                    # features/articles/read_article.feature:10
  Then I should see a list of articles in tile view # features/articles/read_article.feature:11


1 scenario (1 pending)
3 steps (1 pending, 2 passed)

When I change the url to something invalid (eg: 'articlesxxxx', the test still passes. Is this expected behaviour?

I would like the step to fail if the url can't be found.

Related: How do I have a negative scenario with Cucumber in Rails?

Community
  • 1
  • 1
port5432
  • 5,889
  • 10
  • 60
  • 97

0 Answers0