Skip to content

test(e2e): assert exact pass counts in the playground scripting specs - #105

Merged
arpit-bruno merged 3 commits into
usebruno:release/v0.5.0from
lokesh-bruno:bru-4676-exact-script-pass-counts
Oct 19, 2026
Merged

arpit-bruno merged 3 commits into
usebruno:release/v0.5.0from
lokesh-bruno:bru-4676-exact-script-pass-counts

Conversation

@lokesh-bruno

Copy link
Copy Markdown
Contributor

Ref BRU-4676

Description

Tightens the playground scripting specs so a case that silently stops running fails the test. The req, bru, and res specs used to pass when at least one case passed and none failed.

The coverage includes:

  • bru-object-scripting.spec.ts requires Tests (7), Passed: 7, Failed: 0.
  • request-object-scripting.spec.ts requires Tests (10), Passed: 10, Failed: 0.
  • response-object-scripting.spec.ts requires Tests (11), Passed: 11, Failed: 0 for the main script, and Tests (1), Passed: 1, Failed: 0 for the hidden-header script.
  • bru.getAssertionResults must return at least one real pass (status pass, operator eq). The spec adds res.status equals 200 on get users first, because that request has no assertions.
  • Every unsupported bru API warning in the banner: 22 messages. The script calls 21 APIs, and reading bru.runner.iterationData warns once for the object before .get() warns for the method.

@changeset-bot

changeset-bot Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7675f0f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@usebruno/api-docs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

`${api} is not currently supported in the Bruno playground. Please use the Bruno desktop app.`;

// One entry per call in the unsupported-API script. Reading `bru.runner.iterationData`
// also warns for the object itself, before `.get()` warns for the method.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comments


await expect(page.getByText(/Passed: [1-9]\d*, Failed: 0/).first()).toBeVisible();
await expect(page.getByText(/Failed: [1-9]/)).toHaveCount(0);
await expect(responsePane.testsPanel.getByText('Tests (7), Passed: 7, Failed: 0')).toBeVisible();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please get this by id and let this be equal to 'Tests (7), Passed: 7, Failed: 0'


await expect(page.getByText(/Passed: [1-9]\d*, Failed: 0/).first()).toBeVisible();
await expect(page.getByText(/Failed: [1-9]/)).toHaveCount(0);
await expect(responsePane.testsPanel.getByText('Tests (10), Passed: 10, Failed: 0')).toBeVisible();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here


await expect(page.getByText(/Passed: [1-9]\d*, Failed: 0/).first()).toBeVisible();
await expect(page.getByText(/Failed: [1-9]/)).toHaveCount(0);
await expect(responsePane.testsPanel.getByText('Tests (1), Passed: 1, Failed: 0')).toBeVisible();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here


await expect(page.getByText(/Passed: [1-9]\d*, Failed: 0/).first()).toBeVisible();
await expect(page.getByText(/Failed: [1-9]/)).toHaveCount(0);
await expect(responsePane.testsPanel.getByText('Tests (11), Passed: 11, Failed: 0')).toBeVisible();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@arpit-bruno
arpit-bruno merged commit cf6dd6f into usebruno:release/v0.5.0 Oct 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants