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
-- View this message in context: http://forum.world.st/Testing-a-callback-no-fuctional-test-tp4592036p4592036... Sent from the Seaside General mailing list archive at Nabble.com.
On Fri, Apr 27, 2012 at 10:00 AM, Davide lasmiste@gmail.com 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
Philippe Marschall wrote
AnchorCallbackExample new anchorClicked
Cheers Philippe _______________________________________________ seaside mailing list seaside@.squeakfoundation 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
-- View this message in context: http://forum.world.st/Testing-a-callback-no-fuctional-test-tp4592036p4592783... Sent from the Seaside General mailing list archive at Nabble.com.
typo: (even if I don't want to simulate *a* request)
-- View this message in context: http://forum.world.st/Testing-a-callback-no-fuctional-test-tp4592036p4592840... Sent from the Seaside General mailing list archive at Nabble.com.
+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:
Philippe Marschall wrote
AnchorCallbackExample new anchorClicked
Cheers Philippe _______________________________________________ seaside mailing list seaside@.squeakfoundation 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
-- View this message in context: http://forum.world.st/Testing-a-callback-no-fuctional-test-tp4592036p4592783... Sent from the Seaside General mailing list archive at Nabble.com. _______________________________________________ seaside mailing list seaside@lists.squeakfoundation.org javascript:; http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
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. Cheers Davide
-- View this message in context: http://forum.world.st/Testing-a-callback-no-fuctional-test-tp4592036p4598274... Sent from the Seaside General mailing list archive at Nabble.com.
On 30 April 2012 15:56, Dav lasmiste@gmail.com 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
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 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 seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
seaside@lists.squeakfoundation.org