GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add: Cucumber/Gherkin step detection and assertion logging for test observability by prathams-cmd · Pull Request #1053 · browserstack/browserstack-cypress-cli

Conversation

@prathams-cmd

@prathams-cmd prathams-cmd commented Feb 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

What is this about?

Assertions logs and Cucumber/Gherkin step definitions were not showing up in observability log. I used Cypress log:changed event to detect these. I used createdAt and updatedAt timestamps and pushed COMMAND_START and COMMAND_END events for assertions logs and passed it as test_observability_command. The functions for showing cucumber step definitions were already placed I just detected them and passed it as test_observability_step.

Related Jira task/s

  • https://browserstack.atlassian.net/browse/SDK-4928
  • https://browserstack.atlassian.net/browse/SDK-4865

Automation cases to add

  • Cypress test script

it('displays two todo items by default', () => {
    cy.log('Verifying default todo items are displayed')

    // should (length)
    cy.get('.todo-list li').should('have.length', 2)

    // expect (first item text)
    cy.get('.todo-list li').first().then(($first) => {
      expect($first.text()).to.equal('Pay electric bill')
    })

    // assert (last item text)
    cy.get('.todo-list li').last().then(($last) => {
      assert.include($last.text(), 'Walk the dog', 'Last item contains expected text')
    })

  })
  • Cucumber test script

import { Given, When, Then, defineStep } from "@badeball/cypress-cucumber-preprocessor";

import "cypress-xpath";

import Login from "../pages/login.page";
import Purchase from "../pages/purchase.page";
import Orders from "../pages/orders.page";

const login = new Login();
const purchase = new Purchase();
const orders = new Orders();

Given("I navigate to website", () => {
  cy.visit(Cypress.config().baseUrl + "signin");
});

defineStep("I wait for the page to load", () => {
  cy.document().its("readyState").should("eq", "complete");
});

When("I SignIn as {string} with {string} password", (username, password) => {
  login
    .username()
    .should("be.visible")
    .click({ force: true })
    .type(username + "{enter}");
  login
    .password()
    .click({ force: true })
    .type(password + "{enter}");
  login.logInButton().click();
});
When("I add three products to cart", () => {
  purchase.item1().click({ force: true });
  purchase.item2().click({ force: true });
  purchase.item3().click({ force: true });
});
When("I click on Buy Button", () => {
  purchase.buyButton().click({ force: true });
});
When(
  "I enter shipping details {string}, {string}, {string}, {string} and {string}",
  (first, last, address, province, pincode) => {
    cy.get("#firstNameInput").type(first);
    cy.get("#lastNameInput").type(last);
    cy.get("#addressLine1Input").type(address);
    cy.get("#provinceInput").type(province);
    cy.get("#postCodeInput").type(pincode);
  }
);
When("I click on Checkout Button", () => {
  orders.checkout().click();
  cy.contains("Continue ").click();
});
When("I click on {string} link", (link) => {
  cy.contains(link).click();
});
Then("I should see elements in list", () => {
  cy.xpath("/html/body/div/main/div/div/div/div[2]/div/div[2]")
    .children("div")
    .should("have.length", 3);
  cy.pause();
});

Code changes to check

Please ensure that the following guidelines are being followed

  • Spread operator is not used.
  • Used syntax is supported by node 12+. Ex. No ? operator.

Checklist

  • Has it been approved by a member of your team?
  • Has it been tested with obfuscation locally? Refer this.
  • Have release notes been added to nodejs.yml?
  • Required automation cases are added in description.

PR Validations

SCA: Comment RUN_SCA to trigger SCA check.
Run Tests: Comment RUN_TESTS to trigger tests.
Note: Make sure to pull the latest main branch changes in your branch before running the check.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@prathams-cmd prathams-cmd changed the title SDK-4928: Cypress - missing assertion-level logs in the new Dashboard Add: Cucumber/Gherkin step detection and assertion logging for test observability Feb 12, 2026
@prathams-cmd
prathams-cmd requested review from 07souravkunda and Copilot February 12, 2026 14:40
Copilot AI reviewed Feb 13, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@prathams-cmd
prathams-cmd requested a review from amaanbs February 13, 2026 10:26
07souravkunda
07souravkunda requested changes Feb 16, 2026
View reviewed changes

@07souravkunda 07souravkunda left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Test with some old versioins as well.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bin/testObservability/cypress/index.js Outdated
if (shouldSkipCommand(command)) {
return;
}
// Cypress.on('log:added', (log) => {

@07souravkunda 07souravkunda Feb 16, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

remove commented code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bin/testObservability/cypress/index.js Outdated

const keyword = (attrs.name || '').trim();
if (STEP_KEYWORDS.includes(keyword.toLowerCase())) {
const text = (attrs.message || '').replace(/\*\*/g, '');

@07souravkunda 07souravkunda Feb 16, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

remove if not breaking anything

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@prathams-cmd
prathams-cmd requested a review from osho-20 February 18, 2026 07:02
osho-20
osho-20 previously approved these changes Feb 18, 2026
View reviewed changes
07souravkunda
07souravkunda requested changes Feb 18, 2026
View reviewed changes
Comment thread bin/testObservability/cypress/index.js Outdated
if (!Cypress.env('BROWSERSTACK_O11Y_LOGS')) return;
if (!attrs) return;
if (attrs.state !== 'passed' && attrs.state !== 'failed') return;
if (parseInt(Cypress.version.split('.')[0], 10) >= 13) {

@07souravkunda 07souravkunda Feb 18, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

if the timestamp field is not present do early return, no need to check cypress version.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@prathams-cmd
prathams-cmd dismissed osho-20’s stale review via 4c57f3b February 18, 2026 09:34
07souravkunda
07souravkunda previously approved these changes Feb 18, 2026
View reviewed changes
osho-20
osho-20 previously approved these changes Feb 18, 2026
View reviewed changes
@prathams-cmd
Added displayName field for step-definition
b7fbcfa
@prathams-cmd
prathams-cmd dismissed stale reviews from osho-20 and 07souravkunda via b7fbcfa February 20, 2026 11:12
07souravkunda
07souravkunda previously approved these changes Feb 20, 2026
View reviewed changes
@prathams-cmd
prathams-cmd removed the request for review from amaanbs February 23, 2026 12:30
@yashdsaraf yashdsaraf mentioned this pull request Mar 2, 2026
Cucumber step definition and assertion logs detection #1055
Merged
@prathams-cmd
prathams-cmd dismissed 07souravkunda’s stale review March 2, 2026 10:25

The merge-base changed after approval.

@prathams-cmd
Merge branch 'browserstack:master' into master
4c9799e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@07souravkunda 07souravkunda 07souravkunda left review comments
@osho-20 osho-20 osho-20 left review comments

At least 1 approving review is required to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@prathams-cmd @07souravkunda @osho-20
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.