function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
timarptimarp 

Testing a visualforce page with LOOOOTS of javascript

Ok, so I have created this HUGE chunk of javascript inside my visualforce page which was meant to replace the multi line edit page for OpportunityProduct. The javascript is almost 600 lines big (is it a design fault to begin with? I opted for javascript mainly since I had so many field dependencies that simply could not be dealt with using controlling and dependent fields)

 

Anyways, I will write a test class next to make sure my extension is working. However, a lot of the testing, in my opinion, will have to make sure the javascript is showing and hiding elements like it's intended to. Any ideas on how I should be approaching QAing this monster of a VF page. I am thinking normal apex test classes along with some javascript testing framework (suggestions anyone?)

 

Thanks

 

bob_buzzardbob_buzzard

The problem I've found when doing this in the past is that the testing frameworks aren't really up to heavyweight javascript (and especially ajax), as they need a javascript engine built in.

 

The best way that I've found is to use Selenium - http://seleniumhq.org/

 

This is a plugin to the browser that allows you to record scripts and validate that the page changes in response to your actions as you would expect.  That way the browser's javascript engine is being used.