Hi Hans,

you can read default test data from a file, exactly in the same way you'd read it from a table. E.g.

Given some default test data contained in file://path/to/data/file

and you can also transform its content using a custom TableTransformer. More in:

http://jbehave.org/reference/stable/tabular-parameters.html

Thereafter it's up to the implementer of the steps classes to interpret its content.

This solution allow the story writer to have the default test data accessible and even change it on demand.

It can also be used with page-objects, which would need to be injected with the data that is being passed to the step.

I hope that help you. If you a more concrete use case or example, feel free to share it.

Cheers

On 06/11/2013 10:54, Hans Schwäbli wrote:
I am looking for a way how these default test data are self documenting for non-programmers. Stories and example tables are self documenting. I think that implementing such default test data into Java code or inject it somehow does not seem to be self-documenting for non-programmers. The story writers we have are non-programmers. So I have to consider that skills. Today I thought it would be nice if a story writer could include a property file with default test data. If for instance that property is used in the steps and is included in the story, then that default test data is used if it is not overwritten by an example table for that step. So it would be self-deocumenting since it is integrated in the story in a comprehensible way even for non-programmers I think.
What do you think about supporting that concept?
Or what solution would you recommend exactly to solve this? You wrote about page objects. I know what they are, but how exactly does a good solution look like for JBehave?


2013/9/27 Mauro Talevi <[email protected] <mailto:[email protected]>>

    Steps classes are pojos and you configure/inject configuration as
    you prefer.

    There is no specific framework for this in JBehave.

    Cheers

    On 27 Sep 2013, at 10:54, Hans Schwäbli
    <[email protected]
    <mailto:[email protected]>> wrote:

    > What is the JBehave way to use test configurations?
    >
    > For instance I want to configure the base URL, the browser(s) to
    be used, some common data like username and password and so on.
    >
    > I could write an "Environment" class and put it in it or write
    property files. Someone even wrote a Step for this, which imports
    such configuration data.
    >
    > But maybe there exists a feature in JBehave for such things?

    ---------------------------------------------------------------------
    To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Reply via email to