Skip to content

Instantly share code, notes, and snippets.

@lislon
Created February 13, 2015 12:20
Show Gist options
  • Select an option

  • Save lislon/71ad3a85706796ba4c8b to your computer and use it in GitHub Desktop.

Select an option

Save lislon/71ad3a85706796ba4c8b to your computer and use it in GitHub Desktop.
"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'} });
client.init(done);
});
it('Fast loan process',function(done) {
client
.timeouts('implicit', 5000)
.timeouts('page load', 5000)
.setViewportSize({
width: 600,
height: 1200
})
.url('http://local.ros-dengi.ru')
.waitForExist('#loan-calc-getmoney')
.click('#loan-calc-getmoney')
// STEP 1
.setValue('#form-field-lastname', 'Тестов')
.setValue('#form-field-firstname', 'Тестов')
.setValue('#form-field-middlename', 'Тестович')
.click('#form-field-gender + div .js-toggle')
.click("ul.js-values > li")
.setValue('#form-field-phone', '9210951314')
.waitForExist('button#form-submit')
.waitFor('button#form-submit:not([disabled])')
.click('#form-submit')
.saveScreenshot('./snapshot.png')
// STEP 2
.setValue('#form-field-series', 1234)
.setValue('#form-field-number', 123456)
.setValue('#form-field-dateOfIssue', '01.01.2001')
.setValue('#form-field-depCode', '123456')
.setValue('#form-field-issuedBy', "Королем Гессляндии его величеством Гессом")
.setValue('#form-field-regAddress', "г Санкт-Петербург, Левашовский пр-кт, д 2")
.waitFor('div.suggestions-suggestion[data-index="0"]')
.setValue('#form-field-birthdate', "01.01.1982")
//.setValue('#form-field-relationship', '1')
//.waitForVisible('div.agreement .checkbox')
.click('div.agreement .checkbox')
.click('#form-field-relationship + div .js-toggle')
.click('#form-field-relationship + div li:first-child')
.setValue('input.js-form-lastname', "Тестов")
.setValue('input.js-form-firstname', "Тест")
.setValue('input.js-form-relationship', "Тест")
.saveScreenshot('./snapshot.png')
.call(done);
});
after(function(done) {
client.end(done);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment