
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
protractor-pageobject
Advanced tools
Page object pattern implementation for protractor and webdriverjs.
Protractor Page Object pattern for Protractor.
# not published to npm yet...
npm install --save-dev protractor-pageobject
check the examples folder.
For more examples, you can also check the pages and components created for integration tests.
This is the Page
and Component
parent class.
A map of element selectors, which defines the elements you want to interact with. Used to retrieve elements or components without having to specify a selector. Check base.element(elName), base.elements(elName) and base.component(elName).
els: {
'searchBox': by.name('q')
}
A map of component classes. Each key should have a corresponding key in els
map.
comps: {
searchBox: require('./path/to/component-subclass'), // short version
anotherComponent: {
model: require('./path/to/another-component-subclass'),
opts: {opt1: 'val1'}
}
}
Returns a protractor element
. elName
should be key in the els
map.
Returns a protractor elements
(array). elName
should be a key in the els
map.
Returns a protractor-pageobject
Component instance.
elNameshould be a key in the
els` map.
Returns a promise which resolves to a boolean value.
Sets the value of a field. It will use the following rules (in the specified order):
If elName
is a key in comps
and this component has a method setValue
, then it will call that method.
If the Page or Component instance has a setElName
. using camelCase. For example, if elName = 'my-el-1', then the method should be called
setMyEl1`
If none of the above works, then it will detect the field type and use the proper selenium command to set the value (sendKeys()
, click()
on dropdown or checkboxes...). Here is the list of supported fields for now:
Sets multiple fields at the same time, using setFieldValue(elName, value)
. Each key should be present in els
map.
myComponent.setFields({
elName1: 'value1',
elName2: 'value2',
...
});
Page
inherits from Base so all Base
methods and properties are inherited. Here is the list of additional methods.
A property or a method that is used to navigate using the get()
method below.
Navigate to the url
property.
returns a promise that will resolve with the current page title (usually the <title>
tag in <head>
). Alias of browser.getTitle()
.
returns a promise that will resolve with the current page title. Alias of `browser.getCurrentUrl()
Like Page
, Component
inherits from Base so all Base
methods and properties are inherited.
When creating a new instance of a component, you need to at least provide one property called el
which should be a protractor ElementFinder
.
TODO
MIT.
FAQs
Page object pattern implementation for protractor and webdriverjs.
The npm package protractor-pageobject receives a total of 2 weekly downloads. As such, protractor-pageobject popularity was classified as not popular.
We found that protractor-pageobject demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.