Giter VIP home page Giter VIP logo

limo's People

Contributors

agilecreativity avatar benjicluff avatar corey avatar ehyoon avatar hlolli avatar jeffh avatar sheelc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

limo's Issues

scroll-to behavior in Firefox

Hi @jeffh and Mayvenn crew!

I'm evaluating limo for a project and have run into a problem with scroll-to in Firefox. We have a position: fixed header. In Firefox, limo's scroll-to uses scrollIntoView(). The default for scrollIntoView is to scroll so "the top of the element will be aligned to the top of the visible area of the scrollable ancestor". With the fixed header, this puts the scrolled element under the header, where it isn't clickable.

scrollIntoView accepts options to control how it scrolls. In my case, scrollIntoView(false), or equivalently scrollIntoView({block: "end", inline: "nearest"}) keeps the scrolled element on screen, because it tries to align the bottom of the element with the bottom of its ancestor. block: "center" also works, though block: "nearest" doesn't.

So, what do you think the best way to handle this would be? I can imagine scenarios where you'd need any one of the scroll behaviors. So maybe scroll-to should be configurable. One tricky part is that click and a few other helpers use scroll-to, so you'd have to be able to pass the configuration through those helpers. And of course in Safari, Chrome and other browsers, limo uses the non-standard scrollIntoViewIfNeeded, which doesn't support as many options as scrollIntoView.

Some possibilities:

  • Change the default to {block: "end", inline: "nearest"}. This seems to be what gecko uses internally for testing. However, in other scenarios people suggest scrollIntoView(true), which is equivalent to {block: "start", inline: "nearest"}. So, I worry that neither will work for everyone in all scenarios.
  • Add dynamic vars, to override the scroll behavior with a binding or alter-var-root.
  • Put scroll-to in a protocol, and use reify to extend a driver with specific scrolling behavior.
  • Hope that eventually webdriver specifies a primitive that will support scrolling an element into view on all browsers. In the meantime, my project would have to re-write scroll-to and everything that uses it.

I'm not really pleased with any of these. Do you have other ideas? If we settle on something, I'd be happy to submit a pull request.

Cheers!

click doesn't pass driver through to wait-until-clickable

When click calls wait-until-clickable it doesn't pass the driver argument, so if you don't have a default *driver* it fails with a NullPointerException.

(defn click
  ([selector-or-element] (click *driver* selector-or-element))
  ([driver selector-or-element]
   (scroll-to driver selector-or-element)
   (wait-until-clickable selector-or-element)
   (wait-for ["click" selector-or-element]
             (.click (element driver selector-or-element))
             true)))

click fails on google maps button

Using version 0.2.0, trying to click on the zoom (+) button on a google map,

This works:

(let [zoom (limo/element driver {:xpath "//*[contains(@title,'Zoom in')]"})]
    (.click zoom)))

This does not:

(let [zoom (limo/element driver {:xpath "//*[contains(@title,'Zoom in')]"})]
    (limo.api/click driver zoom)))

The problem seems to have something to do with trying to scroll to the button:

1. Unhandled java.lang.NullPointerException
   (No message)

        Preconditions.java:  787  com.google.common.base.Preconditions/checkNotNull
           FluentWait.java:   96  org.openqa.selenium.support.ui.FluentWait/<init>
        WebDriverWait.java:   72  org.openqa.selenium.support.ui.WebDriverWait/<init>
        WebDriverWait.java:   60  org.openqa.selenium.support.ui.WebDriverWait/<init>
                   api.clj:  116  limo.api/wait-until
                   api.clj:  103  limo.api/wait-until
                   api.clj:  106  limo.api/wait-until
                   api.clj:  103  limo.api/wait-until
                   api.clj:  104  limo.api/wait-until
                   api.clj:  103  limo.api/wait-until
                   api.clj:  250  limo.api/scroll-to
                   api.clj:  247  limo.api/scroll-to
                   api.clj:  267  limo.api/click
                   api.clj:  264  limo.api/click
                   api.clj:  265  limo.api/click
                   api.clj:  264  limo.api/click
                bogeys.clj:   48  com.lemondronor.bogeys/dump1090-screenshot
                bogeys.clj:   31  com.lemondronor.bogeys/dump1090-screenshot
                      REPL:  236  user/eval24080
                      REPL:  236  user/eval24080
             Compiler.java: 6927  clojure.lang.Compiler/eval
             Compiler.java: 6890  clojure.lang.Compiler/eval
                  core.clj: 3105  clojure.core/eval
                  core.clj: 3101  clojure.core/eval
                  main.clj:  240  clojure.main/repl/read-eval-print/fn
                  main.clj:  240  clojure.main/repl/read-eval-print
                  main.clj:  258  clojure.main/repl/fn
                  main.clj:  258  clojure.main/repl
                  main.clj:  174  clojure.main/repl
               RestFn.java:  137  clojure.lang.RestFn/applyTo
                  core.clj:  646  clojure.core/apply
                  core.clj:  641  clojure.core/apply
                regrow.clj:   18  refactor-nrepl.ns.slam.hound.regrow/wrap-clojure-repl/fn
               RestFn.java: 1523  clojure.lang.RestFn/invoke
    interruptible_eval.clj:   87  clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn
                  AFn.java:  152  clojure.lang.AFn/applyToHelper
                  AFn.java:  144  clojure.lang.AFn/applyTo
                  core.clj:  646  clojure.core/apply
                  core.clj: 1881  clojure.core/with-bindings*
                  core.clj: 1881  clojure.core/with-bindings*
               RestFn.java:  425  clojure.lang.RestFn/invoke
    interruptible_eval.clj:   85  clojure.tools.nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:   55  clojure.tools.nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:  222  clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
    interruptible_eval.clj:  190  clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn
                  AFn.java:   22  clojure.lang.AFn/run
   ThreadPoolExecutor.java: 1142  java.util.concurrent.ThreadPoolExecutor/runWorker
   ThreadPoolExecutor.java:  617  java.util.concurrent.ThreadPoolExecutor$Worker/run
               Thread.java:  745  java.lang.Thread/run

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.