I'm moving tests from protractor to cypress.
I have two elements like below. I want to get the number and add them and store them in a variable.
<span id="num-2">20</span>
In protractor I wrote it like below
var totalCount =
parseInt(element(by.id('num-1')).getText()) +
parseInt(element(by.id('num-2')).getText());
I can't figure out how to do it in Cypress.