Skip to content

Support a context in Faker library #85

@dschweie

Description

@dschweie

As a Technical Test Engineer I want Faker to support a context to create new items which correlate to the existing data.

A test case often consumes a number of data points and in many cases data points should be reasonable.
Set context RoboCon ${zip} Postalcode ${city} City
When I execute code I want to have a 'zip' which is related to 'city'.

Faker Library should by default have not default context so it is allowed to deliver completely random values.

Set Context

If I set a context I want faker to remember the generated data and generate new data matching.
'Set context RoboCon
${city} City
${town} City
Should Be Equal ${city} ${town}'

Note: Faker can store data on a Lazy-Initialization because there is no need to create any pre defined set of data.

Switch Context

Faker should be able to handle multiple contexts and should provide a keyword to switch context.

Drop Context

Faker should be able to drop a context. When I call the keyword Faker can forget the generated data points.

Configure Context

Faker should provide keywords to set environment options to a context. I want to localize a context e.g. to 'de_DE'. In this case I want Faker to generate e.g. a german address or names.

Duplicate Context

Faker should provide the keyword 'Duplicate Context'. This keyword needs a new alias and sets a new context and by default only configured options will be copied.
If I only set a new alias the data will be copied from current context.
Additional parameter should allow to copy configuration from another context identified by its alias.

Reset Context

Especially in Performance testing you want to use new data set in the next iteration. So it should be possible to keep the alias and configration but all generated data points should be deleted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions