I am testing my project application-glossary. My tests are failing again
https://pastebin.com/Ww28QHzB. Can anyone please help me?
In general, how to read and use stack traces for debugging/removing errors?
I am not pretty good at this. I mean, in this stack trace also there are so
many errors with the same name like "XWikiLogOutputStream". Which line to
look? How to find where am I going wrong?
> On 5 Oct 2017, at 18:03, Sarthak Gupta <[hidden email]> wrote:
> I am testing my project application-glossary. My tests are failing again
> https://pastebin.com/Ww28QHzB. Can anyone please help me?
> In general, how to read and use stack traces for debugging/removing errors?
> I am not pretty good at this. I mean, in this stack trace also there are so
> many errors with the same name like "XWikiLogOutputStream". Which line to
> look? How to find where am I going wrong?
It’s hard to help you with the log. What it says;
* The test failed
* The reason is that Selenium timed out waiting for an element to be present:
• testNewGlossaryAndInNestedSpace(org.xwiki.glossary.test.ui.GlossaryTest) Time elapsed: 16.821 sec <<< ERROR!
• Livetable isn't ready after the timeout has expired.
* There’s a an error in the xwiki logs but I doubt that it’s causing the test failure:
17:24:25.794 [Thread-13] ERROR o.x.t.i.XWikiLogOutputStream - 2017-10-05 17:24:25,792[http://localhost:8080/xwiki/bin/skin/resources/uicomponents/search/searchSuggest.js?h=250790626] WARN c.x.x.d.XWikiDocument - A reference to XWikiGuest user as been set instead of null. This is probably a mistake.
<side explanation about XWikiLogOutputStream>
“XWikiLogOutputStream” is just the class that logs the result of executing XWiki: we start automatically XWiki from a Java class in the test and we collect the results and print them in the console. If you’re interested to see how it works:
* In your code https://github.com/xwiki-contrib/application-glossary/blob/master/application-glossary-test/application-glossary-test-tests/src/test/it/org/xwiki/glossary/test/ui/GlossaryTest.java#L42 you extend AbstractTest
* In AbstractTest there is a @BeforeTest annotation on init(). This is executed by JUnit. It starts XWiki:
public static void init() throws Exception
// Start XWiki
* It calls startXWiki() in by calling start_xwiki.sh https://github.com/xwiki/xwiki-platform/blob/0effdbb54f0a4e689e0bbfdc5cb91c8abb1db3a4/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-integration/src/main/java/org/xwiki/test/integration/XWikiExecutor.java#L268
* The started process’s STDOUT and STDERR are captured here: https://github.com/xwiki/xwiki-platform/blob/0effdbb54f0a4e689e0bbfdc5cb91c8abb1db3a4/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-integration/src/main/java/org/xwiki/test/integration/XWikiExecutor.java#L239
PumpStreamHandler streamHandler = new PumpStreamHandler(new XWikiLogOutputStream(XWikiLogOutputStream.STDOUT),
XWikiLogOutputStream uses the following logger to log what it captures:
That’s why you see XWikiLogOutputStream in the logs…
</side explanation about XWikiLogOutputStream>
So I don’t know what’s wrong with your test. Check the screenshot (you’ll see a reference to it in the logs):
17:24:48.504 [main] INFO org.xwiki.test.ui.TestDebugger - Screenshot for failing test [GlossaryTest-testGlossary] saved at [/home/sarthak/Desktop/Workspace1/application-glossary/application-glossary-test/application-glossary-test-tests/target/screenshots/GlossaryTest-testGlossary.png].
This is what Selenium was seeing when it failed. That can help you understand why some element wasn’t visible.
To help you further I’d need to execute your tests. I don’t have the time right now. Since the glossary app is very close to the FAQ app, I’d suggest you try to run the FAQ app tests, see if they work for you and try to mimick what they do.
> application-glossary <https://github.com/xwiki-contrib/application-glossary>
> Sarthak Gupta
|Free forum by Nabble||Edit this page|