I need to check the text of a Div tag and ensure if it is showing the correct text of not
here is the HTML Code:
Here is the step definition i wrote to assert the content
Given(/^offer summary section should display "([^"]*)" amount against "([^"]*)"$/, (charge, labelText) => {
const parentElement = cy.get('.c-offer-summary > .c-offer-summary__ledger').children('.c-ledger__section').find('.c-ledger__row-name').contains(labelText).parent();
parentElement.find('.c-ledger__row-amount').invoke('text').should('eq',charge);
});
But cypress is throwing an error:
I am not sure where i am going wrong !!! :(
any help is appreciated