ui5-community / wdi5

official UI5 end-to-end test framework for UI5 web-apps. wdi5 = Webdriver.IO + UI5 Test API
https://ui5-community.github.io/wdi5/
Apache License 2.0
102 stars 43 forks source link

Couldn't find plugin "ui5" service when running example test script. #420

Closed vivianxh closed 1 year ago

vivianxh commented 1 year ago

Steps to reproduce the behavior:

  1. download the whole project
  2. go to folder /wdi5/examples/ui5-js-app/, run command npm install
  3. run command npm install wdio-ui5-service under folder ui5-js-app/

I've got below errro:

[0-24] 2023-02-07T02:55:28.672Z ERROR @wdio/utils:initialiseServices: Error: Couldn't find plugin "ui5" service, neither as wdio scoped package "@wdio/ui5-service" nor as community package "wdio-ui5-service". Please make sure you have it installed!
[0-24]     at initialisePlugin (/Users/I310978/Documents/03Code/wdi5/node_modules/@wdio/utils/build/initialisePlugin.js:41:11)
[0-24]     at initialiseServices (/Users/I310978/Documents/03Code/wdi5/node_modules/@wdio/utils/build/initialiseServices.js:59:56)
[0-24]     at initialiseWorkerService (/Users/I310978/Documents/03Code/wdi5/node_modules/@wdio/utils/build/initialiseServices.js:140:26)
[0-24]     at Runner.run (/Users/I310978/Documents/03Code/wdi5/node_modules/@wdio/runner/build/index.js:75:45)
[0-24]     at processTicksAndRejections (internal/process/task_queues.js:95:5)
[0-24] RUNNING in chrome - /webapp/test/e2e/wdioBridge.test.js
[0-24] 2023-02-07T02:55:33.283Z ERROR @wdio/runner: Error: Unable to load spec files quite likely because they rely on `browser` object that is not fully initialised.
[0-24] `browser` object has only `capabilities` and some flags like `isMobile`.
[0-24] Helper files that use other `browser` commands have to be moved to `before` hook.
[0-24] Spec file(s): /Users/I310978/Documents/03Code/wdi5/examples/ui5-js-app/webapp/test/e2e/wdioBridge.test.js
[0-24] Error: Error: Cannot find module '/Users/I310978/Documents/03Code/wdi5/node_modules/wdio-ui5-service/dist/index.js'. Please verify that the package.json has a valid "main" entry
[0-24]     at tryPackage (internal/modules/cjs/loader.js:321:19)
[0-24]     at Function.Module._findPath (internal/modules/cjs/loader.js:534:18)
[0-24]     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:888:27)
[0-24]     at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/Users/I310978/Documents/03Code/wdi5/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
[0-24]     at Function.Module._load (internal/modules/cjs/loader.js:746:27)
[0-24]     at Module.require (internal/modules/cjs/loader.js:974:19)
[0-24]     at require (internal/modules/cjs/helpers.js:93:18)
[0-24]     at Object.<anonymous> (/Users/I310978/Documents/03Code/wdi5/examples/ui5-js-app/webapp/test/e2e/pageObjects/Page.js:1:18)
[0-24]     at Module._compile (internal/modules/cjs/loader.js:1085:14)
[0-24]     at Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
[0-24]     at MochaAdapter._loadFiles (/Users/I310978/Documents/03Code/wdi5/node_modules/@wdio/mocha-framework/build/index.js:86:35)
[0-24]     at async MochaAdapter.init (/Users/I310978/Documents/03Code/wdi5/node_modules/@wdio/mocha-framework/build/index.js:55:9)
[0-24]     at async Object.adapterFactory.init (/Users/I310978/Documents/03Code/wdi5/node_modules/@wdio/mocha-framework/build/index.js:319:22)
[0-24]     at async Runner.run (/Users/I310978/Documents/03Code/wdi5/node_modules/@wdio/runner/build/index.js:83:27)

Runtime Env (please complete the following information):

vobu commented 1 year ago

the examples in the repo are part of the overall wdi5 monorepo setup. you'll need at least npm 8 and do a npm i on root level. Please see the contributing doc https://ui5-community.github.io/wdi5/#/contributing for more detailed instructions.