Skip to content

Writing Features

mVermaat edited this page May 27, 2019 · 19 revisions

Examples

You can use the example project as a base to write your own features.

Aliases

Many feature steps contain an 'alias' variable. When records are created or retrieved, they will be added to a cache. The key will be the specified alias. In example: "Given a {entityname} named {alias} with the following values" will create a record and add that record to the alias cache.

In all steps after that within the same scenario, you can use this alias to refer to that specific record. This can be done in the steps themselves, in example: "When {alias} is updated with the following values" will retrieve the record from the alias and update it.

It can also be used in tables as value of a lookup field. If this is done, then the test will not query CRM, instead it uses the record found in the alias cache.

Default Values

Whenever a new record is created, you can supply some default values so that you don't need to enter the same values every time you create a record.

<defaultdata> <entity name="account"> <field name="name">test</field> </entity> </defaultdata>

Clone this wiki locally