Uncaught TypeError: assertion.softAssert is not a function
I recently included a package called soft-assert using npm in my project. To install this package, I executed the following command:
npm i soft-assert -g --save-dev
Incorporated the following code snippet:
import * as assertion from "../../soft-assert/lib/assertion";
await assertion.softAssert(await this.headerOversightrequirements.getText(), AdminPanelData.lblOversightRequirements, AdminPanelData.lblOversightRequirements,[]);
await assertion.deepAssert(await this.headerAdminPanel.getText(), AdminPanelData.lblAdminPanel, header is displayed,[]);
I am utilizing protractor as an automation framework, with cucumber for BDD, typescript as the scripting language, and npm for managing dependencies. Despite the function being present when inspecting the code in the node_module/soft-assert package where it was installed, I keep encountering this error message. I have examined the method implementation but still cannot figure out why this issue persists. The error occurs as soon as the script reaches the line where the soft/deep assert methods are implemented.