How to exit protractor when done












4















When I run gulp-protractor it runs my tests fine but when done it doesn't exit



8 specs, 0 failures
Finished in 14.874 seconds
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 passed
[14:40:57] Finished 'test:e2e' after 16 s


When done, I have to hit ctrl + c to continue. Is it possible to tell protractor to quit when done ?










share|improve this question























  • What exactly doesn't stop, are you referring to the 'WebDriver still running' or is your browser still open?

    – Tom Nijs
    Apr 30 '15 at 13:34











  • I've found the answer below :)

    – Jeanluca Scaljeri
    May 3 '15 at 10:49
















4















When I run gulp-protractor it runs my tests fine but when done it doesn't exit



8 specs, 0 failures
Finished in 14.874 seconds
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 passed
[14:40:57] Finished 'test:e2e' after 16 s


When done, I have to hit ctrl + c to continue. Is it possible to tell protractor to quit when done ?










share|improve this question























  • What exactly doesn't stop, are you referring to the 'WebDriver still running' or is your browser still open?

    – Tom Nijs
    Apr 30 '15 at 13:34











  • I've found the answer below :)

    – Jeanluca Scaljeri
    May 3 '15 at 10:49














4












4








4








When I run gulp-protractor it runs my tests fine but when done it doesn't exit



8 specs, 0 failures
Finished in 14.874 seconds
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 passed
[14:40:57] Finished 'test:e2e' after 16 s


When done, I have to hit ctrl + c to continue. Is it possible to tell protractor to quit when done ?










share|improve this question














When I run gulp-protractor it runs my tests fine but when done it doesn't exit



8 specs, 0 failures
Finished in 14.874 seconds
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 passed
[14:40:57] Finished 'test:e2e' after 16 s


When done, I have to hit ctrl + c to continue. Is it possible to tell protractor to quit when done ?







gulp protractor






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 30 '15 at 12:56









Jeanluca ScaljeriJeanluca Scaljeri

7,33123108182




7,33123108182













  • What exactly doesn't stop, are you referring to the 'WebDriver still running' or is your browser still open?

    – Tom Nijs
    Apr 30 '15 at 13:34











  • I've found the answer below :)

    – Jeanluca Scaljeri
    May 3 '15 at 10:49



















  • What exactly doesn't stop, are you referring to the 'WebDriver still running' or is your browser still open?

    – Tom Nijs
    Apr 30 '15 at 13:34











  • I've found the answer below :)

    – Jeanluca Scaljeri
    May 3 '15 at 10:49

















What exactly doesn't stop, are you referring to the 'WebDriver still running' or is your browser still open?

– Tom Nijs
Apr 30 '15 at 13:34





What exactly doesn't stop, are you referring to the 'WebDriver still running' or is your browser still open?

– Tom Nijs
Apr 30 '15 at 13:34













I've found the answer below :)

– Jeanluca Scaljeri
May 3 '15 at 10:49





I've found the answer below :)

– Jeanluca Scaljeri
May 3 '15 at 10:49












2 Answers
2






active

oldest

votes


















10














Check your gulp file,



Do you have a command to exit the process at the completion of tests?



e.g.



gulp.task('e2e', function() {
gulp.src(['foo/bar'])
.pipe(protractor({
configFile: 'protractor.conf.js',
args: ['--baseUrl', baseUrl],
keepAlive: true
}))
.on('end', function() {
console.log('E2E Testing complete');
process.exit();
})
.on('error', function(error) {
console.log('E2E Tests failed');
process.exit(1);
});


});



key line being
process.exit()






share|improve this answer



















  • 1





    The real culprit should be keepAlive: true, which keeps protractor from closing all handles and prevens node from exiting

    – Leon Adler
    Apr 19 '17 at 12:42



















0














In case anyone finds this answer in the context of non-gulp protractor issues, see this answer - the protractor.conf can be modified to use onComplete for this purpose.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29968380%2fhow-to-exit-protractor-when-done%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    10














    Check your gulp file,



    Do you have a command to exit the process at the completion of tests?



    e.g.



    gulp.task('e2e', function() {
    gulp.src(['foo/bar'])
    .pipe(protractor({
    configFile: 'protractor.conf.js',
    args: ['--baseUrl', baseUrl],
    keepAlive: true
    }))
    .on('end', function() {
    console.log('E2E Testing complete');
    process.exit();
    })
    .on('error', function(error) {
    console.log('E2E Tests failed');
    process.exit(1);
    });


    });



    key line being
    process.exit()






    share|improve this answer



















    • 1





      The real culprit should be keepAlive: true, which keeps protractor from closing all handles and prevens node from exiting

      – Leon Adler
      Apr 19 '17 at 12:42
















    10














    Check your gulp file,



    Do you have a command to exit the process at the completion of tests?



    e.g.



    gulp.task('e2e', function() {
    gulp.src(['foo/bar'])
    .pipe(protractor({
    configFile: 'protractor.conf.js',
    args: ['--baseUrl', baseUrl],
    keepAlive: true
    }))
    .on('end', function() {
    console.log('E2E Testing complete');
    process.exit();
    })
    .on('error', function(error) {
    console.log('E2E Tests failed');
    process.exit(1);
    });


    });



    key line being
    process.exit()






    share|improve this answer



















    • 1





      The real culprit should be keepAlive: true, which keeps protractor from closing all handles and prevens node from exiting

      – Leon Adler
      Apr 19 '17 at 12:42














    10












    10








    10







    Check your gulp file,



    Do you have a command to exit the process at the completion of tests?



    e.g.



    gulp.task('e2e', function() {
    gulp.src(['foo/bar'])
    .pipe(protractor({
    configFile: 'protractor.conf.js',
    args: ['--baseUrl', baseUrl],
    keepAlive: true
    }))
    .on('end', function() {
    console.log('E2E Testing complete');
    process.exit();
    })
    .on('error', function(error) {
    console.log('E2E Tests failed');
    process.exit(1);
    });


    });



    key line being
    process.exit()






    share|improve this answer













    Check your gulp file,



    Do you have a command to exit the process at the completion of tests?



    e.g.



    gulp.task('e2e', function() {
    gulp.src(['foo/bar'])
    .pipe(protractor({
    configFile: 'protractor.conf.js',
    args: ['--baseUrl', baseUrl],
    keepAlive: true
    }))
    .on('end', function() {
    console.log('E2E Testing complete');
    process.exit();
    })
    .on('error', function(error) {
    console.log('E2E Tests failed');
    process.exit(1);
    });


    });



    key line being
    process.exit()







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Apr 30 '15 at 14:11









    Jon DuffyJon Duffy

    366414




    366414








    • 1





      The real culprit should be keepAlive: true, which keeps protractor from closing all handles and prevens node from exiting

      – Leon Adler
      Apr 19 '17 at 12:42














    • 1





      The real culprit should be keepAlive: true, which keeps protractor from closing all handles and prevens node from exiting

      – Leon Adler
      Apr 19 '17 at 12:42








    1




    1





    The real culprit should be keepAlive: true, which keeps protractor from closing all handles and prevens node from exiting

    – Leon Adler
    Apr 19 '17 at 12:42





    The real culprit should be keepAlive: true, which keeps protractor from closing all handles and prevens node from exiting

    – Leon Adler
    Apr 19 '17 at 12:42













    0














    In case anyone finds this answer in the context of non-gulp protractor issues, see this answer - the protractor.conf can be modified to use onComplete for this purpose.






    share|improve this answer






























      0














      In case anyone finds this answer in the context of non-gulp protractor issues, see this answer - the protractor.conf can be modified to use onComplete for this purpose.






      share|improve this answer




























        0












        0








        0







        In case anyone finds this answer in the context of non-gulp protractor issues, see this answer - the protractor.conf can be modified to use onComplete for this purpose.






        share|improve this answer















        In case anyone finds this answer in the context of non-gulp protractor issues, see this answer - the protractor.conf can be modified to use onComplete for this purpose.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 28 '18 at 18:21

























        answered Nov 28 '18 at 14:27









        bsplosionbsplosion

        322111




        322111






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29968380%2fhow-to-exit-protractor-when-done%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

            Calculate evaluation metrics using cross_val_predict sklearn

            Insert data from modal to MySQL (multiple modal on website)