Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 运行量角器测试时,Angular应用程序无法在firefox中正确加载_Angularjs_Firefox_Cucumber_Protractor_Cucumberjs - Fatal编程技术网

Angularjs 运行量角器测试时,Angular应用程序无法在firefox中正确加载

Angularjs 运行量角器测试时,Angular应用程序无法在firefox中正确加载,angularjs,firefox,cucumber,protractor,cucumberjs,Angularjs,Firefox,Cucumber,Protractor,Cucumberjs,我在量角器内对铬进行了一系列黄瓜测试。但是,当我转到Firefox时,页面会加载,但Angular不会运行。因此,您可以看到角度标记{{},而不是值,并且测试挂起,因为角度标记从未完成。当我手动加载页面、刷新页面或执行任何操作时,页面都会正常工作。从量角器启动它会导致Angular无法在Firefox中运行。 量角器配置 exports.config = { framework: 'cucumber', cucumberOpts: { format: 'p

我在量角器内对铬进行了一系列黄瓜测试。但是,当我转到Firefox时,页面会加载,但Angular不会运行。因此,您可以看到角度标记
{{}
,而不是值,并且测试挂起,因为角度标记从未完成。当我手动加载页面、刷新页面或执行任何操作时,页面都会正常工作。从量角器启动它会导致Angular无法在Firefox中运行。
量角器配置

    exports.config = {
    framework: 'cucumber',
    cucumberOpts: {
        format: 'progress',
//        tags: '@dev',
        require: 'test/e2e/features/step_definitions/steps.js'
    },
    specs: [
        'test/e2e/features/**/*.feature'
    ],



    //framework: 'mocha',
    //specs: [
    //    'test/e2e/**/*.spec.js'
    //],
    //mochaOpts: {
    //    enableTimeouts: false
    //},

    plugins: [{
        path: 'node_modules/protractor/plugins/timeline',

        // Output json and html will go in this folder.
        outdir: 'assets/timelines'

        // Optional - if sauceUser and sauceKey are specified, logs from
        // SauceLabs will also be parsed after test invocation.
        //sauceUser: 'Jane',
        //sauceKey: 'abcdefg'
    }],

    onPrepare: function () {
        process.env.PORT = 3001
        require('./server')
    },

    capabilities: {
        'browserName' : 'firefox'
    }
    //
    //multiplecapabilities: [{
    //    'browserName' : 'firefox'
    //}, {
    //    'browserName' : 'chrome'
    //}]
}
小黄瓜特征文件

Feature: Login to my account
  As a Customer, 
  I want to login into my account, 
  so I can use the application

Scenario: Authorize access for an active and valid account
Given I have a valid and active account
And I am logged out of the system
And I request to authenticate myself
When I provide my credentials
Then I should have access to my account

@negative
Scenario: Deny access for an invalid account
Given I have an invalid account
And I am logged out of the system
And I request to authenticate myself
When I provide my credentials
Then I should be denied access to my account
小黄瓜步骤定义

var db = require('../../../../db')
var User = require('../../../../server/models/user')
var bcrypt = require('bcrypt')
var chai = require('chai')
chai.use( require('chai-as-promised'))
var expect = chai.expect

var username = 'user';
var pass = 'pass'

var steps = function() {

    this.Given(/^I have a valid and active account$/, function (callback) {
        db.connection.db.dropDatabase()
        var user = new User({username: username})
        bcrypt.hash(pass, 10, function (err, hash) {
            if (err) {
                return next(err)
            }
            user.password = hash
            user.save(function (err) {
                if (err) {
                    return next(err)
                }
            })
            callback();
        })
    });

    this.Given(/^I am logged out of the system$/, function (callback) {
        browser.get('http://localhost:3001') 
        expect(element(by.css('nav .login'))).to.exist;
        callback();
    });

    this.Given(/^I request to authenticate myself$/, function (callback) {
        element(by.css('nav .login')).click() // fill out and submit registration form ' +
        callback();
    });

    this.When(/^I provide my credentials$/, function (callback) {
        element(by.model('username')).sendKeys(username)
        element(by.model('password')).sendKeys(pass)
        element(by.css('form .btn')).click() // submit a new post on the posts page
        callback();
    });

    this.Then(/^I should have access to my account$/, function (callback) {
        // Write code here that turns the phrase above into concrete actions
        callback.pending();
    });

    this.Given(/^I have an invalid account$/, function (callback) {
        db.connection.db.dropDatabase()
        callback();
    });

    this.Then(/^I should be denied access to my account$/, function (callback) {
        // Write code here that turns the phrase above into concrete actions
        callback.pending();
    });
};

module.exports = steps;

Firefox 35存在本机事件问题。 票证已在Selenium社区存档: 和AngularJS跟踪器:

解决方法:您可以在等待修复时将浏览器降级到v34