@wdio/config

  • Version 7.10.1
  • Published
  • 37.9 kB
  • 4 dependencies
  • MIT license

Install

npm i @wdio/config
yarn add @wdio/config
pnpm add @wdio/config

Overview

A helper utility to parse and validate WebdriverIO options

Index

Functions

function DEFAULT_CONFIGS

DEFAULT_CONFIGS: () => Omit<Options.Testrunner, 'capabilities'>;

    function isCloudCapability

    isCloudCapability: (caps: any) => boolean;

      function validateConfig

      validateConfig: <T>(defaults: any, options: T, keysToKeep?: (keyof T)[]) => T;
      • validates configurations based on default values

        Parameter defaults

        object describing all allowed properties

        Parameter options

        option to check against {Object} validated config enriched with default values

      Classes

      class ConfigParser

      class ConfigParser {}

        constructor

        constructor(
        pathService?: PathService,
        moduleRequireService?: ModuleRequireService
        );

          method addConfigFile

          addConfigFile: (filename: string) => void;
          • merges config file with default values

            Parameter filename

            path of file relative to current directory

          method addService

          addService: (service: any) => void;
          • Add hooks from an existing service to the runner config.

            Parameter service

            an object that contains hook methods.

          method autoCompile

          autoCompile: () => void;

            method filterSpecs

            filterSpecs: (specs: Spec[], exclude: string[]) => Spec[];
            • returns specs files with the excludes filtered

              Parameter spec

              files - list of spec files

              Parameter exclude

              files - list of exclude files {String[] | String[][]} list of spec files with excludes removed

            method getCapabilities

            getCapabilities: (
            i?: number
            ) =>
            | Capabilities.DesiredCapabilities
            | Capabilities.W3CCapabilities
            | Capabilities.RemoteCapabilities;
            • return capabilities

            method getConfig

            getConfig: () => any;
            • return configs

            method getFilePaths

            static getFilePaths: (
            patterns: Spec[],
            omitWarnings?: boolean,
            findAndGlob?: CurrentPathFinder & Globber & DeterminesAbsolutePath,
            hierarchyDepth?: number
            ) => Spec[];
            • returns a flattened list of globbed files

              Parameter filenames

              list of files to glob

              Parameter flag

              to indicate omission of warnings

              Parameter file

              system path service for expanding globbed file names

              Parameter hierarchy

              depth to prevent recursive calling beyond a depth of 1 {String[] | String[][]} list of files

            method getSpecs

            getSpecs: (capSpecs?: string[], capExclude?: string[]) => Spec[];
            • get excluded files from config pattern

            method merge

            merge: (object?: MergeConfig) => void;
            • merge external object with config object

              Parameter object

              desired object to merge into the config object

            method setFilePathToFilterOptions

            setFilePathToFilterOptions: (
            cliArgFileList: string[],
            config: Spec[]
            ) => string[];
            • sets config attribute with file paths from filtering options from cli argument

              Parameter cliArgFileList

              list of files in a string form

              Parameter config

              config object that stores the spec and exclude attributes cli argument {String[]} List of files that should be included or excluded

            Interfaces

            interface ModuleRequireService

            interface ModuleRequireService {}

              method require

              require: <T>(module: string) => T;

                method resolve

                resolve: (request: string, options?: { paths?: string[] }) => string;

                  Package Files (4)

                  Dependencies (4)

                  Dev Dependencies (2)

                  Peer Dependencies (0)

                  No peer dependencies.

                  Badge

                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@wdio/config.

                  • Markdown
                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@wdio/config)
                  • HTML
                    <a href="https://www.jsdocs.io/package/@wdio/config"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>