Git Product home page Git Product logo

simulator's People

Contributors

bumbu avatar jtangelder avatar viviangledhill 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  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

simulator's Issues

Example for using the Simulator

For unit-testing parts of our web application I want to simulate touch events. Could you provide some examples for this? (I am using the HammerJS jQuery plugin and the Jasmine framework).

Add support for mouse gestures/events

I have been trying to use this in webdriverio tests. When running driving an instance of chrome, hammer doesn't detect touch support, so listens for mouse events instead. The simulator can only emit touch/pointer events, meaning this cannot be used for tests as it stands.

Event does not fire for target scale value when simulating pinching

When I use Simulator.gestures.pinch, I expect a pinch event to eventually fire with the scale I specify as an option. So, in the following test case:

package.json:

{
  "dependencies": {
    "hammer-simulator": "0.0.1",
    "hammerjs": "2.0.8"
  }
}

index.html:

<body>
  <div class="test-element"></div>
  <script src="node_modules/hammerjs/hammer.js"></script>
  <script src="node_modules/hammer-simulator/index.js"></script>
  <script src="test.js"></script>
</body>

test.js:

(function () {

    'use strict';

    var element = document.querySelector('.test-element');

    var hammertime = new Hammer(element);
    hammertime.get('pinch').set({enable: true});

    hammertime.on('pinch', function (event) {
        console.log('event.scale', event.scale);
    });

    Simulator.gestures.pinch(element, {
        scale: 2.0
    });

}());

I expect that an event.scale of 2 will eventually be logged. However, the final value to be printed is only 1.9230769230769231. Is this expected or is it a bug?

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.