Gui Testing for Cameo Plugins

MagicDraw OpenAPI, scripting related questions and discussions

Moderator: Moderators

Gui Testing for Cameo Plugins

Postby moliveira@itemis.de » Fri Jun 14, 2019 8:15 am

Hallo,

We are developing extension plugins for Cameo and SysML.
Beside unit testing and integration tests, we want to implement automated acceptance tests through the GUI for completeness.
I have tried to use Jubula, which supports Swing, SWT/RCP/GEF, JavaFX, and HTML. But I had no success.

Based on some Cameo's error messages, it seems Cameo is using SWT, Swing, and JavaFX.
Looking at the 3rd party Libraries I notice it is also using JIDE components, what may be the reason Jubula is not connecting with Cameo (maybe due to some component extension).
The connection fails when I am trying to map testing logic components to cameo GUI components.

Searching in web and in this forum, I have the feeling no one is doing GUI testing for NoMagic extensions.

Has someone implemented GUI testing for Cameo and can provide hints of which tool I can use?

Cheers
moliveira@itemis.de
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Tue Oct 16, 2018 2:15 am
Full name: Marcio Ferreira da Silva Oliveira

Re: Gui Testing for Cameo Plugins

Postby moliveira@itemis.de » Mon Aug 05, 2019 9:24 am

To implement my acceptance tests and GUI test I gave a try to AssertJ-Swing (https://joel-costigliola.github.io/asse ... swing.html)

Run the tests with MagicDrawTestRunner from the launcher file (Run as Eclipse Application).
The project that testes the plugin is similar to Magic Draw Plugin Test example.
Just add the dependencies to the classpath:

assertj-core-3.13.0.jar
assertj-swing-3.9.2.jar
assertj-swing-jide-3.9.0.jar
assertj-swing-junit-3.9.2.jar

Here is an example of how the test looks like:


@RunWith(MagicDrawTestRunner.class)
public class GuiTest {

private FrameFixture window;

@Test
public void existMyExtensionsInMainMenu() throws Exception {
// get Cameo GUI Frame to be tested
MainFrame mainFrame = Application.getInstance().getMainFrame();

// bind frame into testing fixture
window = new FrameFixture(mainFrame.getActiveFrame());

// assert if exist MyExtensions in main menu, assuming one have created a plugin that implemets a menu named "MyExtensions"
window.menuItem("MyExtensions").requireEnabled();
// assert if exist "ExecuteSomeExtension" menu entry in "MyExtensions" menu
JMenuItemFixture menuItem = window.menuItemWithPath("MyExtensions", "ExecuteSomeExtension");
menuItem.requireEnabled();
}

It is not high level as JUBULA, but does the job.
moliveira@itemis.de
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Tue Oct 16, 2018 2:15 am
Full name: Marcio Ferreira da Silva Oliveira

Re: Gui Testing for Cameo Plugins

Postby rjhudson@mitre.org » Sat Aug 17, 2019 5:49 pm

Very cool; thanks for sharing.
rjhudson@mitre.org
Forum Newbie
Forum Newbie
 
Posts: 11
Posts Rating:3
Joined: Thu Jun 29, 2017 3:40 pm


Return to Programmatic Extendibility

Who is online

Users browsing this forum: No registered users and 1 guest