0

My wdio file contains the following code:

specs: [
    'tests/*.js'
],

// Patterns to exclude.

exclude: [
    'POM/*.js'
],

Exception Message: ERROR: Cannot find module 'POM/LoginPage.js'

Please note: Only seems to be affecting windows machine.

My project structure:

enter image description here

Thanks for your help

SamP
  • 417
  • 5
  • 24

1 Answers1

0

That's a very interesting behavior. Your tests should run and pass as expected in this scenario. Firstly, update your question with the following: WebdriverIO version, entire stack-trace error and a page-object snippet.

There is no real solution though, as this is not an actual problem. The specs & exclude lists should filter in/out the features you want to run. I have no idea why you would include the page-objects folder here (POM).

Just remove the page-objects entry from the exclude list. Only the specs feature-files will be run. You most likely are getting this error due to a different config issue.


Hunch: There was no stack-trace error line-error, but I presume you're getting it in the page-object import from the first feature-file where it is used. This would mean that the exclude entry has nothing to do with it.

Update your question taking my response into consideration and we'll go from there. Cheers!

iamdanchiv
  • 4,052
  • 4
  • 37
  • 42