Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
rx-page-objects
Advanced tools
Provides high-level access to components in the Encore-UI library through Protractor.
You can use it directly in your test code, without using any abstractions at all.
it('should have the "Delete" menu option present', () => {
let menu = new encore.rxActionMenu($('rx-action-menu#custom'));
expect(menu.hasAction('Delete')).to.eventually.be.true;
});
Most components in rx-page-objects extend the ElementFinder class from the Protractor API. This means that
the methods and properties of ElementFinder are typically present on any rxClassName
object.
it('should have a custom icon on the "Delete" menu option', () => {
let menu = new encore.rxActionMenu($('rx-action-menu#custom'));
expect(menu.action('Delete').$('.icon-custom').isPresent()).to.eventually.be.true;
});
Please note that in the above example rxAction
inherits the $
method from Protractor's ElementFinder
.
The latest documentation on the Protractor API is available here: Protractor API
Assemble many of the reusable components from rx-page-objects into an easy to maintain page object.
Great for when you already use page objects, and want to benefit from using prefabricated components.
let myHomePage = {
get notifications() { return encore.rxNotify.all; },
get pagination() { return new encore.rxPaginate($('#myTable rx-paginate')); },
};
it('should have three notifications present', () => {
expect(myHomePage.notifications.count()).to.eventually.eql(3);
});
Describe your component at a high level, and let rx-page-objects run a set of simple tests for you.
describe('Default Pagination Tests', encore.exercise.rxPaginate({
instance: myHomePage.pagination,
totalItems: 157,
defaultPageSize: 20,
pageSizes: [5, 10, 20, 25, 50]
}));
From just those few lines of code, the following is tested.
✓ should be displayed
✓ should not have `next` link on the last page
✓ should allow attempting to navigate to the next page when already on the last page
✓ should allow attempting to navigate to the last page when already on the last page
✓ should navigate to the first page
✓ should not have `prev` link on the first page
✓ should allow attempting to navigate to the previous page when already on the first page
✓ should allow attempting to navigate to the first page when already on the first page
✓ should have all available page sizes
✓ should highlight the current items per page selection
✓ should navigate forward one page at a time
✓ should navigate backwards one page at a time
✓ should navigate to the last page
✓ should jump forward to page 6 using pagination
✓ should jump backward to page 2 using pagination
✓ should switch to a different items per page
✓ should put the user back on the first page after resizing the items per page
✓ should list have the correct string for the shown items
✓ should not fail to match the upper bounds of the shown items even if not displayed
Exercises are designed to test the basics quickly. It contains no app-specific business logic.
It will always put your app in the same state it found it in when it started.
command line
npm install --save-dev rx-page-objects
protractor.conf.js
onPrepare: () => {
encore = require('rx-page-objects');
},
.jshintrc
"globals": {
encore: true
}
FAQs
Midway test page objects for all of the Encore UI components
The npm package rx-page-objects receives a total of 6 weekly downloads. As such, rx-page-objects popularity was classified as not popular.
We found that rx-page-objects 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.