webdriverio: devtools service| ERROR @wdio/sync: TypeError: Cannot delete property 'puppeteer' of #

Environment:

  • Package.json dependencies:
   "@babel/cli": "7.12.13",
   "@babel/core": "7.12.13",
   "@babel/plugin-proposal-export-default-from": "7.12.13",
   "@babel/preset-env": "7.12.13",
   "@babel/register": "7.12.13",
   "@wdio/applitools-service": "7.0.1",
   "@wdio/cli": "7.0.1",
   "@wdio/cucumber-framework": "7.0.1",
   "@wdio/devtools-service": "7.0.1",
   "@wdio/junit-reporter": "7.0.1",
   "@wdio/local-runner": "7.0.1",
   "@wdio/selenium-standalone-service": "7.0.1",
   "@wdio/spec-reporter": "7.0.1",
   "@wdio/sync": "7.0.1",
   "commander": "^7.0.0",
   "expect": "^26.6.2",
   "expect-webdriverio": "^1.4.1",
   "fs-extra": "^9.1.0",
   "wdio-reportportal-reporter": "6.1.3",
   "wdio-reportportal-service": "6.1.1",
   "wdio-slack-service": "2.0.8"
  • Mode: [WDIO Launcher ]
  • **running sync
  • Node.js version:v12.18.2
  • NPM version:6.14.5
  • Browser name and version: chrome.88_0_4324_146
  • Platform name and version: Windoes 10

Config of WebdriverIO

{

    debug: process.env.DEBUG === "1",
    execArgv: process.env.DEBUG === "1" ? ["--inspect=127.0.0.1:5859"] : [],

    runner: 'local',

    specs: [
        './features/**/*.feature'
    ],
    exclude: [
        // 'path/to/excluded/files'
    ],

    logLevel: 'info',

    outputDir: LOGS_FILE_PATH,
    bail: 0,
    baseUrl: 'https://the-internet.herokuapp.com/',
  
    waitforTimeout: 10000,

    connectionRetryTimeout: 120000,
    connectionRetryCount: 3,
    services: process.env.RP_UUID ? [[RpService, {}],['selenium-standalone',seleniumServerConfig],'devtools']:[['selenium-standalone',seleniumServerConfig],'devtools'],
   
    framework: 'cucumber',
    specFileRetries: 0,
    specFileRetriesDelay: 0,
    specFileRetriesDeferred: false,
    reporters: process.env.RP_UUID ? ['spec',[reportportal, reportportalConf],['junit', junitReporterConfig]]:['spec',['junit', junitReporterConfig]],
    checkLeaks:true,
}
{
    //
    // If you are using Cucumber you need to specify the location of your step definitions.
    cucumberOpts: {
        // <string[]> (file/dir) require files before executing features
        require: ['./stepDefinitions/**/*.js','./projectHooks/**/*.js'],
        // <boolean> show full backtrace for errors
        backtrace: false,
        // <string[]> ("extension:module") require files with the given EXTENSION after requiring MODULE (repeatable)
        requireModule: ['@babel/register'],
        // <boolean> invoke formatters without executing steps
        dryRun: false,
        // <boolean> abort the run on first failure
        failFast: false,
        // <string[]> (type[:path]) specify the output format, optionally supply PATH to redirect formatter output (repeatable)
        format: ['pretty'],
        // <boolean> hide step definition snippets for pending steps
        snippets: false,
        // <boolean> hide source uris
        source: true,
        // <string[]> (name) specify the profile to use
        profile: [],
        // <boolean> fail if there are any undefined or pending steps
        strict: false,
        // <string> (expression) only execute the features or scenarios with tags matching the expression
        tagExpression: "",
        // <number> timeout for step definitions
        timeout: 60000,
        // <boolean> Enable this config to treat undefined definitions as warnings.
        ignoreUndefinedDefinitions: false,
        //<boolean> Enable this to make webdriver.io behave as if scenarios and not steps were the tests.
        scenarioLevelReporter:false,
    },
}

Describe the bug The below Error accurse when using browser.reloadSession(); at the before scenario or after scenario hooks if disabling the reloadSession it wont happen and also when removing the devtools service

ERROR @wdio/sync: TypeError: Cannot delete property 'puppeteer' of #<Browser>
    at DevToolsService.onReload (C:\Users\iddang\Source\Repos\automatio-wdio-common\node_modules\@wdio\devtools-service\build\index.js:51:21)
    at C:\Users\iddang\Source\Repos\automatio-wdio-common\node_modules\webdriverio\build\commands\browser\reloadSession.js:49:58
    at Array.map (<anonymous>)
    at Browser.reloadSession (C:\Users\iddang\Source\Repos\automatio-wdio-common\node_modules\webdriverio\build\commands\browser\reloadSession.js:49:44)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Browser.runCommandWithHooks (C:\Users\iddang\Source\Repos\automatio-wdio-common\node_modules\@wdio\sync\build\wrapCommand.js:105:25)
    at Browser.runCommandWithHooks (C:\Users\iddang\Source\Repos\automatio-wdio-common\node_modules\@wdio\sync\build\wrapCommand.js:100:24)
    at Browser.reloadSession (C:\Users\iddang\Source\Repos\automatio-wdio-common\node_modules\@wdio\sync\build\wrapCommand.js:67:44)
    at Object.beforeScenario (C:\Users\iddang\Source\Repos\automatio-wdio-common\commonHooks\/automationHooks.js:142:25)
    at execHook (C:\Users\iddang\Source\Repos\automatio-wdio-common\node_modules\@wdio\sync\build\executeHooksWithArgs.js:36:31)
    at PickleRunner.invokeStep (C:\Users\iddang\Source\Repos\automatio-wdio-common\node_modules\@wdio\cucumber-framework\node_modules\@cucumber\cucumber\src\runtime\pickle_runner.ts:240:12)
    at PickleRunner.runHook (C:\Users\iddang\Source\Repos\automatio-wdio-common\node_modules\@wdio\cucumber-framework\node_modules\@cucumber\cucumber\src\runtime\pickle_runner.ts:362:12)
    at C:\Users\iddang\Source\Repos\automatio-wdio-common\node_modules\@wdio\cucumber-framework\node_modules\@cucumber\cucumber\src\runtime\pickle_runner.ts:325:20
    at PickleRunner.aroundTestStep (C:\Users\iddang\Source\Repos\automatio-wdio-common\node_modules\@wdio\cucumber-framework\node_modules\@cucumber\cucumber\src\runtime\pickle_runner.ts:273:28)
    at PickleRunner.run (C:\Users\iddang\Source\Repos\automatio-wdio-common\node_modules\@wdio\cucumber-framework\node_modules\@cucumber\cucumber\src\runtime\pickle_runner.ts:315:9)
    at Runtime.runPickle (C:\Users\iddang\Source\Repos\automatio-wdio-common\node_modules\@wdio\cucumber-framework\node_modules\@cucumber\cucumber\src\runtime\index.ts:118:20)

Expected behavior No error

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 6
  • Comments: 16 (12 by maintainers)

Most upvoted comments

PR with a fixed was created. Closing.

@christian-bromann just run browser.reloadSession() will throw the error, latest wdio and devtools service