Code Monkey home page Code Monkey logo

wdio-static-server-service's Introduction

No longer actively maintained!

Leadpages migrated to using Chrome Headless with Puppeteer for our end-to-end testing, and as a result, we no longer actively maintain this repository. If you would like to fork and maintain this, send us an email and we can direct folks your way. Otherwise - pull requsts are welcome as well.

WDIO Static Server Service

npm npm npm

Some projects are front-end assets only and don't run on more than a static server. This service helps you to run a static file server during testing.

Installation

The easiest way is to keep wdio-static-server-service as a devDependency in your package.json.

{
  "devDependencies": {
    "wdio-static-server-service": "^1.0.0"
  }
}

You can simple do it by:

npm install wdio-static-server-service --save-dev

Instructions on how to install WebdriverIO can be found here.

Configuration

In order to use the static server service you need to add static-server to your service array:

// wdio.conf.js
export.config = {
  // ...
  services: ['static-server'],
  // ...
};

Options

staticServerFolders (required)

Array of folder paths and mount points.

Type: Array<Object> Props:

  • mount {String} - URL endpoint where folder will be mounted.
  • path {String} - Path to the folder to mount.
 // wdio.conf.js
 export.config = {
   // ...
   staticServerFolders: [
     { mount: '/fixtures', path: './tests/fixtures' },
     { mount: '/dist', path: './dist' },
   ],
   // ...
 };

staticServerPort

Port to bind the server.

Type: Number

Default: 4567

staticServerLog

Debugging logs, will print mount points and requests. When staticServerLogs is set to true it will print into the console. Otherwise a string will be treated as the log folder.

Type: Boolean or String

staticServerMiddleware

Array of middleware objects. Load and instatiate these in the config and pass them in for the static server to use.

Type: Array<Object> Props:

  • mount {String} - URL endpoint where middleware will be mounted.
  • middleware <Object> - Middleware function callback

Default: []

 // wdio.conf.js
 export.config = {
   const middleware = require('middleware-package');
   // ...
   staticServerMiddleware: [{
     mount: '/',
     middleware: middleware(/* middleware options */),
   }],
   // ...
 };

For more information on WebdriverIO see the homepage.

wdio-static-server-service's People

Contributors

nrdobie avatar silvenon avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.