Context-menu actions on Dojo Charts - dojo

I'd like to implement a context menu over some of plot elements in a Dojo Chart. Unfortunately, out of the box Dojo Chart supports only three events: "click", "mouseover", and "mouseout". I am not sure whether it is a limitation of dojox.gfx module or the dojox.charing. I can handle a right click event on the container DOM node and then work my way down the chart, but that does not feel the right Dojo way.
Is there an "action" or a patch to support right-click events on the Dojo Charts?

If you use d3 for charting, you can use Dojo widget to add context menu to your d3 chart elements. and it will work fine.

Related

Add a elliptical/hamburger menu inside cytoscape node using Cytoscape.js

Is it possible to add a menu inside a node of a graph using cytoscape.js library? I am looking to add a hamburger button or elliptical button and when you click on it, it opens a menu and then you have actions on each item inside the menu.
Is it possible right now using cytoscape.js. If yes, can you please show me a demo with code of how it is working? I am currently using Angular.
Here is a stackblitz link: https://stackblitz.com/edit/cytoscape-call-method-child-zbayfs?file=src%2Fapp%2Fapp.component.ts

Karate-Robot: How to scroll through a datagrid element?

I have been using the Karate framework Robot component for desktop UI automation. With it, I need to click on a button in each row item of a data grid and using click() doesn't work when the item is not in view/is offscreen. As such I'm trying to figure out how to scroll down to the items I need so I can click the button. I noticed with the driver there is an option to scroll() but I haven't been able to find one with Robot.
Is there a workaround for this or are there plans to add a scroll() function for karate-robot in the future?
Scroll certainly sounds like it may be missing from the existing API. Please do consider investigating and contributing to the code, which will just make it faster to release.
Meanwhile here are the possible workarounds:
see if using the TAB key auto-scrolls to the element
if you get a reference to the button you can call invoke() on it which is supported by a range of windows components
P.S. please do consider contributing code, the code base is actually quite simple. And here is where you can implement the Scroll pattern: link.

How to use Firebug CSS on dynamically appearing components?

I am working on a Javascript Based site, which uses the Dojo Framework.
I am using a DataPicker. I wish to change the background color of the datePicker, and hence I wish to look at where in the CSS is the color being set, so that I can override it in my CSS.
Usually I use FireBug and 'Inspect Element in FireBug' to view the HTML and CSS together. (or even Google Chrome's developer tools)
However this datepicker is a dynamically created component, and If I right click, or move my mouse into the Firebug window, the date picker is shutdown/destroyed. (You can check out the sample on the linked page itself)
Is there a way to inspect the CSS on these kinds of dynamic elements, using Firebug, or something else?
The best approach I've found for the dijit popup widgets is (using chrome)
Open the popup (in this case the date picker)
Right click on the element
Select "Inspect Element" from context menu
Chrome will open and transfer focus to the developer tools without blurring the focus of the page, keeping the popup open, allowing you to modify attributes and css rules and getting instant feedback.

Selenium via Eclipse: is it possible to move the cursor position?

I am using the selenium plug in for eclipse to automate the testing of newly created websites. I am trying to click a button that is in a menu and only visible when the cursor is located over the menu.
Is it possible to move the cursor so that this button can be clicked ?
It will depend a little on how the menu has been implemented (i.e. the event that will trigger your button to appear) but you should look at the focus and mouseOver methods for selenium.
I.e. do something like
this.selenium.mouseOver(element);
where element refers to the menu and then do a click on the button. If mouseOver does not work (i.e. the button does not become available) try focus instead.
It's unclear if you're using Selenium RC or Selenium 2 and WebDriver.
I can only speak to the latter, but you can use Actions to move the mouse and click. The basic idea is you define an object that is a series of actions, and then you perform those actions.
An introduction on how to use these is at http://code.google.com/p/selenium/wiki/AdvancedUserInteractions, and a good writeup with Python examples is http://www.theautomatedtester.co.uk/blog/2011/selenium-advanced-user-interactions.html
It sounds like in your case, you would have something like:
Actions menuClick = new Actions(driver);
builder.MoveToElement(menuElement)
.MoveToElement(buttonElement)
.click(buttonElement)
Action menuClick = builder.build();
menuClick.perform();

dojo drag and drop and key handlers

I have a dojo.dnd.Source container with multiple dnd items. I'd like to give the user the option to select one of the dnd items in the source and then use their backwards/forwards keys to navigate to other items in the source. I've tried setting onkeyup/onkeydown handlers on the dnd items, but they don't seem to fire. I've also tried setting key handlers on the dnd source container, but no luck there either.
Any ideas on whether this is possible - if so, on what dom node should I attach my keyup/keydown listeners?
Thanks
Sean
PS - using dojo 1.3 in an Adobe AIR application.
In general key events are not position-specific like mouse events, and they target a focused node, like a radio button, or a text box. I suspect you don't have form nodes there. You can always try to emulate it yourself, but Dojo DnD doesn't support it out of the box.