Git Product home page Git Product logo

octo's Introduction

Octo

A standalone wrapper for Selenium webdriver that provides extra utility actions for the driver.

Installing

npm install octo-driver --save-dev

Features

  • Retry handling at the command level.
  • Types with Typescript.
  • Signaling across browsers.
  • Async/Await.

Pre-requisites

It's important to know that Octo ONLY wraps the WebDriver instance portion of selenium-webdriver. This makes it so you can easily plug into any existing test runner or builder of your choosing.

import Octo from 'octo-driver';

function build(): WebDriver {
  const build = new selenium.Builder();
  return build.forBrowser('chrome').build();
}

const driver = new Octo(build());

Example

Extending a Page Object.

import { WebDriver } from 'selenium-webdriver';
import Octo from 'octo-driver';
import env from '../env';

export class BasePage extends Octo {
  public baseURL = env.urls.homepage;
  public sitemap = {
    home: '/',
  };
  public DOM = {
    wrapper: 'body'
  };
  constructor(private driver: WebDriver) {
    super(driver);
  }

  public async load(page: string = this.sitemap.home): Promise<void> {
    await super.go(`${this.baseURL}${page}`);
    await super.waitForDisplayed(this.DOM.wrapper);
    return;
  }

}

Why Octo?

This project was heavily inspired from a blog post written by Uber called Rescued by Octopus. In this post they demonstrated the complex user scenarios and inner device communication that their test have to complete in order the confirm end-to-end app functionality. The name was taken from the project at Uber and made to solve similar issues using NodeJS while also adding extra utility.

octo's People

Contributors

donpage avatar

Stargazers

 avatar  avatar

Watchers

 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.