【问题标题】:npm ERR! code ELIFECYCLE - Running webdriver IO tests from jenkinsnpm 错误!代码 ELIFECYCLE - 从 jenkins 运行 webdriver IO 测试
【发布时间】:2021-12-03 09:02:48
【问题描述】:

我在 jenkins 中使用 allure 集成运行 webdriverIO 测试,测试完成后它显示 npm ERR!代码 ELIFECYCLE 后跟 'java.lang.NullPointerException 在 ru.yandex.qatools.allure.jenkins.AllureReportPublisherDescriptor.getCommandlineInstallation(AllureReportPublisherDescriptor.java:112)'

已尝试清除 npm 缓存、删除 node_modules、npm 安装。

Spec Files:  5 passed, 1 failed, 6 total (100% completed) in 00:00:57 
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! webdriverio7@1.0.0 creditCardTests: `npx wdio run wdio.conf.js -- suite creditCard`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the webdriverio7@1.0.0 creditCardTests script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\ak\AppData\Roaming\npm-cache\_logs\2021-10-15T04_16_36_501Z-debug.log
    Build step 'Execute Windows batch command' marked build as failure
    ERROR: Build step failed with exception
    java.lang.NullPointerException
        at ru.yandex.qatools.allure.jenkins.AllureReportPublisherDescriptor.getCommandlineInstallation(AllureReportPublisherDescriptor.java:112)
        at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.getCommandline(AllureReportPublisher.java:346)
        at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.generateReport(AllureReportPublisher.java:303)
        at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.perform(AllureReportPublisher.java:231)
        at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
        at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:806)
        at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:755)
        at hudson.model.Build$BuildExecution.post2(Build.java:178)
        at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:699)
        at hudson.model.Run.execute(Run.java:1913)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:99)
        at hudson.model.Executor.run(Executor.java:432)
    Build step 'Allure Report' marked build as failure
    Finished: FAILURE

【问题讨论】:

    标签: node.js jenkins npm webdriver-io


    【解决方案1】:

    删除了 allure 插件并再次添加了 maven 链接以获取插件。

    我能够生成诱惑报告,但仍然收到旧错误...npm ERR!代码生命周期

    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! webdriverio7@1.0.0 creditCardTests: `npx wdio run wdio.conf.js -- suite creditCard`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the webdriverio7@1.0.0 creditCardTests script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\arukumar\AppData\Roaming\npm-cache\_logs\2021-10-15T10_43_02_186Z-debug.log
    Build step 'Execute Windows batch command' marked build as failure
    [webdriverio7] $ C:\Users\arkumar\.jenkins\tools\ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation\allure\bin\allure.bat generate D:\webdriverio7\allure-results -c -o D:\webdriverio7\allure-report
    Report successfully generated to D:\webdriverio7\allure-report
    Allure report was successfully generated.
    Creating artifact for the build.
    Artifact was added to the build.
    Finished: FAILURE
    

    【讨论】:

    • 你确定你已经安装了@wdio/cli 还是把它作为依赖的一部分?
    猜你喜欢
    • 2014-06-10
    • 2017-11-15
    • 1970-01-01
    • 2020-02-12
    • 2017-08-15
    • 1970-01-01
    • 2019-04-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多