How to play register AGR macro inside JUnit tests ? [message #135432] |
Thu, 04 September 2008 15:42 |
Vincent MAHE Messages: 129 Registered: July 2009 |
Senior Member |
|
|
Hello
Do someone try (and succeed) to execute previously recorded GUI actions
with AutomatedGUIRecorder inside a JUnit test?
The purpose:
I have some functional tests to run on Eclipse bundles
(http://openembedd.org/download) for verification of correct integration
of model editors, demo samples, launch actions,...
Actually, test are done manually:
File
-> New
-> Examples...
-> OpenEmbeDD demo
-> OpenEmbeDD basic demo
and verify the sample project has been created
What we are trying to do:
- register the previous GUI sequence with TPTP AGR in a file
"New_Demo_Example.testsuite"
- write a JUnit(4) test like that:
public class RunExampleTest {
public static UMLEditor editor;
@Before
public void resetExampleProject() throws Exception {
Utils.cleanProject();
// execute the GUI sequence
Utils.playBackAGR("New_Demo_Example.testsuite");
}
@Test
public void openUMLEditor() throws Exception {
// get the UML editor with the diagram given by the demo.
editor = (UMLEditor)IDE.openEditor(UiTools.getPage(),
Utils.getUmlDiagramFile());
editor.close(false);
Assert.assertTrue(editor != null);
}
}
As a matter of fact, such play needs to be executed into the current
workbench, as the test is ran into a dedicated Eclipse (launched for the
test).
I work on this feature since one month, with no succeeding strategy
despite the number I tried.
--
Cordialement
Vincent MAHÉ
Ingénieur Plate-forme OpenEmbeDD - http://openembedd.org
IRISA-INRIA, Campus de Beaulieu, 35042 Rennes cedex, France
Tél: +33 (0) 2 99 84 71 00, Fax: +33 (0) 2 99 84 71 71
|
|
|
Re: How to play register AGR macro inside JUnit tests ? [message #135549 is a reply to message #135432] |
Fri, 05 September 2008 11:31 |
Paul Slauenwhite Messages: 975 Registered: July 2009 |
Senior Member |
|
|
Hi Vincent,
Unfortunately, the current AGR test execution architecture requires a
new instance of Eclipse during each run. You can reuse a workspace but
there is no way to associated an AGR test execution with a live instance of
Eclipse.
You can run your AGR test from a JUnit test class by using the Java
adapter for test execution provided by the Automatable Services Framework
(ASF):
http://help.eclipse.org/ganymede/topic/org.eclipse.hyades.te st.doc.user/tasks/tlaunching-tests-from-scripts-and-applicat ions.htm
Paul
"Vincent Mahe" <vmahe@irisa.fr> wrote in message
news:g9ovln$gb6$1@build.eclipse.org...
> Hello
>
> Do someone try (and succeed) to execute previously recorded GUI actions
> with AutomatedGUIRecorder inside a JUnit test?
>
> The purpose:
> I have some functional tests to run on Eclipse bundles
> (http://openembedd.org/download) for verification of correct integration
> of model editors, demo samples, launch actions,...
> Actually, test are done manually:
> File
> -> New
> -> Examples...
> -> OpenEmbeDD demo
> -> OpenEmbeDD basic demo
> and verify the sample project has been created
>
> What we are trying to do:
>
> - register the previous GUI sequence with TPTP AGR in a file
> "New_Demo_Example.testsuite"
>
> - write a JUnit(4) test like that:
>
> public class RunExampleTest {
> public static UMLEditor editor;
>
> @Before
> public void resetExampleProject() throws Exception {
> Utils.cleanProject();
> // execute the GUI sequence
> Utils.playBackAGR("New_Demo_Example.testsuite");
> }
>
> @Test
> public void openUMLEditor() throws Exception {
> // get the UML editor with the diagram given by the demo.
> editor = (UMLEditor)IDE.openEditor(UiTools.getPage(),
> Utils.getUmlDiagramFile());
> editor.close(false);
> Assert.assertTrue(editor != null);
> }
> }
>
> As a matter of fact, such play needs to be executed into the current
> workbench, as the test is ran into a dedicated Eclipse (launched for the
> test).
>
> I work on this feature since one month, with no succeeding strategy
> despite the number I tried.
> --
> Cordialement
>
> Vincent MAH
|
|
|
Re: How to play register AGR macro inside JUnit tests ? [message #135574 is a reply to message #135549] |
Fri, 05 September 2008 11:52 |
Vincent MAHE Messages: 129 Registered: July 2009 |
Senior Member |
|
|
Paul Slauenwhite a écrit :
> Hi Vincent,
> Unfortunately, the current AGR test execution architecture requires a
> new instance of Eclipse during each run. You can reuse a workspace but
> there is no way to associated an AGR test execution with a live instance of
> Eclipse.
The fact the recorder runs in the current workspace and the player
cannot is quite disconcerting :-(
>
> You can run your AGR test from a JUnit test class by using the Java
> adapter for test execution provided by the Automatable Services Framework
> (ASF):
>
> http://help.eclipse.org/ganymede/topic/org.eclipse.hyades.te st.doc.user/tasks/tlaunching-tests-from-scripts-and-applicat ions.htm
>
> Paul
I had a look on that, but it does not satisfy my requirements.
I am currently looking at SWTbot which seems exactly run like I need
(but with less features than AutoGUIRecorder).
> "Vincent Mahe" <vmahe@irisa.fr> wrote in message
> news:g9ovln$gb6$1@build.eclipse.org...
>> Hello
>>
>> Do someone try (and succeed) to execute previously recorded GUI actions
>> with AutomatedGUIRecorder inside a JUnit test?
>>
>> The purpose:
>> I have some functional tests to run on Eclipse bundles
>> (http://openembedd.org/download) for verification of correct integration
>> of model editors, demo samples, launch actions,...
>> Actually, test are done manually:
>> File
>> -> New
>> -> Examples...
>> -> OpenEmbeDD demo
>> -> OpenEmbeDD basic demo
>> and verify the sample project has been created
>>
>> What we are trying to do:
>>
>> - register the previous GUI sequence with TPTP AGR in a file
>> "New_Demo_Example.testsuite"
>>
>> - write a JUnit(4) test like that:
>>
>> public class RunExampleTest {
>> public static UMLEditor editor;
>>
>> @Before
>> public void resetExampleProject() throws Exception {
>> Utils.cleanProject();
>> // execute the GUI sequence
>> Utils.playBackAGR("New_Demo_Example.testsuite");
>> }
>>
>> @Test
>> public void openUMLEditor() throws Exception {
>> // get the UML editor with the diagram given by the demo.
>> editor = (UMLEditor)IDE.openEditor(UiTools.getPage(),
>> Utils.getUmlDiagramFile());
>> editor.close(false);
>> Assert.assertTrue(editor != null);
>> }
>> }
>>
>> As a matter of fact, such play needs to be executed into the current
>> workbench, as the test is ran into a dedicated Eclipse (launched for the
>> test).
>>
>> I work on this feature since one month, with no succeeding strategy
>> despite the number I tried.
>> --
>> Cordialement
>>
>> Vincent MAHÉ
>>
>> Ingénieur Plate-forme OpenEmbeDD - http://openembedd.org
>> IRISA-INRIA, Campus de Beaulieu, 35042 Rennes cedex, France
>> Tél: +33 (0) 2 99 84 71 00, Fax: +33 (0) 2 99 84 71 71
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02978 seconds