semperos/clj-webdriver — pull request #41 by locopati (2012-02-07 16:44:47+00:00)
Title: Element intersection

Something I ran into where I wanted to test the intersection of elements - make sure that things weren't overlapping where they shouldn't (or were where they should). This involved adding size (a built-in Webdriver function), rectangle (a supporting function that probably doesn't actually belong in the protocol but I wasn't sure where it should live, though it does actually apply to an Element, it returns a Java object really only intended to simplify intersects?), and intersects? to test for intersection among two or more elements.

For example...

```clojure
(def eles ...) ; list elements
(apply intersects? eles)
```

However, this does not seem to work from within the protocol. I have a working version as a separate function that I thought I could simply move into the protocol. Clojure throws errors about wrong arity.

Also, not happy about the way I needed to declare at the top of core_element.clj to allow the functions to be used within the protocol - maybe there's a better approach?

Anyhow, though not quite working code, I wanted to throw it out there to see what you thought (and maybe you know why that arity error is happening). Happy to clean it up and resubmit.