Licence
MIT
Version
0.0.32
Deps
3
Size
342 kB
Vulns
0
Weekly
0
DeprecatedThis package is deprecated
Experimental
Do not use until verion 1.x.x released
About
Helpers for protractor and augmentations for protractor ElementFinder. Work in progress so not yet documented well.
Installation and requirements
Requires Node.js >= v6 Requires TypeScript >= v3 Requires TypeScript >= v5 (tested only with v5.4.2)
$ npm i -S protractor-extra
Examples
Classic protractor
import { element, by, ExpectedConditions, browser } from "protractor";
const userBtn = element( by.css('#user-btn') );
async function doSomething() {
let timeoutMs = config.clickbaleTimeout;
let failMessage = `Element "${userBtn.locator()}" not clickable in ${timeoutMs/1000}s.`;
await browser.wait(ExpectedConditions.elementToBeClickable(userBtn), timeoutMs, failMessage);
await userBtn.click();
}
With protractor-extra
const { elementByCss } = require("protractor-extra"); // to guarantee sync import
import { element, by } from "protractor";
// `default` or any other milliseconds number value may be used
const userBtn = elementByCss( '#user-btn', {waitClickableBeforeClick: 'default'} );
async function doSomething() {
await userBtn.click();
}
Documentation
TODO when v 1.0.0 released