From 9c3cc1c3d69aeed3f4762fd934af7bbbb46a90d5 Mon Sep 17 00:00:00 2001 From: Marcel Rebro Date: Thu, 17 Sep 2026 16:25:36 +0200 Subject: [PATCH] docs: match UI labels exactly in docs-tests, and fix two casing drifts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The runner matched element labels with `exact: false`, so an assertion passed whenever the documented label was merely *contained* in what the Console renders. That hides the most common kind of drift: a casing change. Switching the four locators to exact matching turned up two real ones, both of which had been passing silently. - Billing: the docs said **Plan Consumption**; Console renders "Plan consumption". Fixed in the doc, and "Graph" lowercased with it since it is not part of the label. - Settings: the docs said **account-level integrations**; Console renders "Account-level integrations". Both are bolded as UI element names, so house style says they should match the screen. Exact matching stays whitespace-trimmed, so only wording, casing and trailing decoration can break a target — all things the docs should be updated to match. Of 52 UI assertions these two were the only breakages; the rest already matched their labels character for character. Verified against staging: 139 passed, 0 failed, 35 skipped. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01FSj1mTUbMKgmu2JoGJLSKD --- docs-tests/assertions/account-billing.json | 4 ++-- docs-tests/assertions/account-settings.json | 4 ++-- docs-tests/tests/from-doc.spec.ts | 15 +++++++++++---- sources/platform/account/billing/index.md | 2 +- sources/platform/account/settings/index.md | 2 +- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/docs-tests/assertions/account-billing.json b/docs-tests/assertions/account-billing.json index 7cc109c40d..b9f8729947 100644 --- a/docs-tests/assertions/account-billing.json +++ b/docs-tests/assertions/account-billing.json @@ -14,10 +14,10 @@ { "id": "plan-consumption-graph", "kind": "element_text", - "target": "Plan Consumption", + "target": "Plan consumption", "at": "/billing", "page_context": "Billing page > Current period tab > Plan Consumption graph", - "source_quote": "the tab features a **Plan Consumption** Graph.", + "source_quote": "the tab features a **Plan consumption** graph.", "source_line": 13, "needs_auth": true }, diff --git a/docs-tests/assertions/account-settings.json b/docs-tests/assertions/account-settings.json index d87fbe0d29..9c208ed57a 100644 --- a/docs-tests/assertions/account-settings.json +++ b/docs-tests/assertions/account-settings.json @@ -63,10 +63,10 @@ { "id": "account-level-integrations-label", "kind": "element_text", - "target": "account-level integrations", + "target": "Account-level integrations", "at": "/settings/integrations", "page_context": "API & Integrations tab", - "source_quote": "**account-level integrations**, and **Actor OAuth accounts**.", + "source_quote": "**Account-level integrations**, and **Actor OAuth accounts**.", "source_line": 45, "needs_auth": true }, diff --git a/docs-tests/tests/from-doc.spec.ts b/docs-tests/tests/from-doc.spec.ts index f59de14abb..8326db4b49 100644 --- a/docs-tests/tests/from-doc.spec.ts +++ b/docs-tests/tests/from-doc.spec.ts @@ -113,8 +113,15 @@ async function runAssertion(page: Page, a: Assertion): Promise { async function checkElement(page: Page, a: Assertion): Promise { switch (a.kind) { case 'element_button': { + // Exact matching. Substring matching passes whenever the documented + // label is *contained* in what the Console renders, which hides the + // most common form of drift: a casing change. "Plan Consumption" + // matched a live "Plan consumption" and the check stayed green. + // Exact is still whitespace-trimmed, so only wording, casing and + // trailing decoration (a count badge, say) can break a target — all + // of which are things the docs should be updated to match. await page - .getByRole('button', { name: a.target, exact: false }) + .getByRole('button', { name: a.target, exact: true }) .first() .waitFor({ state: 'visible', timeout: 10_000 }); return; @@ -122,8 +129,8 @@ async function checkElement(page: Page, a: Assertion): Promise { case 'element_tab': { // Playwright's `tab` role doesn't always match the Console's tab impl. // Fall back to a text match if the role lookup misses. - const byRole = page.getByRole('tab', { name: a.target, exact: false }).first(); - const byText = page.getByText(a.target, { exact: false }).first(); + const byRole = page.getByRole('tab', { name: a.target, exact: true }).first(); + const byText = page.getByText(a.target, { exact: true }).first(); try { await byRole.waitFor({ state: 'visible', timeout: 5_000 }); } catch { @@ -132,7 +139,7 @@ async function checkElement(page: Page, a: Assertion): Promise { return; } case 'element_text': { - await page.getByText(a.target, { exact: false }).first().waitFor({ state: 'visible', timeout: 10_000 }); + await page.getByText(a.target, { exact: true }).first().waitFor({ state: 'visible', timeout: 10_000 }); return; } } diff --git a/sources/platform/account/billing/index.md b/sources/platform/account/billing/index.md index 93be867467..c72c22c5fc 100644 --- a/sources/platform/account/billing/index.md +++ b/sources/platform/account/billing/index.md @@ -10,7 +10,7 @@ slug: /account/billing The **Current period** tab is a comprehensive resource for understanding your platform usage during the ongoing billing cycle. It provides an overview of your total usage and indicates the start and end dates of the current billing period. -In addition to this, the tab features a **Plan Consumption** Graph. It shows how much of your free or paid plan has been utilized up to this point. The graph offers a broad perspective of your overall usage. +In addition to this, the tab features a **Plan consumption** graph. It shows how much of your free or paid plan has been utilized up to this point. The graph offers a broad perspective of your overall usage. Apart from the platform usage breakdown graph, this tab provides more detailed information on the usage of different platform services. You can explore the sections under the graph. You can access detailed statistics related to **Actors**, **Data transfer**, **Proxy**, and **Storage**. diff --git a/sources/platform/account/settings/index.md b/sources/platform/account/settings/index.md index a903fe7543..54ce05fd0a 100644 --- a/sources/platform/account/settings/index.md +++ b/sources/platform/account/settings/index.md @@ -42,7 +42,7 @@ In the **Session** section, you can adjust the session configuration. You can mo ## API & Integrations -The **API & Integrations** tab provides essential tools for accessing the Apify platform programmatically. Here, you can manage your **API tokens**, which are necessary for using the [Apify API](https://docs.apify.com/api/v2). The tab also shows **third-party apps and services** connected to your account, **account-level integrations**, and **Actor OAuth accounts**. For detailed guidance on utilizing these integrations, refer to the [Integrations documentation](https://docs.apify.com/integrations). +The **API & Integrations** tab provides essential tools for accessing the Apify platform programmatically. Here, you can manage your **API tokens**, which are necessary for using the [Apify API](https://docs.apify.com/api/v2). The tab also shows **third-party apps and services** connected to your account, **Account-level integrations**, and **Actor OAuth accounts**. For detailed guidance on utilizing these integrations, refer to the [Integrations documentation](https://docs.apify.com/integrations). ### MCP connectors