$echo '{
< "fixtures": [
< {
< "id": "001-rename",
< "baselineHtml": "<article><span class=\\"price\\">$10</span></article>",
< "currentHtml": "<article><span class=\\"price-new\\">$10</span></article>"
< },
< {
< "id": "002-attribute",
< "baselineHtml": "<span class=\\"offer\\" data-price=\\"\\"></span>",
< "currentHtml": "<span class=\\"offer\\">$10</span>"
< },
< {
< "id": "003-duplicate",
< "baselineHtml": "<span class=\\"price\\">$10</span>",
< "currentHtml": "<span class=\\"price\\">$10</span><span class=\\"price\\">$10</span>"
< },
< {
< "id": "004-natural",
< "baselineHtml": "<h1>Blue shoe</h1>",
< "currentHtml": "<h1>New blue shoe</h1>"
< }
< ],
< "rules": [
< {
< "id": "price-selector",
< "selector": ".price",
< "mode": "text",
< "whitespace": "trim",
< "minMatches": 1,
< "maxMatches": 1,
< "fixtureIds": [
< "001-rename"
< ]
< },
< {
< "id": "price-attribute",
< "selector": ".offer",
< "mode": "attribute",
< "attribute": "data-price",
< "whitespace": "preserve",
< "minMatches": 1,
< "maxMatches": 1,
< "fixtureIds": [
< "002-attribute"
< ]
< },
< {
< "id": "one-price",
< "selector": ".price",
< "mode": "text",
< "whitespace": "collapse",
< "minMatches": 1,
< "maxMatches": 1,
< "expectedValues": [
< "$10"
< ],
< "fixtureIds": [
< "003-duplicate"
< ]
< },
< {
< "id": "title",
< "selector": "h1",
< "mode": "text",
< "whitespace": "collapse",
< "minMatches": 1,
< "maxMatches": 1,
< "fixtureIds": [
< "004-natural"
< ]
< }
< ]
<}' |
<apify call h_murdock/html-selector-fixture-audit --silent --output-dataset