While learning cypress and javascript, I encountered this type error:
TypeError: _testElements.default.selectionRow is not a function
I have thoroughly reviewed the documentation for cypress but cannot seem to find any errors in my code. I'm hoping that someone experienced with javascript and cypress can shed some light on why this error message is appearing.
Code:
Firstly, here's the class where the element is obtained:
class testElements {
selectionRow() {
return cy.get('.selectionRow')
}
typeButton() {
return cy.get('.typeButton')
}
}
export default testElements
And here's the portion of the code that is causing the error:
import { Given, When, Then } from "cypress-cucumber-preprocessor/steps";
import testElements from '../elements/testElements';
When ("User selects a row", () => {
testElements.selectionRow()
.within(() => {
testElements.typeButton().not(".disabled");
})
})