Chained scripts in package.json is not executing properly

前端 未结 1 1482
情话喂你
情话喂你 2021-01-21 11:53

I am trying to run my Protractor test from command line using package.json.

My package.json looks like below -

{
    \"name\": \"ProtractorFramework\",         


        
1条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-21 12:44

    Prabodh you can't chain the selenium server startup command and the test execute command.

    webdriver-manager start start up a Selenium Server and will output a bunch of info logs. Your Protractor test will send requests to this server to control a local browser. Leave this server running.

    When you run webdriver-manager start selenium server will run in the command prompt. This command prompt can't be closed if you close it then selenium server will be quit.

    Instead you can create a script that will open a new command prompt and run the webdriver-manager start command like

      "scripts": {    
           ..... 
           "wdstart":"start cmd /k webdriver-manager start timeout 10 && npm run protractor"
            ......
           }
    

    0 讨论(0)
提交回复
热议问题