【问题标题】:Using Firefox 35 with protractor results into an error将 Firefox 35 与量角器一起使用会导致错误
【发布时间】:2015-02-23 01:33:54
【问题描述】:

使用 chrome 运行我的 Angular 应用场景,场景运行成功,但在 firefox 新版本 35.0b6 上发生了停止。 任何人请帮助我提前谢谢。

我正在使用量角器 1.4.0。我的场景:

describe('99ccs e2e testing', function() {
    it('check it have a title 99CCS', function() {
        browser.get('http://99ccs.com/ccsnew/#/login');

        //it checks the "http://99ccs.com/ccsnew/" page contains a title "99CCS"
        expect(browser.getTitle()).toEqual('99CCS');

        //it checks when user enter the URL as "http://99ccs.com/ccsnew/" it navigates to "http://99ccs.com/ccsnew/#/login"
        browser.get('http://99ccs.com/ccsnew/');
        expect(browser.getLocationAbsUrl()).toBe('http://99ccs.com/ccsnew/#/login');

        //it checks when user enter the URL as "http://99ccs.com/ccsnew/" it navigates to Login page or not
        browser.getLocationAbsUrl().then(function(url) {
            expect(url.split('#')[1]).toBe('/login');
        });
        expect(browser.get('http://99ccs.com/ccsnew/')).toEqual(browser.get('http://99ccs.com/ccsnew/#/login'));

        //it checks if we give any location url from 99ccs.com/ccsnew without login it navigates to Login page or not
         expect(browser.get('http://99ccs.com/ccsnew/#/ts/edit/131')).toEqual(browser.get('http://99ccs.com/ccsnew/#/login'));
    });
});

【问题讨论】:

    标签: javascript angularjs firefox selenium protractor


    【解决方案1】:

    Selenium 2.44 与 Firefox 35 不兼容。相关问题:

    目前最简单的选择是将 firefox 降级到最新的稳定版本(当前为 34.0.5)。

    更新:selenium 2.45 已于今天(2015 年 2 月 28 日)发布,修复了 firefox 兼容性问题。目前,要让 protractorselenium 2.45 一起工作 - 直接从量角器 github master 分支安装它:

    $ npm install angular/protractor
    

    $ npm install git+https://git@github.com/angular/protractor.git
    

    仅供参考,我已经重现了 protractor 1.5 和“angularjs.org”protractor tutorial 测试用例的相同连接问题:

    describe('angularjs homepage todo list', function() {
        it('should add a todo', function() {
            browser.get('http://www.angularjs.org');
    
            element(by.model('todoText')).sendKeys('write a protractor test');
            element(by.css('[value="add"]')).click();
    
            var todoList = element.all(by.repeater('todo in todos'));
            expect(todoList.count()).toEqual(3);
            expect(todoList.get(2).getText()).toEqual('write a protractor test');
        });
    });
    

    【讨论】:

    猜你喜欢
    • 2011-06-30
    • 2013-11-11
    • 2014-12-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-22
    相关资源
    最近更新 更多