Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support WebdriverIO v8 #398

Open
NBS-LLC opened this issue Apr 30, 2023 · 3 comments
Open

Support WebdriverIO v8 #398

NBS-LLC opened this issue Apr 30, 2023 · 3 comments

Comments

@NBS-LLC
Copy link

NBS-LLC commented Apr 30, 2023

After upgrading from WDIO v7 (7.30.2) to v8 (8.8.8) I'm getting "Launcher is not a constructor" when using this schematic.

I have the schematic configured to use a tsconfig specific to running WDIO:

{
    "compilerOptions": {
        "resolveJsonModule": true,
        "target": "ES5",
        "types": [
            "node",
            "@wdio/globals/types",
            "@wdio/mocha-framework"
        ]
    }
}

My Angular v15 (15.2.6) project is using:

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "ES2022",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "ES2022",
    "lib": [
      "ES2022",
      "dom"
    ],
    "resolveJsonModule": true,
    "useDefineForClassFields": false
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true
  }
}

I tried to debug this using ts-node REPL from the root of the project and discovered a few things (which could indicate that I've misconfigured something, though I could still use your wisdom):

> const Launcher = require('@wdio/cli').default
undefined
> console.log(Launcher)
undefined
undefined
> const Launcher = require('@wdio/cli')
undefined
> console.log(Launcher)
{ Launcher: [class Launcher], run: [AsyncFunction: run] }
undefined
> import Launcher from '@wdio/cli'
<repl>.ts:4:8 - error TS2613: Module '"<project path>/node_modules/@wdio/cli/build/index"' has no default export. Did you mean to use 'import { Launcher } from "<project path>/node_modules/@wdio/cli/build/index"' instead?

Is it possible that @wdio/cli no longer has a default export? Which would cause an error in the following code:

const Launcher = require(path.join(process.cwd(), 'node_modules', '@wdio', 'cli')).default

const launcher: LauncherType = new Launcher(

NBS-LLC added a commit to NBS-LLC/webdriverio-schematics that referenced this issue Apr 30, 2023
* The wdio/cli package no longer has a default export, so using the named export.
@christian-bromann christian-bromann changed the title Launcher is not a constructor Support WebdriverIO v8 May 1, 2023
@christian-bromann
Copy link
Member

Thanks for reporting!

@NBS-LLC the schematic doesn't seem to support v8 of WebdriverIO yet.

Any contributions that resolves the bug are highly appreciated. Don't expect this to be picked up by active contributors as they have their own priorities. If you depend on this bug to be fixed, your contribution is required. Please take a look into our contribution guidelines or join our Discord development server and let us know if you have any questions. Cheers!

@finventario
Copy link

finventario commented Jan 25, 2024

Would it be possible to integrate the fix by @NBS-LLC @christian-bromann ?
NBS-LLC@5f501f3

@christian-bromann
Copy link
Member

@finventario any contributions are appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants