ruby on rails - Rails3 Google Maps testing with selenium -


I'm trying to test the Google Maps app with Rails3, I'm going to cure the javascript with Cassara and Selenium I am using I have a map where I wait for Google Maps to load, and then send an AJAX request to my server where I get the map. I am thinking that with the waiting of selenium until Google Maps is loaded, the AJAX call on my server is over and the marker is placed inside the map. The other problem is, how to choose this marker inside Google Maps. Is there any selector?

Should I go by other ways, and use Jasmin to use a JS test frame, if my classes are full and on this I have no experience with Jasmine, so is it possible to test a Google Maps?

Perhaps someone knows a solution, or a hint if this is not possible, or an alternative solution or ...;)

[Update 1]

I have figured out how to choose a marker in Google Maps. If you are looking at, you can see what they are doing. For example, selecting a marker:

  waitfororement displayed xpath = // img [in (@ source, 'marker')]   

But here comes the next problem How do I choose a specific marker? Is there a way to specify an ID within the Javascript Google Maps API, so that I # marker_1 , # marker_2 ...?

And another strange thing is that like the ceremony, wait_for_element or wait_for_condition are not available inside my cucumber stage definitions whether Google Selenium test itself Like waitForElementPresent ? Or are these standard selenium functions? I've got many different positions, where they always use something for

  selenium.wight_francondition selenium.wight_for_lement or @ selenium.wit_fracunction ...   

My step definitions include selenium and @ selenium var a nil. How can I access these methods? I have also found , but it is October 08. So I think that should be a better solution (BTW. This solution works at first sight).

On this, they give an overview of some Selenium methods, how to wait for a condition or element, is it still present? How can I use this function? Hey, I have found out that I have not mentioned the Selenium Test V2 for Google Maps, V3 mentioned above. I asked it

  wait_until {page.has_xpath?} ("// img [[src, 'marker']]")}   

But this does not work, the marker appears on the map, but I Receives an error from time to time, because this is not found with the XPath selector. I am thinking that it is generally possible to select a marker from the DOM.

I also tried to assign an additional attribute to the marker when creating it: Marker $ marker by Google Map (marker) .attr ('id ', "Marker_1");

But when I try to access it with the jQuery selector $ ("# marker_1") , it can not find it. So, there is still no solution, even then.

What do I do with myself, execution of calls in my steps? Definitions like this: / P>

Page. Exotic_script ("Launchmap ()")

Then check your existence in the page .. So check your normal Ajax marker in Capepara, contained in a div right? So if you call Launchmap and make markers, then Captaba should be able to find your markers.

UPDATE

About this plugin It turns out that:

This gives you semantic markup for your Google Maps (for a pretty fall) You are actually allowed to check whether a marker is using Capibara or not. Hope it helps (it does not have time to test but it looks promising)

Comments