Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 966 Bytes

context-extended-alice.md

File metadata and controls

46 lines (36 loc) · 966 Bytes

Extended Alice Context

Parent Alice Context

KnpLabs/FriendlyContexts

Define Id for Alice

You can define an id for the fixture entity

# user.yml
App\Entity\User:
    user-john:
        id: 1
        firstname: John
        lastname: Doe

Alias entity

You have to enable aliasing in the behat.yml configuration:

default:
    extensions:
        Troopers\BehatContexts\Extension:
            alias_entity:
                enabled: true

Then you can alias entities with @ in order to reuse them later:

@alice(User)
Feature: My feature
    The feature description
    
    Background:
        Given the following users:
            | @         | firstname | lastname |
            | @MainUser | John      | Doe      |
        And the following products:
            | name  | user      |
            | Shoes | @MainUser |
    ...