Commit a03c6757 a03c6757610475c84acdac5bee7007d1a741a049 by Nicolas Perriault

reintroduced CasperUtils#exists, erroneously deleted on merge

1 parent e13b9169
Showing 1 changed file with 14 additions and 0 deletions
...@@ -546,6 +546,20 @@ ...@@ -546,6 +546,20 @@
546 }; 546 };
547 547
548 /** 548 /**
549 * Checks if a given DOM element exists in remote page.
550 *
551 * @param String selector CSS3 selector
552 * @return Boolean
553 */
554 this.exists = function(selector) {
555 try {
556 return document.querySelectorAll(selector).length > 0;
557 } catch (e) {
558 return false;
559 }
560 };
561
562 /**
549 * Downloads a resource behind an url and returns its base64-encoded 563 * Downloads a resource behind an url and returns its base64-encoded
550 * contents. 564 * contents.
551 * 565 *
......