question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Simulate clicks and other events

See original GitHub issue

How does one test a click on a directive in a jasmine unit test?

It seems that angularjs in their own ng- directive specs use browserTrigger which is defined in angular-scenario. However including the karma scenario plugin breaks the jasmine matchers.

How to do this??

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
georgiosdcommented, Oct 13, 2013

jQuery.click() works fine after all. So I don’t think you need anything else - am I missing something?

0reactions
ricardomlourencocommented, Mar 21, 2017

Have you tried use Selenium? There is a plugin for karma I guess: https://www.npmjs.com/package/karma-selenium-webdriver-launcher

I’ve never used with Karma however I used it with .net and it worked pretty good.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to simulate a click with JavaScript? - Stack Overflow
we gonna have to create MouseEvent using document.createEvent() . Then using initMouseEvent() , we've to set up the mouse event that is going...
Read more >
How to simulate a click with JavaScript ? - GeeksforGeeks
Method 1: Using the click() method: The click() method is used to simulate a mouse click on an element. It fires the click...
Read more >
HTMLElement.click() - Web APIs | MDN
The HTMLElement.click() method simulates a mouse click on an element. When click() is used with supported elements (such as an <input> ) ...
Read more >
How to Simulate a Click With JavaScript? - Linux Hint
Approach 1: Simulate a Click With JavaScript Using the onclick Event. An “onclick” event occurs when the button is pressed. This approach can...
Read more >
How to Simulate a Mouse Click Using JavaScript
We can trigger a mouse click event by using the MouseEvent constructor. ... We can simulate a mouse click with JavaScript by creating...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found