an environment for using Browserstack with Jest
npm install @jest-environment-browserstack/pluginsProvides the abstract classes needed for implementing a plugin.
A plugin is a wrapper on top of the W3C WebDriver API used in jest-environment-browserstack for interacting with Browserstack.
``bash`
npm install --save @jest-environment-browserstack/plugins
In your plugin:
`typescript
import { WebDriver, Builder } from 'my-selenium-webdriver';
import { BrowserCapability, PluginDriver, Driver, LogTypes } from '@jest-environment-browserstack/plugins';
export class SeleniumWebDriver extends Driver
async build(capabilities?: BrowserCapability): Promise
// init your module
}
async quit(): Promise
// your module teardown
}
}
export class PluginSeleniumWebDriver extends PluginDriver
async createWdDriver(capabilities?: BrowserCapability, hubUrl?: string): Promise
// create your driver instance and return it for the test
}
}
`
Inside the core, we use the Reflect API to determine which object contains the createWdDriver` method.
Feel free to report an issue in case you found a bug or something which could be improved. PR are more than welcome !