我有一个包含多个输入的表单,问题是当我从以前的字段插入新字段量角器clear()输入时。我不知道为什么。
我的代码如下:
it('Populate vehicle data', function() {
browser.waitForAngular();
element(by.css('div#datepicking i.glyphicon-calendar')).click();
element(by.css('div#datepicking button[ng-click="select(\'today\')"]')).click();
element(by.css('div#datepicking input')).getAttribute('value').then(function(attr) {
accidentDate = attr;
});
element(by.model('case.vehicle.adminData.paintColour')).sendKeys(paintColour);
element(by.id('form-mileage')).sendKeys(mileage);
element(by.id('form-mileage-unit')).click().then(function() {
element(by.cssContainingText('option', lengthUnit)).click();
});;
element(by.model('case.vehicle.adminData.residualValuePercentage')).sendKeys(technicalValue);
element(by.id('form-vehicle-condition')).click().then(function() {
element(by.cssContainingText('option', vehicleCondition)).click();
});;
element(by.id('form-engine-type')).click().then(function() {
element(by.cssContainingText('option', motorType)).click();
});;
element(by.model('case.vehicle.techData.engineCapacity')).sendKeys(engineCapacity);
element(by.model('case.vehicle.techData.enginePower')).sendKeys(enginePower);
element(by.id('form-engine-power-unit')).click().then(function() {
element(by.cssContainingText('option', enginePowerUnit)).click();
});;
});
也许我不知道关于量角器或者什么的东西,但它看起来很好,但它在插入新的输入时会随机删除所有先前的输入。