Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var Page = require('astrolabe').Page;
var URL = require('../node_modules/astrolabe/lib/astrolabe/utils/url'); // http://i.imgur.com/iCWOGrq.gif
var _ = require('lodash');
module.exports = Page.create({
/**
* @override
* @description I needed this to *always* go to the designated component demo page
* while using a `debug=true` flag. This exposes all facets of a demo component page,
* which is required to reach full test coverage. For normal users, they shouldn't have
* to see all eight or ten examples of a component -- one or two is sufficient. However, this
* function over ride keeps all typical `.go` functionality intact from the latest release.
* See the source for a link to the exact commit SHA that I borrowed the `.go` functionality from.
*/
go: {
value: function () {
var url = new URL('');
// stuplum/astrolabe/blob/963eb5001d7d3ce019a6ed66cec62ba2bb0d316b/lib/astrolabe/page.js#L10-L13
_.each(arguments, function (arg) {
var _ = require('lodash');
var Page = require('astrolabe').Page;
// an anonymous page object to prove that form filling works
var formPageObject = Page.create({
form: {
set: function (formData) {
encore.rxForm.form.fill(this, formData);
}
},
plainTextbox: encore.rxForm.textField.generateAccessor($('#txtPlain')),
requireName: encore.rxForm.checkbox.generateAccessor($('#chkVolumeNameRequired')),
options: {
get: function () {
return Page.create({
first: encore.rxForm.radioButton.generateAccessor($('#favBeatle_0')),
second: encore.rxForm.radioButton.generateAccessor($('#favBeatle_1'))
});
var Page = require('astrolabe').Page;
// an anonymous page object to prove that form filling works
var formPageObject = Page.create({
form: {
set: function (formData) {
encore.rxForm.fill(this, formData);
}
},
plainTextbox: encore.rxForm.textField.generateAccessor($('#txtPlain')),
requireName: encore.rxCheckbox.generateAccessor($('#chkVolumeNameRequired')),
options: {
get: function () {
return Page.create({
first: encore.rxRadio.generateAccessor($('#favBeatle_0')),
second: encore.rxRadio.generateAccessor($('#favBeatle_1'))
});
var _ = require('lodash');
var Page = require('astrolabe').Page;
var rxStatusColumn = encore.rxStatusColumn;
var rxSortableColumn = encore.rxSortableColumn;
// an anonymous page object to demonstrate table and cell creation
var repeaterString = 'server in servers';
var tablePageObject = Page.create({
rootElement: {
get: function () {
return $('.demo-status-column-table');
}
},
tblServers: {
get: function () {
return this.rootElement.all(by.repeater(repeaterString));
}
},
column: {
value: function (columnName) {
// Only 'Status' is supported -- 'Title' is unsortable.
var Page = require('astrolabe').Page;
module.exports = Page.create({
url: { value: '/home' }
});
var Page = require('astrolabe').Page;
module.exports = Page.create({
url: { value: '/login' }
});
/**
* Partial for the page objects associated with clubs
*/
var Page = require('astrolabe').Page;
module.exports = Page.create({
url: { value: 'UI/index.html#/clubs' },
title: { get: function() { return this.findElement(this.by.id('title')); } },
description: { get: function() { return this.findElement(this.by.id('description')); } },
clubTableElement: { value: function(rowNum, columnBinding) {
return this.findElement(this.by.repeater('row in renderedRows').row(rowNum).column(columnBinding)); } }
}
);
/**
* Partial for the page objects associated with home
*/
var Page = require('astrolabe').Page;
module.exports = Page.create({
url: { value: 'UI/index.html' },
clubsLink: { get: function() { return this.findElement(this.by.id('clubsLink')); } },
teamsLink: { get: function() { return this.findElement(this.by.id('teamsLink')); } }
});
initialize: function (rxCollapseElement) {
if (rxCollapseElement === undefined) {
rxCollapseElement = $('rx-collapse');
}
rxCollapse.rootElement = {
get: function () { return rxCollapseElement; }
};
return Page.create(rxCollapse);
},
initialize: function (rxCharacterCountElement) {
rxCharacterCount.rootElement = {
get: function () { return rxCharacterCountElement; }
};
return Page.create(rxCharacterCount);
},