fernandom
Posts: 8
Joined: Tue Dec 21, 2021 3:17 pm

How to simulate a line chart point click with cypress

Hi,
I'm trying to execute a click action on a line chart point using cypress, however the click event does no seem to be triggering.

Code: Select all

Cypress.Commands.add('getLineChartDataPoint', (series, point) => {
  cy.get(`.highcharts-tracker.highcharts-series-${series}`).within(() => {
    cy.get('.highcharts-point').eq(point).click({force: true});
  });
});
Does anyone have a solution for this problem?
magdalena
Posts: 517
Joined: Tue Aug 24, 2021 1:32 pm

Re: How to simulate a line chart point click with cypress

Hi,

Thanks for contacting us with your question!

I'm not familiar with cypress, but there is a similar thread with an explanation of how clicking on the line chart works.
Please, take a look at this topic and let me know if it was helpful in your case: viewtopic.php?t=40086 .

Regards!
Magdalena Gut
Developer and Highcharts Support Engineer

Return to “Highcharts Usage”