跳到主要内容

创建工作进程

此流程图解释了工作进程是如何被创建的。

@wdio/cli:launcher startInstance()Call @wdio/local-runner:index.js run()return @wdio/local-runner:worker instanceAdd message, error, exit eventlisteners to worker instance.Call @wdio/local-runner:worker postMessage().If an instance is not created, call startProcess()and fork a child process.@wdio/local-runner:worker startProcess() forks achild process using the child_process fork() method.The args passed to child_process fork execute the code in the@wdio/local-runner run.js.This action creates a new instanceof @wdio/runner index.js.Add message, error and exit listeners to the forked process.These listeners will process commands.@wdio/local-runner postMessage() instructs the child process torun the code @wdio/runner index.js.@wdio/local-runner postMessage() sends child process a message thatcontains the capability id,'run' command, config file, CLI args,capabilties, config details about automation backend, number of retries.When the child process receives this message, all services, reports andservices are setup. The tests are them executed.Control passed to @wdio/runner:indexAll services, reports and services are setup. The tests are them executed.See Test Execution flow chart for more information.

Welcome! How can I help?

WebdriverIO AI Copilot