Skip to content

Instantly share code, notes, and snippets.

View lislon's full-sized avatar

Igor Golovin lislon

View GitHub Profile
Marionette.Module.extend = Marionette.extend;
// Extend the Module prototype with events / listenTo, so that the module
// can be used as an event aggregator or pub/sub.
_.extend(Marionette.Module.prototype, Backbone.Events, {
// Initialize is an empty function by default. Override it with your own
// initialization logic when extending Marionette.Module.
initialize: function(){},
app.on('start', function() {
if (Backbone.history) {
var state = Backbone.history.start({
pushState: false,
});
console.log("history started?");
}
})
var controller = new Controller({
loanCalcRegion: app.getRegion('loanCalc'),
loanOrder: window.__DATA.order,
yaCounter: window.yaCounter23682952,
});
app.Router = new Marionette.AppRouter({
routes: {
'order': function() {
_addViewListeners: function () {
var loanCalc = this;
this.listenTo(this.view, 'create:order:loan', function () {
loanCalc.trigger('create:order:loan', {
amount: this.model.get('amount'),
term: this.model.get('term'),
totalSum: this.model.get('totalSum'),
repayDate: this.model.get('repayDate'),
})
})
"use strict";
var service = module.exports = {},
derp = require('derp'),
async = require('async'),
randomstring = require('../util/randomstring'),
_ = require('lodash')
;
// services
client.addCommand("waitForFunc", function(checker, timeout) {
if (typeof timeout === 'function') {
cb = timeout
timeout = this.options.waitforTimeout
}
return new Promise(function(fulfill, reject) {
var start = new Date().getMilliseconds()
var timer = setTimeout(function run() {
if (!checker()) {
if (new Date().getMilliseconds() > start + timeout) {
"use strict"
process.env.NODE_ENV = 'testing'
process.env.PORT = '8001'
process.env.DIR_PUBLIC = __dirname + '/../public'
var chai = require('chai'),
assert = chai.assert,
expect = chai.expect,
webdriverio = require('webdriverio'),
div
strong Контактные лица:
{{#each contacts}}
div {{this.firstname}} {{this.middlename}} {{this.lastname}}
div Кем приходится: {{this.relationship}}
div Телефон: {{this.phone}}
br
{{/each}}
"use strict"
var chai = require('chai'),
assert = chai.assert,
expect = chai.expect,
webdriverio = require('webdriverio');
describe('Loan order process', function(){
this.timeout(99999999);
var client = {};
before(function(done){
client = webdriverio.remote({ desiredCapabilities: {browserName: 'firefox'} });
var page = require('webpage').create();
page.onResourceRequested = function(request) {
console.log('Request ' + JSON.stringify(request.url, undefined, 4));
};
page.onResourceReceived = function(response) {
//console.log('Receive ' + JSON.stringify(response.url, undefined, 4));
};
page.open('http://local.ros-dengi.ru', function(status) {