2016-04-28 59 views
-1

我是一名使用量角器的新手,現在我正在編寫一個頁面的測試用例。你能幫我如何獲得日曆事件和檢索日期&時間?我會真誠和真誠的感謝你的善意幫助。如何用量角器寫日曆e2e案例?

這裏查看:

//from when and what time you want to take vacation 
     <div> 
      <label class="control-label " for="startDate">Start Date</label> 

      <div class="input-group"> 
       <input type="text" class="form-control ng-valid ng-isolate-scope ng-valid-datetime ng-dirty ng-touched" name="startDate" placeholder="StartDate" datetime-picker="" ng-model="olNew.startDate" default-time="09:00" is-open="open.date3"> 
       <span class="input-group-btn"> 
        <button type="button" class="btn btn-default" ng-click="openCalendar($event, 'date3')"><i class="fa fa-calendar"></i></button> 
       </span> 
      </div> 

     </div> 
     //When and at what time you will end vacation 
     <div class="form-group "> 
      <label class="control-label " for="endDate"> 
       End Date 
      </label> 
      <div class="input-group"> 
       <input type="text" class="form-control ng-valid ng-isolate-scope ng-valid-datetime ng-dirty ng-touched" name="endDate" placeholder="EndDate" datetime-picker="" ng-model="olNew.endDate" default-time="09:30" is-open="open.date4"> 
       <span class="input-group-btn"> 
        <button type="button" class="btn btn-default" ng-click="openCalendar($event, 'date4')"><i class="fa fa-calendar"></i></button> 
       </span> 
      </div> 
     </div> 
     <div class="form-group "> 
      <label class="control-label " for="totalHours"> 
       Total Hours 
      </label> 
      <input class="form-control" id="totalHours" name="totalHours" placeholder="Total Hours" type="text" ng-model="olNew.ioHours"/> 
     </div> 

Here is the screenshot of the calendar:

+0

你能提供一個與這種日曆類似的演示頁嗎?謝謝。 – alecxe

+0

日曆的屏幕截圖已上傳。非常感謝您的幫助 –

回答

0

下面的代碼可以用來測試一個角度JS日曆。

var pickerDue = element(by.model("supplier.enroll_date")); 

var today = new Date(); 
var dd = today.getDate(); 
var mm = today.getMonth()+1; //January is 0! 
var yyyy = today.getFullYear(); 

if(dd<10) { 
    dd='0'+dd 
} 

if(mm<10) { 
    mm='0'+mm 
} 

today = yyyy+'-'+mm+'-'+dd; 

pickerDue.clear(); 
pickerDue.sendKeys(today); 

如果您不清楚,可隨時提出任何問題。

相關問題