量角器测试失败,因为模型值为空

JAB*_*ABD 0 selenium integration-testing angularjs selenium-webdriver protractor

我有一个样本小提琴,我试图用量角器测试.

以下是我的测试

describe("Fiddle homepage", function() {


    beforeEach(function() {
        browser.get('http://fiddle.jshell.net/yfUQ8/9/show');
        browser.rootEl = 'div';
    });
    describe("binding", function() {
        var inputByModel;
        beforeEach(function() {
            inputByModel = element(by.model('model.yourName'));
        })
        // Fail
        it("should have value Julie1", function() {
            inputByModel.sendKeys('Julie1');
            // browser.waitForAngular();
            expect(inputByModel.getText()).to.eventually.equal('Julie1');

        });
        // Fail
        it("should have value Julie2", function() {
            inputByModel.sendKeys('Julie2');

            var greeting = element(by.model('model.yourName'));
            expect(greeting.getText()).to.eventually.equal('Julie2');
        });
        // Pass
        it("should have value Julie3", function() {
            inputByModel.sendKeys('Julie3');
            var byBinding = element(by.binding('model.yourName'));
            expect(byBinding.getText()).to.eventually.equal('Julie');
        });
        // Fail
        it("should get value by id and should pass the test", function() {
            inputByModel.sendKeys('Julie4');

            var byID = element(by.id('myinput'));
            expect(byID.getText()).to.eventually.equal('Julie4');
        })
    });
});
Run Code Online (Sandbox Code Playgroud)

我正在使用mocha,chaiAsPromised来运行我的测试.谁能解释为什么我的前两个测试都失败了?