Giter Club home page Giter Club logo

api-bdd-tests's People

Contributors

jharmn avatar julianpistorius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

api-bdd-tests's Issues

Lettuce errors

$ lettuce

Feature: Bitly link shortener                                           # features/link-shortener.feature:1
  @Positive @Oauth @Bitly @User                                         # features/link-shortener.feature:3

  @Positive @Oauth @Bitly @User
  Scenario: Get access token            # features/link-shortener.feature:4
    Given I use the bitly host                                          # features/steps/steps_requests.py:6
    When I access the resource url "/oauth/access_token"                # features/steps/steps_requests.py:11
    And I provide authentication credentials                            # features/steps/steps_requests.py:15
    And I post to the url                                               # features/steps/steps_requests.py:40
    Then the status code should be 200                                  # features/steps/steps_requests.py:44
    And the results should be saved as "access_token" for later         # features/steps/steps_values.py:20

  @Positive @User @Bitly
  Scenario: Get user info                      # features/link-shortener.feature:13
    Given i use the bitly host                                          # features/steps/steps_requests.py:6
    When I access the resource url "/v3/user/info"                      # features/steps/steps_requests.py:11
    And I provide parameter "access_token" as the value "access_token"  # features/steps/steps_requests.py:27
    And I retrieve the JSON results                                     # features/steps/steps_requests.py:31
    Then the status code should be 200                                  # features/steps/steps_requests.py:44
    And it should have the field "status_code" containing the value 200 # features/steps/steps_values.py:16

Feature: Geonames nearby place name                      # features/nearby-place-declarative.feature:1
  @Get @Positive @Nearby @Declarative                    # features/nearby-place-declarative.feature:3

  @Get @Positive @Nearby @Declarative
  Scenario: Get nearby place name# features/nearby-place-declarative.feature:4
    Given I use the geonames host                        # features/steps/steps_requests.py:6
    When I use the "Find Nearby Place by JSON" endpoint  # features/steps/steps_declarative.py:4
    And I identify my "geonames" user credentials        # features/steps/steps_declarative.py:8
    And I provide coordinates 30.4754724, -98.1564068    # features/steps/steps_declarative.py:12
    And I retrieve the JSON results                      # features/steps/steps_requests.py:31
    Then it should have at least 1 valid "geonames" item # features/steps/steps_declarative.py:17
    Traceback (most recent call last):
      File "/Users/julianpistorius/.venvs/api-bdd-tests/lib/python2.7/site-packages/lettuce/core.py", line 143, in __call__
        ret = self.function(self.step, *args, **kw)
      File "/Users/julianpistorius/git/api-bdd-tests/features/steps/steps_declarative.py", line 18, in then_it_should_have_at_least_valid_result
        step.then('it should have a list "%s"' % (name))
      File "/Users/julianpistorius/.venvs/api-bdd-tests/lib/python2.7/site-packages/lettuce/core.py", line 368, in then
        return self.behave_as(string)
      File "/Users/julianpistorius/.venvs/api-bdd-tests/lib/python2.7/site-packages/lettuce/core.py", line 402, in behave_as
        assert not steps_failed, steps_failed[0].why.exception
    AssertionError

Feature: Geonames nearby place name                                                       # features/nearby-place-imperative.feature:1
  @Positive @Get @Nearby                                                                  # features/nearby-place-imperative.feature:3

  @Positive @Get @Nearby
  Scenario Outline: Get nearby place name                        # features/nearby-place-imperative.feature:4
    Given I use the geonames host                                                         # features/steps/steps_requests.py:6
    When I access the resource url "/findNearbyPlaceNameJSON"                             # features/steps/steps_requests.py:11
    And I provide parameter "username" as "jharmon"                                       # features/steps/steps_requests.py:23
    And I provide parameter "lat" as "<lat>"                                              # features/steps/steps_requests.py:23
    And I provide parameter "lng" as "<long>"                                             # features/steps/steps_requests.py:23
    And I retrieve the JSON results                                                       # features/steps/steps_requests.py:31
    Then the status code should be 200                                                    # features/steps/steps_requests.py:44
    And it should have a list "geonames"                                                  # features/steps/steps_lists.py:6
    And the list should have at least 1 item                                              # features/steps/steps_lists.py:11
    And the list should have the field "countryId" containing the value "<countryId>"     # features/steps/steps_lists.py:16
    And the list should have the field "toponymName" containing the value "<toponymName>" # features/steps/steps_lists.py:16

  Examples:
    | lat        | long        | countryId | toponymName    |
    | 30.4754724 | -98.1564068 | 6252001   | Spicewood      |
    | 34.134103  | -118.321694 | 6252001   | Universal City |
    | 48.85815   | 2.29452     | 3017382   | Invalides      |
    Traceback (most recent call last):
      File "/Users/julianpistorius/.venvs/api-bdd-tests/lib/python2.7/site-packages/lettuce/core.py", line 143, in __call__
        ret = self.function(self.step, *args, **kw)
      File "/Users/julianpistorius/git/api-bdd-tests/features/steps/steps_lists.py", line 17, in the_list_should_have_the_field_containing_the_value
        eq_(world.list[0][field], value)
      File "/Users/julianpistorius/.venvs/api-bdd-tests/lib/python2.7/site-packages/nose/tools/trivial.py", line 29, in eq_
        raise AssertionError(msg or "%r != %r" % (a, b))
    AssertionError: u'Paris 10 Ancien - Quartier Invalides' != u'Invalides'

  @Negative @Get @User
  Scenario: Invalid username does not work                         # features/nearby-place-imperative.feature:23
    Given I use the geonames host                                                         # features/steps/steps_requests.py:6
    When I access the resource url "/findNearbyPlaceNameJSON"                             # features/steps/steps_requests.py:11
    And I provide parameter "username" as "fdafdafdfdafda"                                # features/steps/steps_requests.py:23
    And I provide parameter "lat" as "30.4754724"                                         # features/steps/steps_requests.py:23
    And I provide parameter "long" as "-98.1564068"                                       # features/steps/steps_requests.py:23
    And I retrieve the JSON results                                                       # features/steps/steps_requests.py:31
    Then the status code should be 200                                                    # features/steps/steps_requests.py:44
    Traceback (most recent call last):
      File "/Users/julianpistorius/.venvs/api-bdd-tests/lib/python2.7/site-packages/lettuce/core.py", line 143, in __call__
        ret = self.function(self.step, *args, **kw)
      File "/Users/julianpistorius/git/api-bdd-tests/features/steps/steps_requests.py", line 46, in status_code_should_be
        assert world.results.status_code == status, "Status invalid: %s, Results: %s" % (world.results.status_code, world.results)
    AssertionError: Status invalid: 401, Results: <Response [401]>
    And it should have the error "status" containing the value "user does not exist."     # features/steps/steps_values.py:7

3 features (1 passed)
7 scenarios (4 passed)
59 steps (3 failed, 1 skipped, 55 passed)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.