Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you please tell how do I add assertions in my step definition file? #87

Open
shalu0628 opened this issue Jul 20, 2021 · 0 comments
Open

Comments

@shalu0628
Copy link

This is the code in my step definition for assertion --
const headingtitle = element(By.css('h2'));
let heading = await headingtitle.getText();
console.log(heading);
expect(heading).to.be.equal('First Name');
Am facing the below error

E/launcher - Error: TypeError: Cannot read property 'expect' of undefined
at Object. (C:\LenderPortal-UI\typeScript\stepdefinitions\lenderinfo.js:15:26)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at C:\LenderPortal-UI\node_modules\cucumber\lib\cli\index.js:142:42
at Array.forEach ()
at Cli.getSupportCodeLibrary (C:\LenderPortal-UI\node_modules\cucumber\lib\cli\index.js:142:22)
at C:\LenderPortal-UI\node_modules\cucumber\lib\cli\index.js:169:41
at Generator.next ()
at asyncGeneratorStep (C:\LenderPortal-UI\node_modules\cucumber\lib\cli\index.js:44:103)
at _next (C:\LenderPortal-UI\node_modules\cucumber\lib\cli\index.js:46:194)
[18:24:28] E/launcher - Process exited with error code 100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant