addressbook-level4 icon indicating copy to clipboard operation
addressbook-level4 copied to clipboard

Pressing "Enter" is not happening in GUI tests

Open okkhoy opened this issue 7 years ago • 9 comments

A few students have reported this issue. Description from one of the students this time:

The GUI tests run as usual, but when command text is auto-input in the text box, the automation doesn't press enter (even though the code is coded correctly to instruct so).
The GUI tests fail because the command is not executed because 'Enter' button is not pressed automatically. I tried to press enter manually during the tests and the tests were able to pass... I have already tried the fix announced on IVLE, but it didn't work.

Is this a known issue? What could fix the problem?

okkhoy avatar Apr 07 '17 01:04 okkhoy

I am unable to reproduce this problem. May I know which team is having this problem?

yamgent avatar Apr 07 '17 01:04 yamgent

Not sure if its the same problem face by the CS2103 students of this semester, but I have faced similar issue in the past during my CS2103.

The problem that I had back then, which I believe, was due to guiRobot.clickOn( ) -> FxRobot( ) function not clicking on the ui component that it was given, which leads to the commandbox not having the focus, hence the 'enter' command does not work. The problem seems to occur only on certain devices, as the testApp works perfectly on my team mate's laptop but does not work on mine.

The solution I relied on during that time was to run gradle test instead of testApp.

eugenepeh avatar Apr 07 '17 03:04 eugenepeh

@okkhoy can you tag one or more of the affected students here so that we can rope them into the troubleshooting discussion? Or ask them to reply here.

damithc avatar Apr 07 '17 03:04 damithc

@lproperty can you please carry forward the discussion

okkhoy avatar Apr 07 '17 05:04 okkhoy

The problem that I had back then, which I believe, was due to guiRobot.clickOn( ) -> FxRobot( ) function not clicking on the ui component that it was given, which leads to the commandbox not having the focus, hence the 'enter' command does not work. The problem seems to occur only on certain devices, as the testApp works perfectly on my team mate's laptop but does not work on mine.

I face this issue and I believe this is the correct explanation to the problem. I have tried to run the test cases using Gradle and the problem did not appear. Thank you!

lproperty avatar Apr 07 '17 05:04 lproperty

Ah OK, thanks for your inputs @eugenepeh and @lproperty!

May I also know whether both of you ran the GUI tests in headless mode to pass the tests?

yamgent avatar Apr 07 '17 10:04 yamgent

@yamgent

Ah yes, I ran the tests in headless mode in order to check my program and pass the test cases. Additionally, the problem only occurred to me after I modified the original addressbook GUI layout, shifting the command box from top to bottom etc.

eugenepeh avatar Apr 07 '17 13:04 eugenepeh

@yamgent same for me as well

lproperty avatar Apr 07 '17 14:04 lproperty

Thanks for confirming.

Actually, I have experienced a different issue before during my CS2103T time, whereby I cannot pass a HelpWindow GuiTest because TestFx wasn't able to press 'F1' on my laptop. However, my other teammates did not faced this problem.

I also solved the problem by running Gradle on headless mode.

The GuiTest architecture probably needs further examination to see whether we can solve the issue when it runs on vastly different testing environments.

yamgent avatar Apr 08 '17 03:04 yamgent