New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rx-page-objects

Package Overview
Dependencies
Maintainers
1
Versions
182
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rx-page-objects - npm Package Compare versions

Comparing version 1.49.0 to 1.50.0-0

32

index.js

@@ -6,25 +6,23 @@ 'use strict';

var srcPath = require('path').join(__dirname, 'src');
var pageObjects = {};
var exercises = {};
/**
* We're going to be iterating over every file in `src` for page object functionality.
* This will take each `require`'d file and iterate over all it's exported members, and
* add them to the `destination` (either the page objects, or the exercises).
*/
var addModule = (destination, moduleLocation) => {
var module = require(moduleLocation);
_.each(module, (functionality, exportedName) => destination[exportedName] = functionality);
return destination;
var pageObjects = {
exercise: {}
};
require('fs').readdirSync(srcPath).forEach(file => {
var destination = pageObjects;
if (/.*exercise\.js$/.test(file)) {
destination = exercises;
// ignore unless JS
if (!/\.js$/.test(file)) {
return;
}
addModule(destination, `./src/${file}`);
var module = require(`./src/${file}`);
_.each(module, (functionality, exportedName) => {
if (/.*exercise\.js$/.test(file)) {
pageObjects.exercise[exportedName] = functionality;
} else {
pageObjects[exportedName] = functionality;
}
});
});
pageObjects.exercise = exercises;
module.exports = pageObjects;

@@ -5,3 +5,3 @@ {

"description": "Midway test page objects for all of the Encore UI components",
"version": "1.49.0",
"version": "1.50.0-0",
"main": "index.js",

@@ -8,0 +8,0 @@ "license": "Apache License, Version 2.0",

@@ -94,3 +94,3 @@ var _ = require('lodash');

* @description Whether or not the action cog is showing its underlying menu.
* @returns {Boolean}
* @returns {Promise<Boolean>}
*/

@@ -108,4 +108,7 @@ isExpanded: {

* @instance
* @deprecated
* @description Whether or not the action cog is hiding its underlying menu.
* @returns {Boolean}
*
* **DEPRECATED** Check inverse of `isExpanded()` instead
* @returns {Promise<Boolean>}
*/

@@ -128,4 +131,4 @@ isCollapsed: {

var page = this;
return this.isCollapsed().then(function (collapsed) {
if (collapsed) {
return this.isExpanded().then(function (expanded) {
if (!expanded) {
page.icoCog.click();

@@ -159,3 +162,3 @@ }

* @param {String} actionName - The name of the action menu item to check for existence.
* @returns {Boolean}
* @returns {Promise<Boolean>}
*/

@@ -194,3 +197,3 @@ hasAction: {

* @instance
* @returns {Number}
* @returns {Promise<Number>}
*/

@@ -197,0 +200,0 @@ actionCount: {

@@ -40,4 +40,4 @@ var Page = require('astrolabe').Page;

var page = this;
return this.isCollapsed().then(function (collapsed) {
if (collapsed) {
return this.isExpanded().then(function (expanded) {
if (!expanded) {
page.btnCollapseToggle.click();

@@ -68,19 +68,13 @@ }

* @function
* @returns {Boolean}
* @deprecated
* @description Whether or not the navigation section is collapsed. If the navigation section is
* not collapsible, it will throw an {@link rxApp#NotCollapsibleException}.
*
* **DEPRECATED** Check inverse of `isExpanded()` instead.
* @returns {Promise<Boolean>}
*/
isCollapsed: {
value: function () {
var page = this;
return this.isCollapsible().then(function (isCollapsible) {
if (!isCollapsible) {
return page.title.then(function (siteTitle) {
page.NotCollapsibleException.thro(siteTitle);
});
}
return page.rootElement.$('.rx-app').getAttribute('class').then(function (classNames) {
return (classNames.indexOf('collapsed') >= 0);
});
return this.isExpanded().then(function (expanded) {
return !expanded;
});

@@ -93,10 +87,19 @@ }

* @function
* @returns {Boolean}
* @description Whether or not the navigation section is expanded. If the navigation section is
* not expandable, it will throw an {@link rxApp#NotCollapsibleException}.
* @returns {Promise<Boolean>}
*/
isExpanded: {
value: function () {
return this.isCollapsed().then(function (result) {
return !result;
var page = this;
return this.isCollapsible().then(function (isCollapsible) {
if (!isCollapsible) {
return page.title.then(function (siteTitle) {
page.NotCollapsibleException.thro(siteTitle);
});
}
return page.rootElement.$('.rx-app').getAttribute('class').then(function (classNames) {
return !(classNames.indexOf('collapsed') >= 0);
});
});

@@ -103,0 +106,0 @@ }

@@ -56,3 +56,3 @@ var _ = require('lodash');

it('should ' + (options.disabled ? 'be' : 'not be') + ' disabled', function () {
expect(component.isDisabled()).to.eventually.eq(options.disabled);
expect(component.isEnabled()).to.eventually.eq(!options.disabled);
});

@@ -59,0 +59,0 @@

@@ -53,7 +53,24 @@ var _ = require('lodash');

* @function
* @deprecated
* @description Whether or not the checkbox is disabled.
* @returns {Boolean}
*
* **DEPRECATED** Check for inverse of `isEnabled()` instead.
* @returns {Promise<Boolean>}
*/
isDisabled: {
value: function () {
return this.isEnabled().then(function (enabled) {
return !enabled;
});
}
},
/**
* @instance
* @function
* @description Whether or not the checkbox is enabled.
* @returns {Promise<Boolean>}
*/
isEnabled: {
value: function () {
var page = this;

@@ -63,8 +80,6 @@ return this.eleFakeCheckbox.isPresent().then(function (isFakeCheckbox) {

return page.eleWrapper.getAttribute('class').then(function (classes) {
return _.contains(classes.split(' '), 'rx-disabled');
return !_.contains(classes.split(' '), 'rx-disabled');
});
}
return page.rootElement.getAttribute('disabled').then(function (disabled) {
return (disabled ? true : false);
});
return page.rootElement.isEnabled();
});

@@ -71,0 +86,0 @@ }

@@ -53,3 +53,2 @@ var _ = require('lodash');

component.expand();
expect(component.isCollapsed()).to.eventually.be.false;
expect(component.isExpanded()).to.eventually.be.true;

@@ -60,3 +59,2 @@ });

component.expand();
expect(component.isCollapsed()).to.eventually.be.false;
expect(component.isExpanded()).to.eventually.be.true;

@@ -67,3 +65,2 @@ });

component.collapse();
expect(component.isCollapsed()).to.eventually.be.true;
expect(component.isExpanded()).to.eventually.be.false;

@@ -74,3 +71,2 @@ });

component.collapse();
expect(component.isCollapsed()).to.eventually.be.true;
expect(component.isExpanded()).to.eventually.be.false;

@@ -81,3 +77,2 @@ });

component.toggle();
expect(component.isCollapsed()).to.eventually.be.false;
expect(component.isExpanded()).to.eventually.be.true;

@@ -84,0 +79,0 @@ });

@@ -25,3 +25,3 @@ var _ = require('lodash');

* @description Whether or not the component is currently expanded.
* @returns {Boolean}
* @returns {Promise<Boolean>}
*/

@@ -37,4 +37,7 @@ isExpanded: {

* @function
* @deprecated
* @description Whether or not the component is currently collapsed.
* @returns {Boolean}
*
* **DEPRECATED** Check inverse of `isExpanded()` instead.
* @returns {Promise<Boolean>}
*/

@@ -108,4 +111,4 @@ isCollapsed: {

var page = this;
return this.isCollapsed().then(function (collapsed) {
if (collapsed) {
return this.isExpanded().then(function (expanded) {
if (!expanded) {
page.toggle();

@@ -112,0 +115,0 @@ }

@@ -123,9 +123,26 @@ var Page = require('astrolabe').Page;

* @instance
* @deprecated
* @description Whether or not the entire calendar component is disabled.
* @return {Boolean}
*
* **DEPRECATED** Check inverse of `isEnabled()` instead.
* @return {Promise<Boolean>}
*/
isDisabled: {
value: function () {
return this.isEnabled().then(function (enabled) {
return !enabled;
});
}
},
/**
* @function
* @instance
* @description Whether or not the entire calendar component is enabled.
* @return {Promise<Boolean>}
*/
isEnabled: {
value: function () {
return this.rootElement.getAttribute('disabled').then(function (disabled) {
return (disabled ? true : false);
return !disabled;
});

@@ -135,2 +152,3 @@ }

/**

@@ -167,3 +185,3 @@ * @function

* @description Whether or not the calendar is open.
* @return {Boolean}
* @return {Promise<Boolean>}
*/

@@ -182,4 +200,7 @@ isOpen: {

* @function
* @deprecated
* @description Whether or not the calendar is closed.
* @return {Boolean}
*
* **DEPRECATED** Check inverse of `isOpen()` instead.
* @return {Promise<Boolean>}
*/

@@ -207,4 +228,4 @@ isClosed: {

var self = this;
this.isClosed().then(function (closed) {
if (closed) {
this.isOpen().then(function (open) {
if (!open) {
self.rootElement.$('.control').click();

@@ -297,3 +318,4 @@ }

this.open();
rxSelect.initialize(this.rootElement.element(by.model('currentMonth'))).select(value);
var slowClick = false;
rxSelect.initialize(this.rootElement.element(by.model('currentMonth'))).select(value, slowClick);
}

@@ -318,3 +340,4 @@ },

this.open();
rxSelect.initialize(this.rootElement.element(by.model('currentYear'))).select(value);
var slowClick = false;
rxSelect.initialize(this.rootElement.element(by.model('currentYear'))).select(value, slowClick);
}

@@ -321,0 +344,0 @@ },

@@ -64,7 +64,7 @@ var _ = require('lodash');

it('should have a symbol visible', function () {
expect(component.isSymbolVisible()).to.eventually.be.true;
expect(component.isSymbolDisplayed()).to.eventually.be.true;
});
} else {
it('should not have a symbol visible', function () {
expect(component.isSymbolVisible()).to.eventually.be.false;
expect(component.isSymbolDisplayed()).to.eventually.be.false;
});

@@ -71,0 +71,0 @@ }

@@ -28,3 +28,6 @@ var Page = require('astrolabe').Page;

* @instance
* @deprecated
* @description Whether or not a required field currently displays a red asterisk next to it.
*
* **DEPRECATED** Use `isSymbolDisplayed()` instead.
* @returns {Boolean}

@@ -34,2 +37,14 @@ */

value: function () {
return this.isSymbolDisplayed();
}
},
/**
* @function
* @instance
* @description Whether or not a required field currently displays a red asterisk next to it.
* @returns {Boolean}
*/
isSymbolDisplayed: {
value: function () {
return this.eleRequiredSymbol.isDisplayed();

@@ -36,0 +51,0 @@ }

@@ -84,5 +84,3 @@ var Page = require('astrolabe').Page;

value: function () {
return this.btnSubmit.getAttribute('disabled').then(function (isDisabled) {
return isDisabled === null;
});
return this.btnSubmit.isEnabled();
}

@@ -89,0 +87,0 @@ },

@@ -91,2 +91,10 @@ var Page = require('astrolabe').Page;

page.btnDismiss.click();
// hack for chrome support -- this is for any possible
// alerts that are opened by closing this notification.
// also, before you check, EC.isAlertPresent does not work here.
return browser.getCapabilities().then(function (capabilities) {
if (capabilities.get('browserName') === 'chrome') {
browser.sleep(500);
}
});
}

@@ -93,0 +101,0 @@ });

@@ -337,9 +337,22 @@ var Page = require('astrolabe').Page;

* @function
* @deprecated
* @alias {rxOptionTable.deselectAll}
* @instance
* @description Unselects every row in the rxOptionTable.
* @description **DEPRECATED** Unselects every row in the rxOptionTable.
*/
unselectAll: {
value: function () {
return this.deselectAll();
}
},
/**
* @function
* @instance
* @description Deselects every row in the rxOptionTable.
*/
deselectAll: {
value: function () {
this.tblRows.map(function (rowElement) {
optionRowFromElement(rowElement).unselect();
optionRowFromElement(rowElement).deselect();
});

@@ -618,3 +631,3 @@ }

var optionTable = exports.rxOptionTable.initialize(elem);
optionTable.unselectAll();
optionTable.deselectAll();
optionTable.selectMany(selections);

@@ -621,0 +634,0 @@ }

@@ -54,3 +54,3 @@ var _ = require('lodash');

it('should ' + (options.disabled ? 'be' : 'not be') + ' disabled', function () {
expect(component.isDisabled()).to.eventually.eq(options.disabled);
expect(component.isEnabled()).to.eventually.eq(!options.disabled);
});

@@ -57,0 +57,0 @@

@@ -79,7 +79,24 @@ var _ = require('lodash');

* @instance
* @deprecated
* @description Whether or not the radio element is disabled.
* @return {Boolean}
*
* **DEPRECATED** Check for inverse of `isEnabled()` instead.
* @return {Promise<Boolean>}
*/
isDisabled: {
value: function () {
return this.isEnabled().then(function (enabled) {
return !enabled;
});
}
},
/**
* @function
* @instance
* @description Whether or not the radio element is enabled.
* @return {Promise<Boolean>}
*/
isEnabled: {
value: function () {
var page = this;

@@ -89,8 +106,6 @@ return this.eleFakeRadio.isPresent().then(function (isFakeRadio) {

return page.eleWrapper.getAttribute('class').then(function (classes) {
return _.contains(classes.split(' '), 'rx-disabled');
return !_.contains(classes.split(' '), 'rx-disabled');
});
}
return page.rootElement.getAttribute('disabled').then(function (disabled) {
return disabled === null ? false : true;
});
return page.rootElement.isEnabled();
});

@@ -97,0 +112,0 @@ }

@@ -49,2 +49,6 @@ var _ = require('lodash');

it('should ' + (options.disabled ? 'not be' : 'be') + ' enabled', function () {
expect(component.isEnabled()).to.eventually.eq(!options.disabled);
});
if (options.placeholder) {

@@ -61,13 +65,5 @@ it('should have a placeholder', function () {

});
it('should not be searchable', function () {
expect(component.isSearchable()).to.eventually.be.false;
});
});//when disabled
} else {
describe('when enabled', function () {
it('should be searchable', function () {
expect(component.isSearchable()).to.eventually.be.true;
});
it('should update the search term', function () {

@@ -74,0 +70,0 @@ component.term = 'testing';

@@ -73,9 +73,11 @@ var Page = require('astrolabe').Page;

* @instance
* @deprecated
* @description Whether or not the search box is searchable.
* To make this check, {@link rxSearchBox#isDisabled} is called.
* @returns {Boolean}
*
* **DEPRECATED** Use `isEnabled()` instead.
* @returns {Promise<Boolean>}
*/
isSearchable: {
value: function () {
return this.isDisabled();
return this.isEnabled();
}

@@ -87,9 +89,24 @@ },

* @instance
* @description Whether or not the search box is enabled.
* @returns {Promise<Boolean>}
*/
isEnabled: {
value: function () {
return this.txtSearch.isEnabled();
}
},
/**
* @function
* @instance
* @deprecated
* @description Whether or not the search box is disabled.
* @returns {Boolean}
*
* **DEPRECATED** Check inverse of `isEnabled()` instead.
* @returns {Promise<Boolean>}
*/
isDisabled: {
value: function () {
return this.txtSearch.getAttribute('disabled').then(function (disabled) {
return disabled === null ? true : false;
return this.isEnabled().then(function (enabled) {
return !enabled;
});

@@ -96,0 +113,0 @@ }

@@ -50,3 +50,3 @@ var _ = require('lodash');

it('should ' + (options.disabled ? 'be' : 'not be') + ' disabled', function () {
expect(component.isDisabled()).to.eventually.eq(options.disabled);
expect(component.isEnabled()).to.eventually.eq(!options.disabled);
});

@@ -53,0 +53,0 @@

@@ -101,7 +101,24 @@ var _ = require('lodash');

* @function
* @deprecated
* @description Whether or not the select element is disabled.
* @returns {Boolean}
*
* **DEPRECATED** check for inverse of `isEnabled()` instead.
* @returns {Promise<Boolean>}
*/
isDisabled: {
value: function () {
return this.isEnabled().then(function (enabled) {
return !enabled;
});
}
},
/**
* @instance
* @function
* @description Whether or not the select element is enabled.
* @returns {Promise<Boolean>}
*/
isEnabled: {
value: function () {
var page = this;

@@ -111,8 +128,6 @@ return this.eleFakeSelect.isPresent().then(function (isFakeSelect) {

return page.eleWrapper.getAttribute('class').then(function (classes) {
return _.contains(classes.split(' '), 'rx-disabled');
return !_.contains(classes.split(' '), 'rx-disabled');
});
}
return page.rootElement.getAttribute('disabled').then(function (disabled) {
return disabled === null ? false : true;
});
return page.rootElement.isEnabled();
});

@@ -119,0 +134,0 @@ }

@@ -193,3 +193,12 @@ var Page = require('astrolabe').Page;

return this.exists.then(function (exists) {
return exists ? tooltip.rootElement.getText() : null;
if (exists) {
// Tooltips, when left open, can obscure other hover/click
// events on the page. Avoid this by getting the text, stop
// hovering, then return the text value back to the user.
return tooltip.rootElement.getText().then(function (text) {
browser.actions().mouseMove($('body')).perform();
return text;
});
}
return null;
});

@@ -196,0 +205,0 @@ }

@@ -63,3 +63,3 @@ var rxTags = require('./rxTags.page').rxTags;

it('should no longer exist', function () {
expect(tag.exists()).to.eventually.be.false;
expect(tag.isPresent()).to.eventually.be.false;
});

@@ -93,3 +93,3 @@

it('should no longer exist', function () {
expect(component.byText(options.sampleText).exists()).to.eventually.be.false;
expect(component.byText(options.sampleText).isPresent()).to.eventually.be.false;
});

@@ -96,0 +96,0 @@

@@ -35,4 +35,6 @@ var Page = require('astrolabe').Page;

* @memberof rxTags.tag
* @returns {Boolean}
* @deprecated
* @description Whether or not the tag exists.
*
* **DEPRECATED** Use `isPresent()` instead.
* @example

@@ -42,5 +44,23 @@ * it('should have a tag present after creating it', function () {

* });
* @returns {Promise<Boolean>}
*/
exists: {
value: function () {
return this.isPresent();
}
},
/**
* @instance
* @function
* @memberof rxTags.tag
* @description Whether or not the tag exists.
* @example
* it('should have a tag present after creating it', function () {
* expect(encore.rxTags.initialize().addTag('Foo').isPresent()).to.eventually.be.true;
* });
* @returns {Promise<Boolean>}
*/
isPresent: {
value: function () {
return tagElement.isPresent();

@@ -47,0 +67,0 @@ }

@@ -5,3 +5,2 @@ var _ = require('lodash');

var rxSelect = require('./rxSelect.page').rxSelect;
var rxForm = require('./rxForm.page').rxForm;
var rxMisc = require('./rxMisc.page').rxMisc;

@@ -125,8 +124,7 @@

this.open();
rxForm.fill(this, {
hour: date.format('hh'), // 12-hour format (no padding)
minutes: date.format('mm'), // padded minutes
period: date.format('A'), // AM/PM
utcOffset: date.format('Z')
});
this.hour = date.format('hh'); // 12-hour format (no padding)
this.minutes = date.format('mm'); // padded minutes
this.selPeriod.element(by.cssContainingText('option', date.format('A'))).click();
this.selUtcOffset.element(by.cssContainingText('option', date.format('Z'))).click();
this.submit();

@@ -156,3 +154,3 @@ }

* @description Whether the picker is open
* @returns {Boolean}
* @returns {Promise<Boolean>}
*/

@@ -166,4 +164,7 @@ rxTimePicker.prototype.isOpen = function () {

/**
* @deprecated
* @description Whether the picker is closed
* @returns {Boolean}
*
* **DEPRECATED** Check inverse of `isOpen()` instead
* @returns {Promise<Boolean>}
*/

@@ -179,4 +180,4 @@ rxTimePicker.prototype.isClosed = function () {

var self = this;
return this.isClosed().then(function (closed) {
if (closed) {
return this.isOpen().then(function (opened) {
if (!opened) {
self.eleControl.click();

@@ -183,0 +184,0 @@ }

@@ -58,4 +58,4 @@ var Page = require('astrolabe').Page;

var page = this;
return this.isDisabled().then(function (disabled) {
if (disabled) {
return this.isEnabled().then(function (enabled) {
if (!enabled) {
page.btnToggleSwitch.click();

@@ -72,2 +72,4 @@ }

* @description Whether or not the switch component is currently set to the "off" position.
*
* **DEPRECATED** Check inverse of `isEnabled()` instead.
* @returns {Boolean}

@@ -74,0 +76,0 @@ */

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc