Gathering detailed insights and metrics for protractor-helpers
Gathering detailed insights and metrics for protractor-helpers
Gathering detailed insights and metrics for protractor-helpers
Gathering detailed insights and metrics for protractor-helpers
@types/protractor-helpers
TypeScript definitions for protractor-helpers
@ryancavanaugh/protractor-helpers
Type definitions for protractor-helpers v1.0.0 from https://www.github.com/DefinitelyTyped/DefinitelyTyped
protractor-wait-helpers
Helper functions for wait()ing with expected conditions using Protractor
@loymax-solutions/protractor-helpers
Additional matchers / locators and helpers for system tests using protractor and Jasmine
Set of matchers, locators, and helper functions for Protractor
npm install protractor-helpers
Typescript
Module System
Node Version
NPM Version
JavaScript (88.17%)
HTML (11.83%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
46 Stars
135 Commits
14 Forks
326 Watchers
9 Branches
20 Contributors
Updated on Mar 21, 2023
Latest Version
1.1.813
Package Id
protractor-helpers@1.1.813
Unpacked Size
39.99 kB
Size
10.59 kB
File Count
12
NPM Version
6.14.11
Node Version
8.17.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
This library extends Protractor API with a commonly used API. It helps write more understandable and clean tests with a well-defined separation between the test logic and the app under the test logic. It consists of four extension types: elements, helpers, locators, and matchers.
$ npm install --save-dev protractor-helpers
from your console.1var helpers = require('protractor-helpers');
The Elements API extends ElementArrayFinder
with:
example (choosing a date from a calendar):
1$$('.calendar').getByText('27').click();
not
- Returns the negative value of a Promise.1helpers.not($('.some-element').isDisplayed());
translate
- Returns the translated key with translation values.1expect($('.some-element').getText()).toEqual(helpers.translate('SOME_TRANSLATION_KEY'));
safeGet
- Navigates to a URL, maximizing the window and resetting the mouse position.1helpers.safeGet('./SomeUrl');
maximizeWindow
- Maximizes the window to a given size or a default size.1helpers.maximizeWindow(500, 500);
resetPosition
- Resets the mouse position.1helpers.resetPosition();
displayHover
- Displays an element that appears only on hover state.1helpers.displayHover($('.some-element'));
waitForElement
- Waits for an element to be shown.1helpers.waitForElement($('.some-element'), timeout, optionalMessage);
waitForElementToDisappear
- Waits for an element not to be shown.1helpers.waitForElementToDisappear($('.some-element'), timeout, optionalMessage);
selectOptionByText
- Selects an element from a selection box.1helpers.selectOptionByText($('select'), 'options-to-select');
selectOptionByIndex
- Selects an element from a selection box.1helpers.selectOptionByIndex($('select'), 0);
selectOption
- Selects a given option.1helpers.selectOption($$('select option').first());
isFirefox
- Indicates whether Firefox is the browser.1if (helpers.isFirefox()) { 2 // Do FF stuff here . . . 3}
createMessage
- Creates a matchers message with {{locator}}
, {{not}}
, and {{actual}}
as placeholders.1helpers.createMessage(this, 'Expected {{locator}}{{not}}to have image') + '.');
isIE
- Indicates whether Internet Explorer is the browser.1if (helpers.isIE()) { 2 // Do IE stuff here . . . 3}
clearAndSetValue
- Allows setting a new value to an input field (rather than appending text).1helpers.clearAndSetValue(inputField, 'text to populate');
getFilteredConsoleErrors
- Returns console error messages resulting from the test run.livereload
error (since it is not loaded in CI mode), messages with warn
and below severity, and a known Firefox bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1127577).1expect(helpers.getFilteredConsoleErrors().length).toBe(0);
hasClass
- Checks whether an element has a class.1helpers.hasClass(element, 'class-name');
Adds two locators: by.dataHook
and by.dataHookAll
.
Searches for element(s) with the data-hook
attribute. For example:
1<ul> 2 <li data-hook="first">First</li> 3 <li data-hook="second">Second</li> 4</ul>
1element(by.dataHook('first')).click() - click on the first data hook
The Matchers API extends the available matchers:
toBePresent
- Checks whether an element is present (exists in the DOM).1expect($('.some-element')).toBePresent();
toBeDisplayed
- Checks whether an element is displayed (visible in the DOM).1expect($('.some-element')).toBeDisplayed();
toHaveCountOf
- Checks whether the length passes to the function against the value it's invoked with.1expect($('.some-elements').count()).toHaveCountOf(expectedCount);
toHaveText
- Checks whether an element contains text.1expect($('.some-element')).toHaveText(expectedText);
toMatchRegex
- Checks whether an element's text fits a regex.1expect($('.some-element')).toMatchRegex(expectedPattern);
toMatchMoney
- Checks whether an element's text fits rtl money regex.1expect($('.some-element').getText()).toMatchMoney(expectedValue, currencySymbol);
toMatchMoneyWithFraction
- Checks whether an element's text fits rtl money regex with fraction.1expect($('.some-element').getText()).toMatchMoneyWithFraction(expectedValue, currencySymbol);
toHaveValue
- Checks whether an element's value
attribute fits the expectedValue
.1expect($('.some-element')).toHaveValue(expectedValue);
toHaveClass
- Checks whether an element has a specific class name.1expect($('.some-element')).toHaveClass(className);
toBeDisabled
- Checks whether an element is disabled.1expect($('.some-element')).toBeDisabled();
toBeChecked
- Checks whether an element checkbox is checked.1expect($('.some-element')).toBeChecked();
toBeValid
- Checks whether a form element is valid (using the ng-valid
class name).1expect($('.some-element')).toBeValid();
toBeInvalid
- Checks whether a form element is invalid (using the ng-invalid
class name).1expect($('.some-element')).toBeInvalid();
toBeInvalidRequired
- Checks whether a form element is invalid and required (using the ng-invalid-required
class name).1expect($('.some-element')).toBeInvalidRequired();
toMatchTranslated
- Checks whether an element contains a translation value.1expect($('.some-element')).toMatchTranslated(key, values);
The MIT License.
See LICENSE
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 2/27 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More