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

//testcase name：抄表管理-用户查询
//author：feizhao
//date：2017-11-13
//discription：用于测试登陆后，抄表管理中对用户进行查找、抄表等操作
//step：1.登录抄表管理主页面  2.输入用户编号，用户姓名，电话等查询用户
//修改人：
//修改日期：

const accountConfig = {
  username: '1',
  password: '1',
}
 module.exports = {
   ' 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)
     .waitForElementVisible('body', 1000)
     .click('button[id=login-button]')
     .pause(1000)
     .click('#vc-tree-name-机表管理')
     .pause(1000)
     .click('#vc-tree-name-抄表管理')
// 抄表管理-用户查询
     .pause(30000)
     .setValue('input[placeholder=用户姓名]','黄红丽')
    //  .pause(500)
    //  .setValue('input[placeholder=电话]','18192592986')
     .pause(500)
     .click('.form-inline :nth-child(13) button')
     .pause(1000)
     .clearValue("input[placeholder=用户姓名")
    //  .pause(100)
    //  .clearValue('input[placeholder=电话')
     .pause(100)
     .setValue('input[placeholder=表编号]','1001000008')
     .pause(500)
     .setValue('input[placeholder=用户编号]','13')
     .pause(500)
     .click('.form-inline :nth-child(13) button')
     .pause(2000)
     .clearValue("input[placeholder=表编号")
     .pause(100)
     .clearValue("input[placeholder=用户编号")
     .pause(100)
     .setValue('input[placeholder=区域]','止戈乡场镇')
     .pause(500)
     .click('.form-inline :nth-child(13) button')
     .pause(2000)
     .clearValue('input[placeholder=区域]')
     .pause(100)
     .setValue('input[placeholder=小区]','科技小区')
     .pause(500)
     .click('.form-inline :nth-child(13) button')
     .pause(2000)
     .clearValue('input[placeholder=小区]')
     .pause(100)
     .setValue('input[placeholder=用户地址]','科技二路')
     .pause(500)
     .click('.form-inline :nth-child(13) button')
     .pause(2000)
     .clearValue('input[placeholder=用户地址]')
     .pause(100)
     .click('.form-inline :nth-child(7) button')
     .pause(1000)
     .click('.form-inline :nth-child(7) ul :nth-child(1) a')
     .pause(500)
     .click('.form-inline :nth-child(13) button')
     .pause(2000)
     .click('.form-inline :nth-child(8) button')
     .pause(1000)
     .click('.form-inline :nth-child(8) ul :nth-child(1) a')
     .pause(500)
     .click('.form-inline :nth-child(13) button')
     .pause(2000)
     .click('.form-inline :nth-child(9) button')
     .pause(1000)
     .click('.form-inline :nth-child(9) ul :nth-child(1) a')
     .pause(500)
     .click('.form-inline :nth-child(13) button')
     .pause(2000)
     .click('.form-inline :nth-child(10) button')
     .pause(1000)
     .click('.form-inline :nth-child(10) ul :nth-child(1) a')
     .pause(500)
     .click('.form-inline :nth-child(13) button')
     .pause(2000)
     .click('.form-inline :nth-child(11) button')
     .pause(1000)
    //  .click('.form-inline :nth-child(11) ul :nth-child(1) a')
    //  .pause(500)
     .click('.form-inline :nth-child(13) button')
     .pause(2000)
     .click('.form-inline :nth-child(12) button')
     .pause(1000)
     .click('.form-inline :nth-child(12) ul :nth-child(1) a')
     .pause(500)
     .click('.form-inline :nth-child(13) button')
     .pause(2000)
     .end();
   }
 }
