# Elastic synthetic and playwright commands (Visual Comparison)

**URL:** <https://discuss.elastic.co/t/elastic-synthetic-and-playwright-commands-visual-comparison/311162>\
**Category:** Elastic Observability\
**Created:** [August 1, 2022, 9:24pm UTC](https://discuss.elastic.co/t/elastic-synthetic-and-playwright-commands-visual-comparison/311162 "2022-08-01T21:24:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![M.A](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@M.A](https://discuss.elastic.co/u/M.A)\
**Post date:** [August 1, 2022, 9:24pm UTC](https://discuss.elastic.co/t/elastic-synthetic-and-playwright-commands-visual-comparison/311162/1 "2022-08-01T21:24:01Z")

</div>

hi,  
were are using elastic synthetic for our UI tests.  
I have seen on the documentation that elastic synthetic is based on playwright and used jest commands.  
"...Use the assertion library provided by the Synthetics agent to look for the expected value. See [Jest expect docs](https://jestjs.io/docs/expect) for more information...."

> **[Write a synthetic test | Observability Guide \[8.3\] | Elastic](https://www.elastic.co/guide/en/observability/current/synthetics-create-test.html)**

in our usecase we want to use the the visual comparison feature from playwright which is as well part of jest.

we try following statement, as mentioned in jest documentation:  
\<\>  
step("Do Comparison", async() =\> {  
expect(await page.screenshot()).toMatchSnapshot();  
});  
\</\>

Unfortunately we are receiving following message:  
TypeError: expect(...).toMatchSnapshot is not a function  
at Step.eval [as callback] (eval at loadInlineScript (/usr/share/heartbeat/.node/node/lib/node\_modules/@elastic/synthetics/src/loader.ts:89:20), :14:41)  
at async Runner.runStep (/usr/share/heartbeat/.node/node/lib/node\_modules/@elastic/synthetics/src/core/runner.ts:213:7)  
at async Runner.runSteps (/usr/share/heartbeat/.node/node/lib/node\_modules/@elastic/synthetics/src/core/runner.ts:263:16)  
at async Runner.runJourney (/usr/share/heartbeat/.node/node/lib/node\_modules/@elastic/synthetics/src/core/runner.ts:353:27)  
at async Runner.run (/usr/share/heartbeat/.node/node/lib/node\_modules/@elastic/synthetics/src/core/runner.ts:448:11)  
at async Command. (/usr/share/heartbeat/.node/node/lib/node\_modules/@elastic/synthetics/src/cli.ts:131:23)

my idea is, that elastic is using an old version of jest or playwright or I am doing something wrong.

Do you have an idea or suggestion?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 8:36am UTC](https://discuss.elastic.co/t/elastic-synthetic-and-playwright-commands-visual-comparison/311162/2 "2022-11-04T08:36:27Z")

</div>


