Hi,
It's not really clear to me how to test a callback without interact with a browser or tool like selenium, watir etc. etc Let's take an example from the Seaside book: AnchorCallbackExample>>renderContentOn: html html text: count. html break. html anchor callback: [ self anchorClicked ]; with: 'click to increment' How can I trigger the callback via unit test? Thanks Davide |
On Fri, Apr 27, 2012 at 10:00 AM, Davide <[hidden email]> wrote:
> Hi, > It's not really clear to me how to test a callback without interact with a > browser or tool like selenium, watir etc. etc > > Let's take an example from the Seaside book: > > AnchorCallbackExample>>renderContentOn: html > html text: count. > html break. > html anchor > callback: [ self anchorClicked ]; > with: 'click to increment' > > How can I trigger the callback via unit test? AnchorCallbackExample new anchorClicked Cheers Philippe _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Hmm you are not triggering the callback, you are sending a message to AnchorCallbackExample. What I'm wondering is about a way to work with the WACallbackRegistry (even if I don't want to simulate e request) Cheers Davide |
typo: (even if I don't want to simulate a request)
|
In reply to this post by Dave
+1 for Philippe's answer.
You do not want to test the Seaside callback mechanism, do you? This is already tested in functional and unit tests. Lukas On Friday, April 27, 2012, Davide wrote:
-- Lukas Renggli (mobile) http://www.lukas-renggli.ch _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
I see. The reason behind my thoughts is I'd like to reduce feedback of the correctness of my code without waiting for an interaction with a browser or a functional test. Let's take another simple example from your book: WebCounter>>renderContentOn: html html heading: count. html anchor callback: [ self increase ]; with: '++'. .... And let's suppose I already tested "increase" and "decrease". Unfortunately by mistake, I change the code this way: WebCounter>>renderContentOn: html html heading: count. html anchor callback: [ self decrease ]; with: '++'. .... I cannot realize the error until I run some functional tests. That's why I prefer to have a warning of my mistakes early in my development flow. Cheers Davide |
On 30 April 2012 15:56, Dav <[hidden email]> wrote:
> > Lukas Renggli wrote >> >> +1 for Philippe's answer. >> >> You do not want to test the Seaside callback mechanism, do you? This is >> already tested in functional and unit tests. >> >> Lukas >> > > I see. The reason behind my thoughts is I'd like to reduce feedback of the > correctness of my code without waiting for an interaction with a browser or > a functional test. > > Let's take another simple example from your book: > > WebCounter>>renderContentOn: html > html heading: count. > html anchor > callback: [ self increase ]; > with: '++'. > .... > > And let's suppose I already tested "increase" and "decrease". > Unfortunately by mistake, I change the code this way: > > WebCounter>>renderContentOn: html > html heading: count. > html anchor > callback: [ self decrease ]; > with: '++'. > .... > > I cannot realize the error until I run some functional tests. That's why I > prefer to have a warning of my mistakes early in my development flow. Understood. Seaside has no built-in support for such tests. There are however various projects that provide (or provided) such functionality. You might want to try WebTester (http://www.squeaksource.com/WebTester.html). Not sure how well it works with recent versions of Seaside? Lukas -- Lukas Renggli www.lukas-renggli.ch _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Hi Lukas,
The Webtester page says it use selenium, that conforms it in the functional test category. Anyway, thanks for help. Cheers Davide Understood. Seaside has no built-in support for such tests. There are however various projects that provide (or provided) such _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Would it suffice for you in your test case to send the #value message to the block?
|
Free forum by Nabble | Edit this page |