Skip to content

Conversation

@prathams-cmd
Copy link
Collaborator

@prathams-cmd prathams-cmd commented Feb 12, 2026

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

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.

@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
Copy link

Copilot AI left a 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.

@prathams-cmd prathams-cmd requested a review from amaanbs February 13, 2026 10:26
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.

1 participant