Assert the optimized images of the page offer (or do not offer) an image format: <Picture formats={['avif', 'webp']} /> writes one <source type="image/..."> per format.
Examples
Then the optimized image should offer the "avif" format
And the optimized image should offer the "webp" format
But the optimized image should not offer the "jpeg" format
Then optimized image should offer the "webp" format
And the optimized image should offer the "avif" format
Pattern
Then(/^(?:the )?optimized image should( not)* offer the "([^"]*)?" format$/, …)
Part of @webship-js/astro-steps (github.com/webship/astro-steps), a step pack for Webship-js 2.0.x.