Properties #

A property is a description of how the system under test should behave in general. This is different from example-based testing (e.g. Playwright, Cypress, or Selenium) where you describe how it behaves for particular cases.

The most intuitive kind of property, which you might have come across before, is an invariant: a condition that should always be true. In Bombadil, invariants are expressed using the always temporal operator:

always( 
    // some condition that should always be true
)

To instruct Bombadil to check your property, you must export it from your specification module. Its name is used in error reports, so give the export a meaningful name.

export const hasTitle = always( 
    // check that there's a title rendered somehow
);

You may export multiple properties, including the defaults, and they’ll all be checked independently. But how do you “check that there’s a title somehow”? You need access to the browser, and for that, you use extractors.