diff --git a/docs/en/observability/synthetics-create-test.asciidoc b/docs/en/observability/synthetics-create-test.asciidoc index e0607bf9b7..c0beb1ed8a 100644 --- a/docs/en/observability/synthetics-create-test.asciidoc +++ b/docs/en/observability/synthetics-create-test.asciidoc @@ -155,8 +155,7 @@ For more details on getting started with the Synthetics Recorder, refer to <>. Visit the https://playwright.dev/docs[Playwright documentation] for information. However, not all Playwright functionality should be used with Elastic Synthetics. - In some cases, there are alternatives to Playwright functionality built into the Elastic Synthetics library. These alternatives are designed to work better for synthetic monitoring. Do _not_ use Playwright syntax to: -* *Make assertions*. Use Elastic Synthetics's `expect` methods instead. - Read more in <>. * *Make API requests.* Use Elastic Synthetic's `request` parameter instead. Read more in <>. @@ -182,15 +179,20 @@ There is also some Playwright functionality that is not supported out-of-the-box in Elastic Synthetics including: * https://playwright.dev/docs/api/class-video[Videos] +* The https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-have-screenshot-1[`toHaveScreenshot`] and https://playwright.dev/docs/api/class-snapshotassertions[`toMatchSnapshot`] assertions [discrete] [[synthetics-make-assertions]] = Make assertions -Check that a value meets a specific condition. A more complex `step` might wait for a page element to be selected and then make sure that it matches an expected value. +Elastic Synthetics uses `@playwright/test`'s `expect` function to make assertions +and supports most https://playwright.dev/docs/test-assertions[Playwright assertions]. +Elastic Synthetics does _not_ support https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-have-screenshot-1[`toHaveScreenshot`] +or any https://playwright.dev/docs/api/class-snapshotassertions[Snapshot Assertions]. + For example, on a page using the following HTML: [source,html] @@ -219,38 +221,6 @@ step('Assert placeholder text', async () => { <2> Use the assertion library provided by the Synthetics agent to check that the value of the `placeholder` attribute matches a specific string. -[discrete] -[[synthetics-assertions-methods]] -== Supported `expect` methods - -:jest: https://jestjs.io/docs - -* {jest}/expect#not[`not ()`] -* {jest}/expect#resolves[`resolves ()`] -* {jest}/expect#rejects[`rejects ()`] -* {jest}/expect#tobevalue[`toBe (expected)`] -* {jest}/expect#tobeclosetonumber-numdigits[`toBeCloseTo (expected, numDigits?)`] -* {jest}/expect#tobedefined[`toBeDefined ()`] -* {jest}/expect#tobefalsy[`toBeFalsy ()`] -* {jest}/expect#tobegreaterthannumber\--bigint[`toBeGreaterThan (expected)`] -* {jest}/expect#tobegreaterthanorequalnumber\--bigint[`toBeGreaterThanOrEqual (expected)`] -* {jest}/expect#tobeinstanceofclass[`toBeInstanceOf (expected)`] -* {jest}/expect#tobelessthannumber\--bigint[`toBeLessThan (expected)`] -* {jest}/expect#tobelessthanorequalnumber\--bigint[`toBeLessThanOrEqual (expected)`] -* {jest}/expect#tobenull[`toBeNull ()`] -* {jest}/expect#tobetruthy[`toBeTruthy ()`] -* {jest}/expect#tobeundefined[`toBeUndefined ()`] -* {jest}/expect#tobenan[`toBeNaN ()`] -* {jest}/expect#tocontainitem[`toContain (expected)`] -* {jest}/expect#tocontainequalitem[`toContainEqual (expected)`] -* {jest}/expect#toequalvalue[`toEqual (expected)`] -* {jest}/expect#tohavelengthnumber[`toHaveLength (expected)`] -* {jest}/expect#tohavepropertykeypath-value[`toHaveProperty (keyPath, value?)`] -* {jest}/expect#tomatchregexp\--string[`toMatch (expected)`] -* {jest}/expect#tomatchobjectobject[`toMatchObject (expected)`] -* {jest}/expect#tostrictequalvalue[`toStrictEqual (expected)`] - - [discrete] [[synthetics-request-param]] = Make API requests