Open samaysimantbarik opened 5 years ago
Also, not available to use 'import' within gerkin stepdefinitions, getting: " Could not include object Step Definition from ./src/test-layer/step_definitions/common_steps.js from module '\src\test-layer\step_definitions\ commonsteps.js' Unexpected token import " In accordance with docs (https://codecept.io/basics) for now, it's already expected to support: 'Tests are expected to be written in ECMAScript 7.'
What are you trying to achieve?
Generate the gherkin code from bdd
What do you get instead?
Error :"Unexpected Indentifier"
Error: Could not include object Step Definition from ./step_definitions/givensteps.js from module 'C:\Projects\UNSW TESTS\e2e\unswcodecept\e2e\step_definitions\givensteps.js' Could not include object loginPage from module 'C:\Projects\UNSW TESTS\e2e\unswcodecept\e2e\pages\login.js' Unexpected identifier at loadSupportObject (C:\Projects\UNSW TESTS\e2e\unswcodecept\node_modules\codeceptjs\lib\container.js:309:11) at loadGherkinSteps (C:\Projects\UNSW TESTS\e2e\unswcodecept\node_modules\codeceptjs\lib\container.js:282:5) at Function.create (C:\Projects\UNSW TESTS\e2e\unswcodecept\node_modules\codeceptjs\lib\container.js:37:25)
const username = {id:'username'}; const password = {id:'password'}; const submitbtn = {id:'login'};
import config from 'config';
module.exports= { loginAsFaculty() { console.log("Inside login") I.amOnPage(config.get("baseUrl")) I.fillField(username, config.get("slpEditUser.username")); I.fillField(password, config.get("slpEditUser.password")); I.click(submitbtn); }
Details
If I convert the import into require(common.js), then the error is gone.
Please plan to support ES6.