简体   繁体   English

test:report:chrome 报告生成完成后,终端没有关闭实例,它继续运行

[英]After test:report:chrome Report generation done, Terminal not closing the instance, it keeps running

I am using protector, selenium for running the UI automation.我正在使用保护器 selenium 来运行 UI 自动化。

For chrome driver I am using webdriver-manager for testing the UI Automation.对于 chrome 驱动程序,我使用 webdriver-manager 来测试 UI 自动化。 It run successfully, browser also close but it keeps running the terminal instance can anyone help me on this?它运行成功,浏览器也关闭了,但它一直在运行终端实例,有人可以帮我吗?

config.directConnect = false;
        config.seleniumAddress = "http://127.0.0.1:4444/wd/hub";
        config.capabilities.chromeOptions = chromeOptions = {
          args: [
            "--no-sandbox",
            "--disable-infobars",
            "--disable-dev-shm-usage",
            "--disable-extensions",
            "--log-level=3",
            "--disable-gpu",
            "--start-maximized"
          ].concat(isCI ? ["--headless"] : []), // run in headless mode on the CI server
          prefs: {
            "download.default_directory": downloadDir
          }
        };
        config.serenity = {
          outputDirectory: `${process.cwd()}/test_reports_chrome`,
          runner: "cucumber",
          crew: [
            ArtifactArchiver.storingArtifactsAt("./test_reports_chrome"),
            ConsoleReporter.forDarkTerminals(),
            Photographer.whoWill(TakePhotosOfInteractions), // or Photographer.whoWill(TakePhotosOfFailures),
            new SerenityBDDReporter()
          ]

终端实例

you should add -r for script in package.json您应该在 package.json 中为脚本添加-r

"test:chrome": "npm-run-all -p -r webdriver:chrome execute:chrome",

-p = Run commands in parallel. -p = 并行运行命令。

-r = Kill all commands when one of them finishes with zero. -r = 当其中一个以零结束时终止所有命令。

Running npm run test:chrome will start Selenium driver, start http server (to serve you files) and run protractor tests.运行npm run test:chrome将启动 Selenium 驱动程序,启动 http 服务器(为您提供文件)并运行量角器测试。 Once all tests are finished, it will close the http server and the selenium driver.完成所有测试后,它将关闭 http 服务器和 selenium 驱动程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 React JS 中嵌入 Power BI 报表以获取报表实例 - Embed a Power BI report in React JS to get report instance 我的终端一直关闭。 这是怎么回事? - My terminal keeps closing. What's going on? setInterval 在调用 clearInterval 后继续运行 - setInterval keeps on running after clearInterval called 即使关闭终端后,如何为reactjs运行npm start? - How to run npm start for reactjs even after closing terminal? 反应-Chrome不会报告未定义的JavaScript对象属性。 崩溃 - React - Chrome does not report undefined JavaScript object property. Crashes 关于 React devtools chrome 扩展未使用 JS 的 Lighthouse 报告的困惑 - Confusion about Lighthouse report of unused JS for react devtools chrome extension 如何使用 react-pdf 库创建表格以生成 pdf 报告? - How can i create a table using the react-pdf library for generation pdf report? 如何在React Test中以html格式创建覆盖率报告 - How to create a coverage report as html format in react test 如何从反应中的测试覆盖率报告中找到未覆盖的功能 - How to find uncovered functions from test coverage report in react 进行更改后将 Power BI 嵌入式报表保存在数据库中 - Save Power BI embedded report in Database after making changes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM