Alternatively, you could add the content of BaseTelluriumGroovyTestCase and DslTelluriumGroovyTestCase classes into your own Dsl class if your DSL is Groovy based.
http://code.google.com/p/aost/source/browse/trunk/core/src/main/groovy/org/tellurium/test/groovy/BaseTelluriumGroovyTestCase.groovy http://code.google.com/p/aost/source/browse/trunk/core/src/main/groovy/org/tellurium/test/groovy/DslTelluriumGroovyTestCase.groovy Or if you use your own parser and implement your DSL in Java, you can refer to the BaseTelluriumJavaTestCase class on how to add openUrl into your own Dsl class. http://code.google.com/p/aost/source/browse/trunk/core/src/main/groovy/org/tellurium/test/java/BaseTelluriumJavaTestCase.java Hope this can help. Thanks, Jian On Mon, Sep 21, 2009 at 3:50 PM, Jian Fang <[email protected]> wrote: > DslContext is really related to just one UI module class and the test class > may have multiple > UI module classes and thus, we like to separate the openUrl() method from > DslContext so that openUrl() decouples from UI modules. Also, all the > connection setup including framework initialization are handled in Base > Java/Groovy Test class, which makes it difficult to include openUrl() in > DslContext. The more important reason is the separation seems to be a more > clear design. > > For your case, why you cannot use our Dsl Engine which supports openUrl() > directly? > > If you really like to use your own Dsl, you can either use a delegate just > like what we did in the Dsl Engine class, or you can try Groovy 1.6 Mixin > feature, which I haven't done full research on. > > I am aware of the new @Singleton annotation for Groovy 1.6, but haven't > converted all the code to use it yet. Thanks for reminding me of this. > > Thanks, > > Jian > > On Mon, Sep 21, 2009 at 2:09 PM, Zsolt Kovacs <[email protected]> wrote: > >> I see. Is there any reason that the selenium open() is not supported by >> DslContext or BaseDslContext? >> >> I would love to have that method because I am in the same situation like >> you are, inheritance in my classes is already used. I am implementing a >> business specific DSL to write functional tests that span across different >> applications. Which means that the implementation of the script has to be >> able to open those applications. At the moment it is implemented using >> Selenium, but we are already struggling with maintenance, that is why I >> started to evaluate Tellurium. >> >> If there is no technical reason I can try to implement an open(url) method >> in DslContext. Alternatively I can try to use SeleniumConnector in my code, >> but for that I suggest to convert it to an AST based >> singleton<http://groovy.codehaus.org/Singleton+transformation>, >> if that is possible. >> >> >> Zsolt >> >> 2009/9/21 Jian Fang <[email protected]> >> >>> Well, that is a Dsl script. The magic is that we use the DslScriptEngine >>> class for the super class of all Dsl scripts, which extends DdDslContext (a >>> subclass of DslContext) and also has a delegate to >>> DslTelluriumGroovyTestCase. >>> >>> >>> http://code.google.com/p/aost/source/browse/trunk/core/src/main/groovy/org/tellurium/dsl/DslScriptEngine.groovy >>> >>> The DslTelluriumGroovyTestCase includes the openUrl() method. The reason >>> we did in this way is due to Java's single inheritance nature. Groovy Mixin >>> feature is not mature yet, otherwise we can mixin the >>> DslTelluriumGroovyTestCase to DslScriptEngine. >>> >>> Thanks, >>> >>> Jian >>> >>> >>> On Mon, Sep 21, 2009 at 10:50 AM, Zsolt Kovacs <[email protected]>wrote: >>> >>>> I am sorry but I do not really understand your answer. Your answer >>>> suggest, that I can only call it from a class which inherits from >>>> TelluriumJavaTestCase. Unfortunately I cannot do that, I need like to call >>>> openUrl() in a class, which inherits from DslContext. >>>> >>>> In fact the User Guide has examples like *openUrl " >>>> http://code.google.com/p/aost/" *on page A18, that is why I was so keen >>>> to use it. >>>> >>>> Thanks, >>>> >>>> Zsolt >>>> >>>> 2009/9/21 Jian Fang <[email protected]> >>>> >>>> OpenUrl is on the base Java/Groovy test case class. Not on DslContext. >>>>> Please use >>>>> >>>>> openUrl(URL) >>>>> >>>>> directly. >>>>> >>>>> Thanks, >>>>> >>>>> Jian >>>>> >>>>> >>>>> On Mon, Sep 21, 2009 at 7:56 AM, Zsolt Kovacs <[email protected]>wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I am unable to find the openUrl DSL method in the 0.6 release. I have >>>>>> tried the jar and also checked out tags/tellurium-0.6.0/core, but neither >>>>>> the DslContext nor BaseDslContext has got such method. I can click or >>>>>> type >>>>>> but calling openUrl throws this exception: >>>>>> >>>>>> groovy.lang.MissingMethodException: No signature of method: >>>>>> com.medicanimal.test.tellurium.ui.MANewUserPage.openUrl() is applicable >>>>>> for >>>>>> argument types: (org.codehaus.groovy.runtime.GStringImpl) values: [ >>>>>> https://localhost:8443/pageURL] >>>>>> at >>>>>> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:54) >>>>>> at >>>>>> org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:78) >>>>>> at >>>>>> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44) >>>>>> at >>>>>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143) >>>>>> at >>>>>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151) >>>>>> at >>>>>> com.medicanimal.test.tellurium.ui.MANewUserPage.open(MANewUserPage.groovy:59) >>>>>> >>>>>> Is it truly missing or I am doing something wrong? >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Zsolt >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>> >>> >>> >> >> >> >> > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "tellurium-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/tellurium-users?hl=en -~----------~----~----~----~------~----~------~--~---
