jQuery UI 选项卡未显示在 TestNG 报告中

jQuery UI tabs not showing up in TestNG report

我正在尝试向我的 TestNG 报告添加 jQuery UI 选项卡效果。当我使用 reporter.log 添加它时,jQuery UI 选项卡显示在 index.html 报告中,其中显示了测试套件中的所有测试。 您可以在上图中看到它有效。我使用 reporter.log("jquery scripts and code here") 来执行此操作。它为每个测试步骤添加此 table。我可以单击链接,它会显示正确的选项卡。

但是当我在test-output文件夹中打开特定测试的测试报告时,jQuery UI效果不再起作用。

^此文件夹包含两个 html 报告,因为我的测试套件中有两个测试。

^ 这是其中一项测试的报告页面。

^ 当我点击显示输出时会发生这种情况

你可以看到它实际上显示了所有内容,但是 jQuery UI 效果不再起作用了。为什么是这样?这是我用来添加 jQuery UI 效果的代码。

//Report.log adds jqueryui script +css, and adds a fancy way to show test results with tabs
        Reporter.log("<script src=\"http://code.jquery.com/ui/1.11.2/jquery-ui.js\"></script>");
        Reporter.log("<link rel=\"stylesheet\" href=\"http://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css\">");
        Reporter.log("<script> $(function() { $( \".tabs\" ).tabs(); }); </script>");

好吧,我好像忘记添加jQuery库本身了。案件结案!