blumilksoftware / blt

Behat+Laravel toolbox. Still in progress.
https://packagist.org/packages/blumilksoftware/blt
3 stars 0 forks source link

Add authentication tools #6

Closed krzysztofrewak closed 2 weeks ago

krzysztofrewak commented 3 years ago

There's empty Blumilk\BLT\Features\Traits\Authentication trait. I would love to have tool to testing authentication-realted stuff. Something like:

Background:
    Given there are users in database:
        | email             |
        | user1@example.com |

Scenario: An unauthenticated user is requesting restricted Dashboard page
    Given there is unauthenticated user
    And a user is requesting "/dashboard"
    When a request is sent
    Thena response status code should be "401"

Scenario: An authenticated user is requesting restricted Dashboard page
    Given there is authenticated user "user1@example.com"
    And a user is requesting "/dashboard"
    When a request is sent
    Thena response status code should be "200"