2015-01-21 36 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庫本身。案件結案!