量角器失败了'角度从未提供resumeBootstrap'

时间:2015-06-27 21:39:05

标签: javascript angularjs selenium-webdriver jasmine protractor

出于某种原因,当使用browser.get()导航到页面时,量角器会抛出错误angular never provided resumeBootstrap。我尝试将data-ng-app切换到ng-app,但这没有帮助。

完全错误

Error: Angular could not be found on the page chrome-extension://anmdjkcbefbfgijkigepfecgojdnaida/control.html : angular never provided resumeBootstrap

规范

var driver = browser.driver;

describe('Chrome Extension Control Page', function () {
    it('Should be defined', function () {
        browser.get('chrome-extension://anmdjkcbefbfgijkigepfecgojdnaida/control.html');

        expect(driver.getTitle()).toEqual("Control Page");

        expect(driver.executeScript(function () {
            return typeof window !== "undefined";
        })).toBeTruthy();
        element(by.css('input')).click();
    });

});

HTML

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>Control Page</title>
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/css/bootstrap-switch.min.css">
    <link rel="stylesheet" href="assets/css/bootstrap-theme.css">
    <link rel="stylesheet" href="assets/css/navbar.css">
    <link rel="stylesheet" href="assets/css/popup.css">

    <script src="assets/js/lib/jquery.min.js"></script>
    <script src="assets/js/lib/angular.min.js"></script>

    <script src="assets/js/lib/bootstrap.min.js"></script>
    <script src="assets/js/lib/ui-bootstrap-tpls.min.js"></script>
    <script src="assets/js/lib/angular-bootstrap-switch.min.js"></script>
    <script src="assets/js/lib/bootstrap-switch.min.js"></script>

    <script src="assets/modules/translate-filter.js"></script>
    <script src="assets/modules/review-box.js"></script>
    <script src="assets/modules/enable-switch.js"></script>
    <script src="assets/modules/navbar.js"></script>
    <script src="assets/modules/extension-interface.js"></script>
    <script src="assets/modules/status-monitor.js"></script>
    <script src="assets/modules/state-monitor.js"></script>

    <script src="assets/js/control-ui.js"></script>
</head>
<body data-ng-app="controlPage">

<div ng-controller="ControlPageCtrl">
    <extension-navbar></extension-navbar>
    <div class="">
        <div class="jumbotron" style="background-color: transparent; margin-bottom: 0">
            <status-monitor-area></status-monitor-area>
            <hr>
            <div>
                <div class="row">
                    <div class="col-xs-8">
                        <state-message></state-message>
                    </div>
                    <div class="col-xs-4">
                        <enable-switch></enable-switch>
                    </div>
                </div>
                <state-progress-bar></state-progress-bar>
            </div>
            <state-information-box></state-information-box>
        </div>
    </div>
</div>

</body>
</html>

1 个答案:

答案 0 :(得分:1)

编辑:这并没有解决问题。我不知道为什么量角器不起作用。

奇怪的修复。在我升级到Angular的最新版本之后,它工作了。

我没有考虑它,因为可用的升级是从v1.3.15到v1.3.16。非常奇怪的东西,Angular。