[Seaside] SeasideTesting and WebTester w/ Selenium

Joel Turnbull joelbywan at gmail.com
Sat Aug 28 04:02:22 UTC 2010


Bart,

It wasn't too long before I needed a span, so I had an idea and gave it a
try.

I copied your new Div classes into generic Element classes. An element could
be anything you are looking for with 'isElementPresent'. The test looks
like:


testIsPresent
    self should: (self elementById: 'divId') isPresent.
    self should: (self elementById: 'spanId') isPresent.
    self shouldnt: (self elementById: 'someOtherId') isPresent.

    self should: (self elementByXPath: '//div[@class=''foo'']') isPresent.
    self should: (self elementByXPath: '//span[@class=''foo'']') isPresent.
    self shouldnt: (self elementByXPath:
'//span[@class=''someOtherFooClass'']') isPresent.


Initially, it seems to be doing the trick.

Thanks,

Joel




On Fri, Aug 27, 2010 at 11:19 PM, Joel Turnbull <joelbywan at gmail.com> wrote:

> On Fri, Aug 27, 2010 at 6:55 AM, Bart Gauquie <bart.gauquie at gmail.com>wrote:
>
>> I found the time and uploaded a new version. Please give it a run.
>>
>
> Ok, I understand now. I gave it a run and it's great, thanks!
>
>
>> I've also noticed that WebTester contains an awfull lot of duplicated
>> code. Time to try out the reflective powers Smalltalk has I've learned in
>> the meanwhile to fix this. :-)
>>
>> Kind Regards,
>>
>> Bart
>>
>> On Fri, Aug 27, 2010 at 10:50 AM, Bart Gauquie <bart.gauquie at gmail.com>wrote:
>>
>>> Joel,
>>>
>>> WebTester is still in development. New features are added if needed.
>>>
>>> I agree that the code you've written is yikes ...
>>>
>>> What you've should be able to write is something like:
>>>
>>>      self assert: (self divByXPath: '@class="foo"') isPresent
>>>
>>> which will encapsulate the code you've provided. (analoguous to the other
>>> encapsulations).
>>>
>>> If I find the time, I will add it ... or I welcome your try to add it ...
>>>
>>> Kind Regards,
>>>
>>> Bart
>>>
>>>
>>> On Fri, Aug 27, 2010 at 6:33 AM, Joel Turnbull <joelbywan at gmail.com>wrote:
>>>
>>>>
>>>> I'm not sure if I'm doing this right.
>>>>
>>>> How do I, with WebTester, test that <div class="foo"> is present? This
>>>> is boggling me, and testing something like that seemed pretty obvious with
>>>> SeasideTesting. I ended up doing this, but yikes...
>>>>
>>>>     self assert: ( self webTester processCommand: 'isElementPresent'
>>>> withParams: ( Array with: '//div[@class=''foo'']' )) = 'true'
>>>>
>>>> Am I trying to do something that WebTester is not suited for?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Wed, Aug 25, 2010 at 8:56 AM, Joel Turnbull <joelbywan at gmail.com>wrote:
>>>>
>>>>> Very helpful, thank you. It occurred to me last night as I was playing
>>>>> some more with WebTester that it isn't necessarily a mutually exclusive
>>>>> decision. Like Johan stated, each  can be utilized for different kinds of
>>>>> testing.
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Aug 25, 2010 at 7:16 AM, C. David Shaffer <cdshaffer at acm.org>wrote:
>>>>>
>>>>>>  On 08/25/10 06:49, Bart Gauquie wrote:
>>>>>> > WebTester opens a browser by sending a http request to Selenium
>>>>>> Remote
>>>>>> > Control (http://seleniumhq.org/projects/remote-control/). And then
>>>>>> > this remote control starts the browser. Selenium Remote Control is a
>>>>>> > java process you have to start before starting the selenium tests in
>>>>>> > Smalltalk.
>>>>>> >
>>>>>>
>>>>>> I see.  I'm sure that makes sense for Selenium but for SeasideTesting
>>>>>> the best option is raising a browser window from Smalltalk (you could
>>>>>> ask the user to do it for you if you are really allergic to FFI).
>>>>>>  This
>>>>>> is especially true on build servers where ST is running inside a VNC
>>>>>> session, for example.
>>>>>>
>>>>>> David
>>>>>>
>>>>>> _______________________________________________
>>>>>> seaside mailing list
>>>>>> seaside at lists.squeakfoundation.org
>>>>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>>>>>
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> seaside mailing list
>>>> seaside at lists.squeakfoundation.org
>>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>>>
>>>>
>>>
>>>
>>> --
>>> imagination is more important than knowledge - Albert Einstein
>>> Logic will get you from A to B. Imagination will take you everywhere -
>>> Albert Einstein
>>> Learn from yesterday, live for today, hope for tomorrow. The important
>>> thing is not to stop questioning. - Albert Einstein
>>> The true sign of intelligence is not knowledge but imagination. - Albert
>>> Einstein
>>> However beautiful the strategy, you should occasionally look at the
>>> results. - Sir Winston Churchill
>>> It's not enough that we do our best; sometimes we have to do what's
>>> required. - Sir Winston Churchill
>>>
>>
>>
>>
>> --
>> imagination is more important than knowledge - Albert Einstein
>> Logic will get you from A to B. Imagination will take you everywhere -
>> Albert Einstein
>> Learn from yesterday, live for today, hope for tomorrow. The important
>> thing is not to stop questioning. - Albert Einstein
>> The true sign of intelligence is not knowledge but imagination. - Albert
>> Einstein
>> However beautiful the strategy, you should occasionally look at the
>> results. - Sir Winston Churchill
>> It's not enough that we do our best; sometimes we have to do what's
>> required. - Sir Winston Churchill
>>
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100828/6a22da34/attachment-0001.htm


More information about the seaside mailing list