Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [swtbot-dev] SWTbot tests in dynamic languages (Jython)

Hi Geoff,

Thanks ! This sounds pretty cool (even with the problem you mention) :)
Could you open an entry on bugzilla with your attached code and
explanations.
Best Regards,

Mariot

Geoff Bache a écrit :
> Hi all,
>
> After suggestions from Ketan I've created my own Eclipse application
> that I believe should be able to run SWTBot tests in any dynamic
> language just by pointing out a source file. I have only tested it on
> a minimal example using Jython but in principle it ought to work. I
> attach the source code for this.
>
> I can then basically write a Python test for the rcpmail example:
> first I run this under Jython:
>
> allArgs = [ "-application", "org.eclipse.swtbot.testscript.application",
>             "-testApplication", "org.rcpmail", "-product",
> "org.rcpmail.product",
>             "-testScript", "/users/geoff/tmp/rcptest.py" ]
> import org.eclipse.equinox.launcher as launcher
> launcher.Main.main(allArgs)
>
> and then write this in rcptest.py : "bot" is a global variable set up
> by the attached Java code:
>
> bot.menu("File").menu("Open Another Message View").click()
> bot.viewByTitle("Message")
>
> then I can achieve the same things as in the inital example using Python.
>
> The surprise here was that it did not work to create the
> SWTWorkbenchBot in Python. If I tried it just threw
> IllegalStateException the whole time (and this wasn't a timing issue,
> I could wait forever and still got this). It is iterating through all
> existing threads and I suspect there is some clash between Java and
> Jython threads. I worked around this by creating it in Java and adding
> it to the global namespace of the script.
>
> Regards,
> Geoff Bache
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> swtbot-dev mailing list
> swtbot-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/swtbot-dev


Back to the top