2015-01-21 43 views
3

我想添加一个jQuery UI选项卡效果到我的TestNG报告。当我使用reporter.log添加它时,jQuery UI选项卡显示在index.html报告中,该报告显示了测试套件中的所有测试。 enter image description here 您可以看到它在上图中起作用。我使用reporter.log(“jquery脚本和代码在这里”)来做到这一点。它为每个测试步骤添加此表。我可以点击链接,它会显示正确的标签。jQuery UI选项卡不显示在TestNG报告

但是,当我打开测试输出文件夹内的特定测试的测试报告时,jQuery UI效果不再起作用。

enter image description here

^此文件夹包含两个HTML报告,因为我在我的两个测试程序测试。

enter image description here ^这是一个测试的报告页面。

enter image description here

^这发生在我上节目输出

点击你可以看到,它实际上是显示了一切,但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>"); 
+0

伙计........... – pumpkinzzz 2015-01-21 10:56:43

+0

...............? – Student 2015-01-21 11:48:05

回答

2

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