<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Retrying Assertions on Grafana Labs</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/</link><description>Recent content in Retrying Assertions on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/index.xml" rel="self" type="application/rss+xml"/><item><title>toBeChecked()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tobechecked/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tobechecked/</guid><content><![CDATA[&lt;h1 id=&#34;tobechecked&#34;&gt;toBeChecked()&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;toBeChecked()&lt;/code&gt; method asserts that a checkbox or radio button is checked. This is a retrying assertion that automatically waits for the element to become checked.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;!-- eslint-skip --&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;await expect(locator).toBeChecked();
await expect(locator).not.toBeChecked();
await expect(locator).toBeChecked(options);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/retryconfig/&#34;&gt;RetryConfig&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;Optional configuration options&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Promise&lt;void&gt;&lt;/td&gt;
              &lt;td&gt;A promise that resolves when the assertion passes&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;toBeChecked()&lt;/code&gt; method checks if a checkbox or radio button is checked. This assertion is specifically designed for form elements that have a checked state.&lt;/p&gt;
&lt;p&gt;This is a retrying assertion that will automatically re-check the element&amp;rsquo;s state until it becomes checked or the timeout is reached.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;
import { expect } from &amp;#39;https://jslib.k6.io/k6-testing/0.6.1/index.js&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  }
};

export default async function () {
  const page = await browser.newPage();

  // Go to a test page that demonstrates checkbox functionality
  await page.goto(&amp;#39;https://quickpizza.grafana.com&amp;#39;);

  // Check a checkbox
  await page.locator(&amp;#39;#accept-terms&amp;#39;).check();
  await expect(page.locator(&amp;#39;#accept-terms&amp;#39;)).toBeChecked();

  // Check a radio button
  await page.locator(&amp;#39;input[name=&amp;#34;gender&amp;#34;][value=&amp;#34;male&amp;#34;]&amp;#39;).check();
  await expect(page.locator(&amp;#39;input[name=&amp;#34;gender&amp;#34;][value=&amp;#34;male&amp;#34;]&amp;#39;)).toBeChecked();

  // Verify another option is not checked
  await expect(page.locator(&amp;#39;input[name=&amp;#34;gender&amp;#34;][value=&amp;#34;female&amp;#34;]&amp;#39;)).not.toBeChecked();
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="tobechecked">toBeChecked()&lt;/h1>
&lt;p>The &lt;code>toBeChecked()&lt;/code> method asserts that a checkbox or radio button is checked. This is a retrying assertion that automatically waits for the element to become checked.&lt;/p></description></item><item><title>toBeDisabled()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tobedisabled/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tobedisabled/</guid><content><![CDATA[&lt;h1 id=&#34;tobedisabled&#34;&gt;toBeDisabled()&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;toBeDisabled()&lt;/code&gt; method asserts that an element is disabled. This is a retrying assertion that automatically waits for the element to become disabled.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;!-- eslint-skip --&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;await expect(locator).toBeDisabled();
await expect(locator).not.toBeDisabled();
await expect(locator).toBeDisabled(options);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/retryconfig/&#34;&gt;RetryConfig&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;Optional configuration options&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Promise&lt;void&gt;&lt;/td&gt;
              &lt;td&gt;A promise that resolves when the assertion passes&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;toBeDisabled()&lt;/code&gt; method checks if an element is disabled. An element is considered disabled if it has the &lt;code&gt;disabled&lt;/code&gt; attribute or property set to &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This is a retrying assertion that will automatically re-check the element&amp;rsquo;s disabled state until it becomes disabled or the timeout is reached.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;
import { expect } from &amp;#39;https://jslib.k6.io/k6-testing/0.6.1/index.js&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  }
};

export default async function () {
  const page = await browser.newPage();
  await page.goto(&amp;#39;https://quickpizza.grafana.com/&amp;#39;);

  // Click the pizza button to see the recommendation
  await page.locator(&amp;#39;button[name=&amp;#34;pizza-please&amp;#34;]&amp;#39;).click();

  // Wait for the recommendation to appear
  await expect(page.locator(&amp;#39;h2[id=&amp;#34;pizza-name&amp;#34;]&amp;#39;)).toBeVisible();

  // The pizza button should now be disabled (no longer clickable)
  await expect(page.locator(&amp;#39;button[name=&amp;#34;pizza-please&amp;#34;]&amp;#39;)).toBeDisabled();

  // Verify that we can check for disabled state
  await expect(page.locator(&amp;#39;button[name=&amp;#34;pizza-please&amp;#34;]&amp;#39;)).not.toBeEnabled();
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="tobedisabled">toBeDisabled()&lt;/h1>
&lt;p>The &lt;code>toBeDisabled()&lt;/code> method asserts that an element is disabled. This is a retrying assertion that automatically waits for the element to become disabled.&lt;/p>
&lt;h2 id="syntax">Syntax&lt;/h2>
&lt;!-- eslint-skip -->
&lt;!-- md-k6:skip -->
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">JavaScript&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-javascript">await expect(locator).toBeDisabled();
await expect(locator).not.toBeDisabled();
await expect(locator).toBeDisabled(options);&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="parameters">Parameters&lt;/h2>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>
&lt;a href="/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/retryconfig/">RetryConfig&lt;/a>&lt;/td>
&lt;td>Optional configuration options&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h2 id="returns">Returns&lt;/h2>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Promise&lt;void>&lt;/td>
&lt;td>A promise that resolves when the assertion passes&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h2 id="description">Description&lt;/h2>
&lt;p>The &lt;code>toBeDisabled()&lt;/code> method checks if an element is disabled. An element is considered disabled if it has the &lt;code>disabled&lt;/code> attribute or property set to &lt;code>true&lt;/code>.&lt;/p></description></item><item><title>toBeEditable()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tobeeditable/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tobeeditable/</guid><content><![CDATA[&lt;h1 id=&#34;tobeeditable&#34;&gt;toBeEditable()&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;toBeEditable()&lt;/code&gt; method asserts that an element is editable. This is a retrying assertion that automatically waits for the element to become editable.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;!-- eslint-skip --&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;await expect(locator).toBeEditable();
await expect(locator).not.toBeEditable();
await expect(locator).toBeEditable(options);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/retryconfig/&#34;&gt;RetryConfig&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;Optional configuration options&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Promise&lt;void&gt;&lt;/td&gt;
              &lt;td&gt;A promise that resolves when the assertion passes&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;toBeEditable()&lt;/code&gt; method checks if an element is editable. An element is considered editable if it can receive user input. This includes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Input fields that are not disabled or readonly&lt;/li&gt;
&lt;li&gt;Textareas that are not disabled or readonly&lt;/li&gt;
&lt;li&gt;Elements with &lt;code&gt;contenteditable=&amp;quot;true&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is a retrying assertion that will automatically re-check the element&amp;rsquo;s editable state until it becomes editable or the timeout is reached.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;
import { expect } from &amp;#39;https://jslib.k6.io/k6-testing/0.6.1/index.js&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  }
};

export default async function () {
  const page = await browser.newPage();

  // Go to a test page that demonstrates editable functionality
  await page.goto(&amp;#39;https://quickpizza.grafana.com/login&amp;#39;);

  // Check that input fields are editable
  await expect(page.locator(&amp;#39;#username&amp;#39;)).toBeEditable();
  await expect(page.locator(&amp;#39;#password&amp;#39;)).toBeEditable();
  await expect(page.locator(&amp;#39;#message&amp;#39;)).toBeEditable();

  // Check readonly field is not editable
  await expect(page.locator(&amp;#39;#readonly-field&amp;#39;)).not.toBeEditable();

  // Check contenteditable elements
  await expect(page.locator(&amp;#39;[contenteditable=&amp;#34;true&amp;#34;]&amp;#39;)).toBeEditable();
  await expect(page.locator(&amp;#39;[contenteditable=&amp;#34;false&amp;#34;]&amp;#39;)).not.toBeEditable();
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="tobeeditable">toBeEditable()&lt;/h1>
&lt;p>The &lt;code>toBeEditable()&lt;/code> method asserts that an element is editable. This is a retrying assertion that automatically waits for the element to become editable.&lt;/p>
&lt;h2 id="syntax">Syntax&lt;/h2>
&lt;!-- eslint-skip -->
&lt;!-- md-k6:skip -->
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">JavaScript&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-javascript">await expect(locator).toBeEditable();
await expect(locator).not.toBeEditable();
await expect(locator).toBeEditable(options);&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="parameters">Parameters&lt;/h2>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>
&lt;a href="/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/retryconfig/">RetryConfig&lt;/a>&lt;/td>
&lt;td>Optional configuration options&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h2 id="returns">Returns&lt;/h2>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Promise&lt;void>&lt;/td>
&lt;td>A promise that resolves when the assertion passes&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h2 id="description">Description&lt;/h2>
&lt;p>The &lt;code>toBeEditable()&lt;/code> method checks if an element is editable. An element is considered editable if it can receive user input. This includes:&lt;/p></description></item><item><title>toBeEmpty()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tobeempty/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tobeempty/</guid><content><![CDATA[&lt;h1 id=&#34;tobeempty&#34;&gt;toBeEmpty()&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;toBeEmpty()&lt;/code&gt; method asserts that an element is empty. It automatically retries the assertion until the element becomes empty or the timeout is reached.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;!-- eslint-skip --&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;await expect(locator).toBeEmpty();
await expect(locator).not.toBeEmpty();
await expect(locator).toBeEmpty(options);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/retryconfig/&#34;&gt;RetryConfig&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;Optional configuration options&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Promise&lt;void&gt;&lt;/td&gt;
              &lt;td&gt;A promise that resolves when the assertion passes&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;toBeEmpty()&lt;/code&gt; method checks if an element is empty. An element is considered empty if:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For input elements: the value is an empty string (&lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;For other elements: the text content is empty (no visible text)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This method automatically retries the assertion until the element&amp;rsquo;s content becomes empty or the timeout is reached.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;
import { expect } from &amp;#39;https://jslib.k6.io/k6-testing/0.6.1/index.js&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  }
};

export default async function () {
  const page = await browser.newPage();
  await page.goto(&amp;#39;https://quickpizza.grafana.com/&amp;#39;);

  // Click on the advanced checkbox
  await page.locator(&amp;#39;label div&amp;#39;).click();

  // Check that an input field is empty
  await expect(page.locator(&amp;#39;#pizza-name&amp;#39;)).toBeEmpty();

  // Fill input and then verify it&amp;#39;s not empty
  await page.locator(&amp;#39;#pizza-name&amp;#39;).fill(&amp;#39;my pizza&amp;#39;);
  await expect(page.locator(&amp;#39;#pizza-name&amp;#39;)).not.toBeEmpty();
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="tobeempty">toBeEmpty()&lt;/h1>
&lt;p>The &lt;code>toBeEmpty()&lt;/code> method asserts that an element is empty. It automatically retries the assertion until the element becomes empty or the timeout is reached.&lt;/p></description></item><item><title>toBeHidden()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tobehidden/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tobehidden/</guid><content><![CDATA[&lt;h1 id=&#34;tobehidden&#34;&gt;toBeHidden()&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;toBeHidden()&lt;/code&gt; method asserts that an element is hidden on the page. This is a retrying assertion that automatically waits for the element to become hidden.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;!-- eslint-skip --&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;await expect(locator).toBeHidden();
await expect(locator).not.toBeHidden();
await expect(locator).toBeHidden(options);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/retryconfig/&#34;&gt;RetryConfig&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;Optional configuration options&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Promise&lt;void&gt;&lt;/td&gt;
              &lt;td&gt;A promise that resolves when the assertion passes&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;toBeHidden()&lt;/code&gt; method checks if an element is hidden on the page. An element is considered hidden if:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It does not exist in the DOM&lt;/li&gt;
&lt;li&gt;It has zero dimensions&lt;/li&gt;
&lt;li&gt;It is hidden by CSS (&lt;code&gt;display: none&lt;/code&gt;, &lt;code&gt;visibility: hidden&lt;/code&gt;, etc.)&lt;/li&gt;
&lt;li&gt;It is outside the viewport bounds&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is a retrying assertion that will automatically re-check the element&amp;rsquo;s visibility until it becomes hidden or the timeout is reached.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;
import { expect } from &amp;#39;https://jslib.k6.io/k6-testing/0.6.1/index.js&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  }
};

export default async function () {
  const page = await browser.newPage();
  await page.goto(&amp;#39;https://quickpizza.grafana.com/&amp;#39;);

  // Check that non-existent elements are hidden
  await expect(page.locator(&amp;#39;.error-message&amp;#39;)).toBeHidden();
  await expect(page.locator(&amp;#39;.loading-spinner&amp;#39;)).toBeHidden();

  // Click the pizza button to show the recommendation
  await page.locator(&amp;#39;button[name=&amp;#34;pizza-please&amp;#34;]&amp;#39;).click();

  // Wait for the recommendation to appear
  await expect(page.locator(&amp;#39;h2[id=&amp;#34;pizza-name&amp;#34;]&amp;#39;)).not.toBeHidden();

  // Verify the button is no longer visible after clicking
  await expect(page.locator(&amp;#39;button[name=&amp;#34;pizza-please&amp;#34;]&amp;#39;)).toBeHidden();
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="tobehidden">toBeHidden()&lt;/h1>
&lt;p>The &lt;code>toBeHidden()&lt;/code> method asserts that an element is hidden on the page. This is a retrying assertion that automatically waits for the element to become hidden.&lt;/p></description></item><item><title>toBeVisible()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tobevisible/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tobevisible/</guid><content><![CDATA[&lt;h1 id=&#34;tobevisible&#34;&gt;toBeVisible()&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;toBeVisible()&lt;/code&gt; method asserts that an element is visible on the page. This is a retrying assertion that automatically waits for the element to become visible.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;!-- eslint-skip --&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;await expect(locator).toBeVisible();
await expect(locator).not.toBeVisible();
await expect(locator).toBeVisible(options);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/retryconfig/&#34;&gt;RetryConfig&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;Optional configuration options&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Promise&lt;void&gt;&lt;/td&gt;
              &lt;td&gt;A promise that resolves when the assertion passes&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;toBeVisible()&lt;/code&gt; method checks if an element is visible on the page. An element is considered visible if:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It exists in the DOM&lt;/li&gt;
&lt;li&gt;It has non-zero dimensions&lt;/li&gt;
&lt;li&gt;It is not hidden by CSS (&lt;code&gt;display: none&lt;/code&gt;, &lt;code&gt;visibility: hidden&lt;/code&gt;, etc.)&lt;/li&gt;
&lt;li&gt;It is not outside the viewport bounds&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is a retrying assertion that will automatically re-check the element&amp;rsquo;s visibility until it becomes visible or the timeout is reached.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;
import { expect } from &amp;#39;https://jslib.k6.io/k6-testing/0.6.1/index.js&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  }
};

export default async function () {
  const page = await browser.newPage();
  await page.goto(&amp;#39;https://quickpizza.grafana.com/&amp;#39;);

  // Wait for element to be visible
  await expect(page.locator(&amp;#39;h1&amp;#39;)).toBeVisible();
  await expect(page.locator(&amp;#39;button[name=&amp;#34;pizza-please&amp;#34;]&amp;#39;)).toBeVisible();
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="tobevisible">toBeVisible()&lt;/h1>
&lt;p>The &lt;code>toBeVisible()&lt;/code> method asserts that an element is visible on the page. This is a retrying assertion that automatically waits for the element to become visible.&lt;/p></description></item><item><title>toHaveText()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tohavetext/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tohavetext/</guid><content><![CDATA[&lt;h1 id=&#34;tohavetext&#34;&gt;toHaveText()&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;toHaveText()&lt;/code&gt; method asserts that an element has specific text content. This is a retrying assertion that automatically waits for the element to have the expected text.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;!-- eslint-skip --&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;await expect(locator).toHaveText(expected);
await expect(locator).not.toHaveText(expected);
await expect(locator).toHaveText(expected, options);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;expected&lt;/td&gt;
              &lt;td&gt;string | RegExp | Array&lt;/td&gt;
              &lt;td&gt;The expected text content&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;Optional configuration options&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;options&#34;&gt;Options&lt;/h3&gt;
&lt;p&gt;This method accepts all 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/retryconfig/&#34;&gt;RetryConfig&lt;/a&gt; properties plus:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Property&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;useInnerText&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Use innerText instead of textContent&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Promise&lt;void&gt;&lt;/td&gt;
              &lt;td&gt;A promise that resolves when the assertion passes&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;toHaveText()&lt;/code&gt; method checks if an element has specific text content. By default, it uses &lt;code&gt;textContent&lt;/code&gt; which includes all text nodes, including hidden ones. When &lt;code&gt;useInnerText&lt;/code&gt; is true, it uses &lt;code&gt;innerText&lt;/code&gt; which only includes visible text.&lt;/p&gt;
&lt;p&gt;This is a retrying assertion that will automatically re-check the element&amp;rsquo;s text content until it matches the expected value or the timeout is reached.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;
import { expect } from &amp;#39;https://jslib.k6.io/k6-testing/0.6.1/index.js&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  }
};

export default async function () {
  const page = await browser.newPage();
  await page.goto(&amp;#39;https://quickpizza.grafana.com/&amp;#39;);

  // Check exact text content
  await expect(page.locator(&amp;#39;h1&amp;#39;)).toHaveText(&amp;#39;Looking to break out of your pizza routine?&amp;#39;);

  // Click the pizza button to get a recommendation
  await page.locator(&amp;#39;button[name=&amp;#34;pizza-please&amp;#34;]&amp;#39;).click();

  // Check the recommendation header text
  await expect(page.locator(&amp;#39;h2&amp;#39;)).toHaveText(&amp;#39;QuickPizza has your back!&amp;#39;);
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="tohavetext">toHaveText()&lt;/h1>
&lt;p>The &lt;code>toHaveText()&lt;/code> method asserts that an element has specific text content. This is a retrying assertion that automatically waits for the element to have the expected text.&lt;/p></description></item><item><title>toContainText()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tocontaintext/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tocontaintext/</guid><content><![CDATA[&lt;h1 id=&#34;tocontaintext&#34;&gt;toContainText()&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;toContainText()&lt;/code&gt; method asserts that an element contains specific text as a substring. This is a retrying assertion that automatically waits for the element to contain the expected text.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;!-- eslint-skip --&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;await expect(locator).toContainText(expected);
await expect(locator).not.toContainText(expected);
await expect(locator).toContainText(expected, options);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;expected&lt;/td&gt;
              &lt;td&gt;string | RegExp&lt;/td&gt;
              &lt;td&gt;The text to search for&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;Optional configuration options&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;options&#34;&gt;Options&lt;/h3&gt;
&lt;p&gt;This method accepts all 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/retryconfig/&#34;&gt;RetryConfig&lt;/a&gt; properties plus:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Property&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;useInnerText&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Use innerText instead of textContent&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Promise&lt;void&gt;&lt;/td&gt;
              &lt;td&gt;A promise that resolves when the assertion passes&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;toContainText()&lt;/code&gt; method checks if an element contains specific text as a substring. Unlike &lt;code&gt;toHaveText()&lt;/code&gt;, which requires exact text matching, &lt;code&gt;toContainText()&lt;/code&gt; succeeds if the expected text is found anywhere within the element&amp;rsquo;s text content.&lt;/p&gt;
&lt;p&gt;By default, it uses &lt;code&gt;textContent&lt;/code&gt; which includes all text nodes, including hidden ones. When &lt;code&gt;useInnerText&lt;/code&gt; is true, it uses &lt;code&gt;innerText&lt;/code&gt; which only includes visible text.&lt;/p&gt;
&lt;p&gt;This is a retrying assertion that will automatically re-check the element&amp;rsquo;s text content until it contains the expected text or the timeout is reached.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;
import { expect } from &amp;#39;https://jslib.k6.io/k6-testing/0.6.1/index.js&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  }
};

export default async function () {
  const page = await browser.newPage();
  await page.goto(&amp;#39;https://quickpizza.grafana.com/&amp;#39;);

  // Check that elements contain expected text
  await expect(page.locator(&amp;#39;h1&amp;#39;)).toContainText(&amp;#39;pizza&amp;#39;);
  await expect(page.locator(&amp;#39;h1&amp;#39;)).toContainText(&amp;#39;routine&amp;#39;);

  // Click the pizza button to get a recommendation
  await page.locator(&amp;#39;button[name=&amp;#34;pizza-please&amp;#34;]&amp;#39;).click();

  // Check that the recommendation contains expected text
  await expect(page.locator(&amp;#39;h2&amp;#39;)).toContainText(&amp;#39;QuickPizza&amp;#39;);
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="tocontaintext">toContainText()&lt;/h1>
&lt;p>The &lt;code>toContainText()&lt;/code> method asserts that an element contains specific text as a substring. This is a retrying assertion that automatically waits for the element to contain the expected text.&lt;/p></description></item><item><title>toBeEnabled()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tobeenabled/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tobeenabled/</guid><content><![CDATA[&lt;h1 id=&#34;tobeenabled&#34;&gt;toBeEnabled()&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;toBeEnabled()&lt;/code&gt; method asserts that an element is enabled and interactive. This is a retrying assertion that automatically waits for the element to become enabled.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;!-- eslint-skip --&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;await expect(locator).toBeEnabled();
await expect(locator).not.toBeEnabled();
await expect(locator).toBeEnabled(options);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/retryconfig/&#34;&gt;RetryConfig&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;Optional configuration options&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Promise&lt;void&gt;&lt;/td&gt;
              &lt;td&gt;A promise that resolves when the assertion passes&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;toBeEnabled()&lt;/code&gt; method checks if an element is enabled and interactive. An element is considered enabled if:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It exists in the DOM&lt;/li&gt;
&lt;li&gt;It does not have the &lt;code&gt;disabled&lt;/code&gt; attribute&lt;/li&gt;
&lt;li&gt;It is not disabled through CSS or JavaScript&lt;/li&gt;
&lt;li&gt;It can receive user interactions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is a retrying assertion that will automatically re-check the element&amp;rsquo;s enabled state until it becomes enabled or the timeout is reached.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;
import { expect } from &amp;#39;https://jslib.k6.io/k6-testing/0.6.1/index.js&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  }
};

export default async function () {
  const page = await browser.newPage();
  await page.goto(&amp;#39;https://quickpizza.grafana.com/&amp;#39;);

  // Check that the pizza button is enabled
  await expect(page.locator(&amp;#39;button[name=&amp;#34;pizza-please&amp;#34;]&amp;#39;)).toBeEnabled();

  // Check that buttons are generally enabled on the page
  await expect(page.locator(&amp;#39;button&amp;#39;)).toBeEnabled();
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="tobeenabled">toBeEnabled()&lt;/h1>
&lt;p>The &lt;code>toBeEnabled()&lt;/code> method asserts that an element is enabled and interactive. This is a retrying assertion that automatically waits for the element to become enabled.&lt;/p></description></item><item><title>toHaveAttribute()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tohaveattribute/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tohaveattribute/</guid><content><![CDATA[&lt;h1 id=&#34;tohaveattribute&#34;&gt;toHaveAttribute()&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;toHaveAttribute()&lt;/code&gt; method asserts that an element has a specific attribute and optionally a specific value. This is a retrying assertion that automatically waits for the element to have the expected attribute.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;!-- eslint-skip --&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;await expect(locator).toHaveAttribute(attribute);
await expect(locator).toHaveAttribute(attribute, value);
await expect(locator).toHaveAttribute(attribute, value, options);
await expect(locator).not.toHaveAttribute(attribute);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;attribute&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;The attribute name to check for&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;value&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;Optional. The expected attribute value&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/retryconfig/&#34;&gt;RetryConfig&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;Optional configuration options&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Promise&lt;void&gt;&lt;/td&gt;
              &lt;td&gt;A promise that resolves when the assertion passes&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;toHaveAttribute()&lt;/code&gt; method checks if an element has a specific attribute. When called with just an attribute name, it verifies the attribute exists regardless of its value. When called with both attribute name and value, it verifies the attribute exists and has the exact specified value.&lt;/p&gt;
&lt;p&gt;This is a retrying assertion that will automatically re-check the element&amp;rsquo;s attributes until the condition is met or the timeout is reached.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;
import { expect } from &amp;#39;https://jslib.k6.io/k6-testing/0.6.1/index.js&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  }
};

export default async function () {
  const page = await browser.newPage();
  await page.goto(&amp;#39;https://quickpizza.grafana.com/&amp;#39;);

  // Check that the pizza button has specific attributes
  await expect(page.locator(&amp;#39;button[name=&amp;#34;pizza-please&amp;#34;]&amp;#39;)).toHaveAttribute(&amp;#39;name&amp;#39;, &amp;#39;pizza-please&amp;#39;);
  await expect(page.locator(&amp;#39;button[name=&amp;#34;pizza-please&amp;#34;]&amp;#39;)).toHaveAttribute(&amp;#39;type&amp;#39;, &amp;#39;button&amp;#39;);

  // Check that the main heading has expected attributes
  await expect(page.locator(&amp;#39;h1&amp;#39;)).toHaveAttribute(&amp;#39;class&amp;#39;);

  // Click the pizza button to get a recommendation
  await page.locator(&amp;#39;button[name=&amp;#34;pizza-please&amp;#34;]&amp;#39;).click();

  // Check that the recommendation heading has an id attribute
  await expect(page.locator(&amp;#39;h2[id=&amp;#34;pizza-name&amp;#34;]&amp;#39;)).toHaveAttribute(&amp;#39;id&amp;#39;, &amp;#39;pizza-name&amp;#39;);

  // Check absence of attribute on non-existent elements
  await expect(page.locator(&amp;#39;h1&amp;#39;)).not.toHaveAttribute(&amp;#39;disabled&amp;#39;);
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="tohaveattribute">toHaveAttribute()&lt;/h1>
&lt;p>The &lt;code>toHaveAttribute()&lt;/code> method asserts that an element has a specific attribute and optionally a specific value. This is a retrying assertion that automatically waits for the element to have the expected attribute.&lt;/p></description></item><item><title>toHaveValue()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tohavevalue/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tohavevalue/</guid><content><![CDATA[&lt;h1 id=&#34;tohavevalue&#34;&gt;toHaveValue()&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;toHaveValue()&lt;/code&gt; method asserts that an element has a specific value. This is a retrying assertion that automatically waits for the element to have the expected value.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;!-- eslint-skip --&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;await expect(locator).toHaveValue(value);
await expect(locator).not.toHaveValue(value);
await expect(locator).toHaveValue(value, options);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;value&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;The expected value&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/retryconfig/&#34;&gt;RetryConfig&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;Optional configuration options&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;void&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A promise that resolves when the assertion passes&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;toHaveValue()&lt;/code&gt; method checks if an element has a specific value. This is primarily used for form elements like input fields, textareas, and select elements. The method compares the element&amp;rsquo;s current value with the expected value.&lt;/p&gt;
&lt;p&gt;This is a retrying assertion that will automatically re-check the element&amp;rsquo;s value until it matches the expected value or the timeout is reached.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;
import { expect } from &amp;#39;https://jslib.k6.io/k6-testing/0.6.1/index.js&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  }
};

export default async function () {
  const page = await browser.newPage();

  // Go to a test page that demonstrates input functionality
  await page.goto(&amp;#39;https://quickpizza.grafana.com/login&amp;#39;);

  // Fill input and check value
  await page.locator(&amp;#39;#username&amp;#39;).fill(&amp;#39;testuser&amp;#39;);
  await expect(page.locator(&amp;#39;#username&amp;#39;)).toHaveValue(&amp;#39;testuser&amp;#39;);

  // Check textarea value
  await page.locator(&amp;#39;#message&amp;#39;).fill(&amp;#39;Hello world!&amp;#39;);
  await expect(page.locator(&amp;#39;#message&amp;#39;)).toHaveValue(&amp;#39;Hello world!&amp;#39;);

  // Check select option value
  await page.locator(&amp;#39;#country&amp;#39;).selectOption(&amp;#39;us&amp;#39;);
  await expect(page.locator(&amp;#39;#country&amp;#39;)).toHaveValue(&amp;#39;us&amp;#39;);

  // Check initial empty values
  await expect(page.locator(&amp;#39;#empty-field&amp;#39;)).toHaveValue(&amp;#39;&amp;#39;);

  // Check that field doesn&amp;#39;t have specific value
  await expect(page.locator(&amp;#39;#username&amp;#39;)).not.toHaveValue(&amp;#39;wronguser&amp;#39;);
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="tohavevalue">toHaveValue()&lt;/h1>
&lt;p>The &lt;code>toHaveValue()&lt;/code> method asserts that an element has a specific value. This is a retrying assertion that automatically waits for the element to have the expected value.&lt;/p></description></item><item><title>toHaveTitle()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tohavetitle/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/tohavetitle/</guid><content><![CDATA[&lt;h1 id=&#34;tohavetitle&#34;&gt;toHaveTitle()&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;toHaveTitle()&lt;/code&gt; method asserts that a page has a specific title. This is a retrying assertion that automatically waits for the page to have the expected title.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;!-- eslint-skip --&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;await expect(page).toHaveTitle(expected);
await expect(page).not.toHaveTitle(expected);
await expect(page).toHaveTitle(expected, options);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;expected&lt;/td&gt;
              &lt;td&gt;string | RegExp&lt;/td&gt;
              &lt;td&gt;The expected title&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/retryconfig/&#34;&gt;RetryConfig&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;Optional configuration options&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Promise&lt;void&gt;&lt;/td&gt;
              &lt;td&gt;A promise that resolves when the assertion passes&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;toHaveTitle()&lt;/code&gt; method checks if a page has a specific title. It retrives the title from the page&amp;rsquo;s &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt; element in the document&amp;rsquo;s &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When a string is provided, it performs an exact match. When a RegExp is provided, it tests the title against the regular expression pattern.&lt;/p&gt;
&lt;p&gt;This is a retrying assertion that will automatically re-check the page&amp;rsquo;s title until it matches the expected value or the timeout is reached.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;
import { expect } from &amp;#39;https://jslib.k6.io/k6-testing/0.6.1/index.js&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  }
};

export default async function () {
  const page = await browser.newPage();
  
  // Navigate and check exact title match
  await page.goto(&amp;#39;https://quickpizza.grafana.com/&amp;#39;);
  await expect(page).toHaveTitle(&amp;#39;QuickPizza&amp;#39;);

  // Check title with regex pattern
  await expect(page).toHaveTitle(/QuickPizza/);
  await expect(page).toHaveTitle(/^Quick/);
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="tohavetitle">toHaveTitle()&lt;/h1>
&lt;p>The &lt;code>toHaveTitle()&lt;/code> method asserts that a page has a specific title. This is a retrying assertion that automatically waits for the page to have the expected title.&lt;/p></description></item><item><title>RetryConfig</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/retryconfig/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/jslib/testing/retrying-assertions/retryconfig/</guid><content><![CDATA[&lt;h1 id=&#34;retryconfig&#34;&gt;RetryConfig&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;RetryConfig&lt;/code&gt; object defines configuration options that control the retry behavior of asynchronous assertions. These options can be passed to individual retrying assertions or used to create a configured expect instance with custom defaults.&lt;/p&gt;
&lt;h2 id=&#34;properties&#34;&gt;Properties&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Property&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;5000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time to wait in milliseconds&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;interval&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;100&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Time between retries in milliseconds&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;h3 id=&#34;timeout&#34;&gt;timeout&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;timeout&lt;/code&gt; property specifies the maximum amount of time (in milliseconds) that a retrying assertion will wait for a condition to become true before failing. If the condition is not met within this timeframe, the assertion will throw an error.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;5000&lt;/code&gt; (5 seconds)&lt;/p&gt;
&lt;h3 id=&#34;interval&#34;&gt;interval&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;interval&lt;/code&gt; property specifies the time (in milliseconds) between retry attempts. The assertion will check the condition, wait for the specified interval, then check again.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;100&lt;/code&gt; (100 milliseconds)&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;h3 id=&#34;per-assertion-configuration&#34;&gt;Per-Assertion Configuration&lt;/h3&gt;
&lt;p&gt;You can pass a &lt;code&gt;RetryConfig&lt;/code&gt; object as the last parameter to any retrying assertion:&lt;/p&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;
import { expect } from &amp;#39;https://jslib.k6.io/k6-testing/0.6.1/index.js&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  }
};

export default async function () {
  const page = await browser.newPage();
  await page.goto(&amp;#39;https://quickpizza.grafana.com/&amp;#39;);

  // Wait up to 10 seconds, checking every 500ms
  await expect(page.locator(&amp;#39;h1&amp;#39;)).toBeVisible({
    timeout: 10000,
    interval: 500,
  });

  // Quick check with short timeout
  await expect(page.locator(&amp;#39;button[name=&amp;#34;pizza-please&amp;#34;]&amp;#39;)).toBeVisible({
    timeout: 1000,
    interval: 50,
  });
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;creating-a-configured-expect-instance&#34;&gt;Creating a Configured Expect Instance&lt;/h3&gt;
&lt;p&gt;You can create a new expect instance with custom default configuration using &lt;code&gt;expect.configure()&lt;/code&gt;:&lt;/p&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;
import { expect } from &amp;#39;https://jslib.k6.io/k6-testing/0.6.1/index.js&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  }
};

// Create a new expect instance with custom retry configuration
const myExpect = expect.configure({
  timeout: 10000, // 10 seconds default timeout
  interval: 200, // Check every 200ms
});

export default async function () {
  const page = await browser.newPage();
  await page.goto(&amp;#39;https://quickpizza.grafana.com/&amp;#39;);

  // These assertions will use the configured defaults
  await myExpect(page.locator(&amp;#39;h1&amp;#39;)).toBeVisible();
  await myExpect(page.locator(&amp;#39;h1&amp;#39;)).toHaveText(&amp;#39;Looking to break out of your pizza routine?&amp;#39;);

  // This assertion overrides the configured defaults
  await myExpect(page.locator(&amp;#39;h1&amp;#39;)).toBeVisible({
    timeout: 30000, // 30 seconds for this specific assertion
  });

  // The original expect instance is unchanged
  await expect(page.locator(&amp;#39;button[name=&amp;#34;pizza-please&amp;#34;]&amp;#39;)).toBeVisible(); // Uses default 5000ms timeout
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;best-practices&#34;&gt;Best Practices&lt;/h2&gt;
&lt;h3 id=&#34;choosing-appropriate-timeouts&#34;&gt;Choosing Appropriate Timeouts&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Fast elements (1-2 seconds):&lt;/strong&gt; Use shorter timeouts for elements that should appear quickly&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Standard elements (5 seconds):&lt;/strong&gt; Use the default timeout for most scenarios&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Slow-loading content (10-30 seconds):&lt;/strong&gt; Use longer timeouts for elements that take time to load&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- md-k6:skip --&gt;
&lt;!-- eslint-skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;// Fast UI feedback - short timeout
await expect(page.locator(&amp;#39;#validation-message&amp;#39;)).toBeVisible({
  timeout: 2000,
});

// API-dependent content - longer timeout
await expect(page.locator(&amp;#39;#user-profile&amp;#39;)).toContainText(&amp;#39;John Doe&amp;#39;, {
  timeout: 15000,
});

// Large data sets or complex operations - very long timeout
await expect(page.locator(&amp;#39;#report-complete&amp;#39;)).toBeVisible({
  timeout: 60000,
  interval: 1000, // Check less frequently for long operations
});&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;choosing-appropriate-intervals&#34;&gt;Choosing Appropriate Intervals&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Fine-grained checking (50-100ms):&lt;/strong&gt; For rapid state changes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Standard checking (100-200ms):&lt;/strong&gt; For most UI interactions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Coarse checking (500-1000ms):&lt;/strong&gt; For slow operations or to reduce CPU usage&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- md-k6:skip --&gt;
&lt;!-- eslint-skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;// Rapid state changes - frequent checking
await expect(page.locator(&amp;#39;#animation&amp;#39;)).toBeVisible({
  timeout: 5000,
  interval: 50,
});

// Standard UI interactions - default checking
await expect(page.locator(&amp;#39;#form-submitted&amp;#39;)).toContainText(&amp;#39;Success&amp;#39;);

// Slow backend operations - infrequent checking
await expect(page.locator(&amp;#39;#batch-job-status&amp;#39;)).toContainText(&amp;#39;Complete&amp;#39;, {
  timeout: 300000, // 5 minutes
  interval: 5000, // Check every 5 seconds
});&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="retryconfig">RetryConfig&lt;/h1>
&lt;p>The &lt;code>RetryConfig&lt;/code> object defines configuration options that control the retry behavior of asynchronous assertions. These options can be passed to individual retrying assertions or used to create a configured expect instance with custom defaults.&lt;/p></description></item></channel></rss>