Context: Currently, I am in the process of implementing the fundamental WebdriverIO example within an Angular Electron App. My application is built on the foundation of the Angular Electron Boilerplate. To set up, I have installed webdriverio and @types/webdriverio using npm. Subsequently, I crafted the following service:
import { Injectable } from '@angular/core';
import { remote, Options } from 'webdriverio';
@Injectable()
export class WebdriverioService {
remote: typeof remote;
options: Options;
constructor() {
this.options = {
desiredCapabilities: {
browserName: 'chrome'
}
}
}
test(): void {
remote(this.options) // <-- this line causes the error
.init()
.url('http://www.google.com')
.getTitle().then(function (title) {
console.log('Title was: ' + title);
})
.end()
.catch(function (err) {
console.log(err);
});
}
}
The critical line has been denoted with a comment. Initially, upon compilation, I encountered the subsequent warnings:
WARNING in ./node_modules/webdriverio/build/lib/launcher.js
138:39-55 Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/webdriverio/build/lib/utils/ConfigParser.js
144:58-75 Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/webdriverio/build/lib/helpers/getImplementedCommands.js
59:44-90 Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/webdriverio/build/lib/launcher.js
812:34-50 Critical dependency: the request of a dependency is an expression
Additionally, my Application generated the ensuing error message:
Uncaught Error: ENOENT, protocol not found in <<Path to App>>\node_modules\electron\dist\resources\electron.asar
at notFoundError (ELECTRON_ASAR.js:114)
at Object.fs.readdirSync (ELECTRON_ASAR.js:588)
at getImplementedCommands (getImplementedCommands.js:40)
at Object../node_modules/webdriverio/build/index.js (index.js:59)
at __webpack_require__ (bootstrap:76)
at Object../src/app/providers/webdriverio.service.ts (electron.service.ts:10)
at __webpack_require__ (bootstrap:76)
at Object../src/app/app.module.ts (app.component.ts:11)
at __webpack_require__ (bootstrap:76)
at Object../src/main.ts (environment.ts:4)
It appears that this issue might be primarily associated with configuration errors in typescript, yet I am unsure. Any guidance on where to direct my attention would be greatly appreciated. Could someone please point out what may have slipped my mind?