// For authoring Nightwatch tests, see
// http://nightwatchjs.org/guide#usage

//testcase name：档案查询
//author：feizhao
//date：2017-11-07
//discription：用于测试登陆后，在用户档案界面通过不同条件查询用户
//step：1.登录主页面  2.通过不同条件查询用户

//Account setting.
const accountConfig = {
  username: '1',
  password: '1',
}
 module.exports = {
   'login tests': function (browser) {
     browser
     .url('http://127.0.0.1:8080').maximizeWindow()
     .pause(1000)
    //  .waitForElementVisible('body', 100)
     .setValue('input[type=text]',accountConfig.username)
     .pause(100)
     .setValue('input[type=password]',accountConfig.password)
     .pause(100)
     .click('button[id=login-button]')
     .pause(1000)

    //  点击档案管理-用户档案
    .click('#vc-tree-name-档案管理')
    .pause(1000)
    .click('#vc-tree-name-用户档案')
     .pause(1000)
     .setValue('input[placeholder=用户编号]','4004000332')
     .pause(1000)
     .click('.form-inline.auto :nth-child(12)')
     .pause(300)
     .clearValue('input[placeholder=用户编号]')
     .pause(100)
     .setValue('input[placeholder=用户姓名]','邱仁静')
     .pause(1000)
     .click('.form-inline.auto :nth-child(12)')
     .pause(300)
     .clearValue('input[placeholder=用户姓名]')
     .pause(100)
     .setValue('input[placeholder=电话]','13628143802')
     .pause(1000)
     .click('.form-inline.auto :nth-child(12)')
     .pause(300)
     .clearValue('input[placeholder=电话]')
     .pause(100)
     .setValue('input[placeholder=区域]','高新区')
     .pause(1000)
     .click('.form-inline.auto :nth-child(12)')
     .pause(300)
     .clearValue('input[placeholder=区域]')
     .pause(100)
     .setValue('input[placeholder=小区]','科技小区')
     .pause(1000)
     .click('.form-inline.auto :nth-child(12)')
     .pause(300)
     .clearValue('input[placeholder=小区]')
     .pause(100)
     .setValue('input[placeholder=用户地址]','科技二路')
     .pause(1000)
     .click('.form-inline.auto :nth-child(12)')
     .pause(300)
     .clearValue('input[placeholder=用户地址]')
     .pause(100)
     .click('.form-inline.auto :nth-child(7) div button')
     .pause(300)
     .click('.form-inline.auto :nth-child(7) div ul li:nth-child(1)')
     .pause(300)
     .click('.form-inline.auto :nth-child(8) div button')
     .pause(300)
     .click('.form-inline.auto :nth-child(8) div ul li:nth-child(1)')
     .pause(300)
     .click('.form-inline.auto :nth-child(9) div button')
     .pause(300)
     .click('.form-inline.auto :nth-child(9) div ul li:nth-child(1)')
     .pause(300)
     .click('.form-inline.auto :nth-child(10) div button')
     .pause(300)
     .click('.form-inline.auto :nth-child(10) div ul li:nth-child(1)')
     .pause(300)
     .click('.form-inline.auto :nth-child(11) div button')
     .pause(300)
     .click('.form-inline.auto :nth-child(12)')
    //  .click('.form-inline.auto :nth-child(11) div ul li:nth-child(1)')
     .pause(10000)
     .end();
   }
 }
