Fields
sample
The `sample` option of an extract field.
A sample value recorded by the picker, kept as a permanent test of the field's parsing.
Type: object
#Keys
| Key | Type | Description |
|---|---|---|
sample.raw | string | The raw string the page printed, such as 1.299,90 TL. |
sample.value | any | The value the raw string must parse to, such as 1299.9. |
#Example
{
"price": {
"selector": ".price",
"type": "money",
"locale": "tr",
"currency": "TRY",
"sample": {
"raw": "1.299,90 TL",
"value": 1299.9
}
}
}
From the contract fixture product-page-list-regex-json, a program the test suite validates.