Welcome to the Question and Answer site for Software Testing Professionals

You can get your queries resolved from Software Testing Professionals.

Ask a Question

Get answers and give answers to questions from other members.

View All Questions

Get votes and earn points to build your reputation in community.

View Hot Questions

0
Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test. while using grunt-loop-mocha

Open 1 Answers 75 Views
0 1

I am using grunt-loop-mocha to execute tests for selenium webdriver. I am getting below exception:

  1) [email protected]@@@_Wrapper-Final "before all" hook:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.
      at Timeout.<anonymous> (C:\Users\@@@@\Documents\oa-automation-suite\oa
-automation-suite\node_modules\mocha\lib\runnable.js:226:19)

Given below is my grunt file:


module.exports = function(grunt) {
  grunt.initConfig({
        loopmocha: {
            src: ["./tests/**/*-specs.js"],
            options: {
                mocha: {
                    reporter : 'spec'
                },
                iterations: [
                    {
                        "description": "Executing tests on Chrome",
                        "DESIRED": '{"browserName": "chrome","os":"Windows","os_version":"7","browser_version":"54"}'
                    },
                    {
                        "description": "Executing tests on Firefox",
                        "DESIRED": '{"browserName": "firefox","os":"Windows","os_version":"7","browser_version":"54"}'
                    }
                ]
            }
        }
    });
    grunt.loadNpmTasks('grunt-loop-mocha');
	grunt.registerTask('test', 'loopmocha');
};

 

1 Answer

0
0

You need to define timeout time for mocha:

                options: {
                    mocha: {
                        reporter : 'spec',
                        timeout : 30000
                    },

It should resolve your issue.

If you  do not want to specify  timeout time in your grunt file, you can even pass argument with your command as

grunt test --timeout <timeout_time_here>

e.g.

grunt test --timeout 3000

 

answered by (192 points)

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

We have resolved 1.2k+ Software Testing queries!

Software Testing Board Weekly update

We will send you handpicked questions that you would love to answer.

View previous campaigns.

Top Contributors

...