Nhan Tran Trong
Nhan Tran Trong

Reputation: 45

Getting Error: Error: Cannot find module 'src/core/configurations/configFunctions when executing "protractor ./conf.ts --suite homepage"

Anyone please help me with following issue. I have an ConfigFunctions class as following I have an ***ConfigFunctions*** class as following

Then I try to access loadConfig function of this class in my spec verify.home.page.display.correclt.spec.ts I try to access ***loadConfig*** function of this class in my spec verify.home.page.display.correclt.spec.ts

Unfortunately, I got following error when trying to execute my test script Unfortunately, I got following error when trying to execute my test script

Upvotes: 1

Views: 41

Answers (2)

Nhan Tran Trong
Nhan Tran Trong

Reputation: 45

I solved my issue following these steps:

  1. Change path location in import sentence to relative as below enter image description here

  2. Due to I am using tsc command to compile ts scripts files to js script file, so I need to add rm -rf dist command to delete my dist folder before compile test script file again

enter image description here

  1. Finally, my issue was solved Many thanks for you're great effort :)

Upvotes: 0

V.Varshney
V.Varshney

Reputation: 151

The path you have written in import is incorrect, try to prove relative url with root like '../../../configurations/configFunctions'

Upvotes: 3

Related Questions