Back to Webdriverio

Test Execution

website/docs/flowcharts/TestExecution.md

9.31.02.0 KB
Original Source

This flowchart explains the test execution process and the interaction between @wdio/runner and the most of the other WebdriverIO packages.

mermaid
graph TD
    START("@wdio/runner:index called from
child process via a run message.")-->
    EXECUTERUN["@wdio/runner:index run()"]-->
    SETUPREPORTER["Initialise BaseReporter object which creates a new
@wdio/runner reporter instance.All reporters listed
in the wdio.conf.js reporters property are initialized."]-->
    INITTESTFRAMEWORK["Test framework from the wdio.conf. js property is
initialized usingthe @wdio/utils initializePlugin method.
 
Supported frameworks include @wdio/mocha-framework,
@wdio/cucumber-framework and @wdio/jasmine-framework."]-->
    INITSERVICES["Initialise services"]-->
    RUNEFORESESSIONHOOK[Run wdio.conf.js beforeSession hook.]-->
    INITSESSION["Call @wdio/runner:index _initSession.
@wdio/runner:utils initializeInstance
calls webdriverio:index.js remote()."]-->
    ISPROTOCOLWEBDRIVER{"Is protocol
webdriver?"}
    ISPROTOCOLWEBDRIVER-->|Yes|WEBDRIVER
    ISPROTOCOLWEBDRIVER-->|No|DEVTOOLS
    WEBDRIVER["Call webdriver:index newSession
1. Start Webdriver session.
2. Get protocol commands.
3. Create webdriver monad with
protocol arguments.
4. Return monad session
instance to caller."]-->RUNNERRUN
    DEVTOOLS["Create puppeteer instance.
Return session instance to caller."]-->RUNNERRUN
    RUNNERRUN["Store instance in
global browser variable."]-->
    SETWATCHMODEFLAG["Set watch mode flag"]-->
    INITCOMPLETE[Initialisation successful, send runner:start message to reporter.]-->
    KICKOFFTESTS["Kick off tests in framework by calling the framework's run
method, e.g. @wdio/mocha-framework:index run()."]-->
    WAITFORTESTTOFINISH[Wait for test to finish. If watch mode keep session open.]-->
    SENDRESULTS[Send results to reporter instance
for processing.]-->
    INTERFACE["@wdio/cli:interface printSummary() called
Test results printed to terminal"]-->
    KILLWORKERSESSION[Kill worker session.]