A standalone wrapper for Selenium webdriver that provides extra utility actions for the driver.
npm install octo-driver --save-dev
- Retry handling at the command level.
- Types with Typescript.
- Signaling across browsers.
- Async/Await.
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.
importOctofrom'octo-driver';functionbuild(): WebDriver{constbuild=newselenium.Builder();returnbuild.forBrowser('chrome').build();}constdriver=newOcto(build());Extending a Page Object.
import{WebDriver}from'selenium-webdriver';importOctofrom'octo-driver';importenvfrom'../env';exportclassBasePageextendsOcto{publicbaseURL=env.urls.homepage;publicsitemap={home: '/',};publicDOM={wrapper: 'body'};constructor(privatedriver: WebDriver){super(driver);}publicasyncload(page: string=this.sitemap.home): Promise<void>{awaitsuper.go(`${this.baseURL}${page}`);awaitsuper.waitForDisplayed(this.DOM.wrapper);return;}}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.
