Polymer.Dart's floating label for PaperInput not visible - dart

I have the example code in my Angular.Dart component:
<paper-input bind-value="value" label="MyLabel" floatingLabel></paper-input>
The paper input shows the value that is in my Angular.Dart component, but the floatingLabel does not appear. However, upon clicking the input, the label appears with the standard animation as if it was hidden. It seems as though this is a bug with the "constructor" of the paper-input element. I expected the floating label to appear above the input field when text is in the input field regardless if it was newly created or not. Is there a way to fix this glitch?
Progress: (github.com/Polymer/paper-input/issues/117)
I am looking intensively at the issue listed above, however implementing the fix accordingly is not as easy. As suggested by #GünterZöchbauer, I can use the dart:js library. However it appears that the solution was designed specifically for PolymerJs and not particularly for PolymerDart. Maybe I am overthinking things, but I am unable to perform a simple port.
But the issue does bring up a good point. The element is unable to detect the change (for what ever reason). So something needs to poke it to trigger an update. I currently have the dart context to the Element, however the class (paper-input is the class) does not contain the method inputAction upon inspection with WebStorm. However assuming that the inputAction method was firing an event, I can simply use the dispatchEvent method. However which event will trigger the event without modifying the object itself? And not crashing the browser would be great (I have been crashing the webpage with Chrome's Aw, snap! blue screen of death with some event tests).

Related

How to make the selenium web driver click on a button which is inside react spotlight (React Joyride)?

I've added a controlled tour in my app using ReactJoyride. At a particular step, the tour will progress only when the 'Ongoing' tab/button is clicked (see image).
This 'Ongoing' button is inside the spotlight.
I've tested this manually and it works perfectly. However, while testing this using Selenium, I can't seem to find a way to click on this button.
I'm getting the following error :
It says that react-joyride__overlay will receive the clicks. But react-joyride__spotlight is a child element of react-joyride__overlay and i've enabled spotlightClicks.
The current code that i'm using is this : (test.rb)
the commented lines of code are the other ways that i've tested. All of them failed.
If you can point me in the correct direction, I would really appreciate it!
The problem here is, your desired element is overlay-ed by other element, so this other element is hiding your element. All you have to do is, you have check whether this overlay is permanent or temporary. If it's temporary, you have to write the code to wait until the other element gets disappeared, If it's permanent, then you have to issue the click on top of the other element so that your desired element would receive the click.
Let me assume your overlay is permanent so try this code
find(xpath: "//div[#class='react-joyride__overlay']").click

What jQuery Mobile event is best for

I am developing a jQuery Mobile application that will run into a Cordova wrapper.
I am struggling to understand the use of each pagecontainerX event and when to use which.
I will post three specific use cases:
1) hook click events:
Say I want to assign a handler to a certain click event on a button.
2) change textual content of the page:
Say I have a page and I want to update some content that might have changed since last time I have shown the page.
3) change graphical content of the page:
Like if I want to draw on some canvas, or in cases where I need to know how things are rendered and their size.
Preliminary answers:
these is what I have found myself, but I would really much appreciate comments:
1) I am using the pagecreate event, as it's only called once. It is also possible to specify what specific page you want to hook the handler to by doing: $(document).on("pagecreate", "#pageid", handler);
2) I am using pagecontainerbeforetransition or pagecontainerbeforehide. Pagecontainerbeforehide has the advantage that is only fired once, while the other is fired twice (dunno why). Other options, like pagecontainershow, will change the content after transition, which is a bit weird to look at.
3) In this case I am employing pagecontainershow, so that things have already been graphically rendered and I can compute heights and widths etc., the drawback is that the user will see the transition, and only after he will see the content of the page being modified.

Ranorex v5.0 doesn’t click button sporadical

I have a ranorex project, which automated an use case with clicking 5 buttons in an application.
To set up this project I used the record function. I defined some sleep times between the clicks.
The run with the clicks is in a loop, where the loop count is dynamically defined. One button of the five and always the same button, Ranorex "ignores" sometimes. According to the log file, the button is visible and enabled and ranorex also runs the code with the Click(), but the application doesn’t receive the click. Before in code the click is called, I check with an “If” whether the button is visible and enabled - and if the click() is called (or doesn't), I log it to ranorexlog. Sometimes the application is running through and all the clicks work and sometimes this button click is missing one or more times. It doesn’t depend on the sleep time between the clicks, because I tried long and small pause times. It doesn’t depend on the focus of the application, too, because I switched the focus several times.
Does anybody know this problem, workarounds or what I’m doing wrong?
the obvious workaround is to use Mouse.Click("{Button}") with a 0 duration rather than invoking the click event, or if you are invoking the mouse click invoke the buttons click action. (sorry since they are both named Click() i don't know which one you are using).
As to what is happening, from your description it sounds like your script is finding more than one element with the same xpath. This would cause issues with the click event because it may try to click on the element, but it's the first xpath that matches not the second. Are there any optional elements in this sequence of button clicks that appear? for instance a busy spinner with inner text of "OK" that is hidden from view when you are clicking a button on a form with inner text of "OK" would cause two elements to be found if the xpath was looking for an inner text of ok. This element that is causing may not have been caught in the recorder because it might not have been present at the time.
Another possibility if you are using Mouse.Click() (particularly if this is a website)is that it is possible your button is not actually on the screen, I know that should be taken care of by the visible check but it is visible on the dom even though it is not visible on the screen that causes issues.
I highly recommend do not use the recorder to create test suites that need to be re-runnable. It would actually be better to use the spy tool to create a repository or several repositories for the product you are testing, this way you can be sure the xpaths are all unique, which using the recorder there is no gaurantee. You can actually record with the created repository, and ranorex will attempt to find item in the repository before creating a new item, so the recorder will use this repository when creating recordings.

Programmatically starting a jQuery UI sortable drag ? - Issues with IE8 compatibility

I'm using jQuery UI Sortable behavior and have come upon a situation in which I needed to start the sortable drag behavior from interaction with another element other than the original handle (which is not visible at the time).
I have managed to put together a way to achieve this thanks to suggestions in some posts and the use of jquery.simulate.js (used to run official jQUI tests) and I can procedurally start the sortable drag process in pretty much all browsers except IE8 and below, simulating the events like so:
item.simulate('mousedown',pos).simulate('mousemove',{ clientX: pos.clientX+1, clientY: pos.clientY});
Problem: In IE8 (or below), after the interaction with the outside 'handle' and simulation of mousedown and mousemove events, the drag is indeed correctly started, but as soon as the user really moves his mouse in any way/shape/form, the drag stops or cancels as if the 'mouseup' event had ocurred to finalize it.
I highly think this is due to some fundamental difference in the old fireEvent (IE8-) method vs the dispatchEvent that everything else uses, but cannot quite figure out how to, or if it's possible to prevent it.
What I'm looking for are snippets of what may be done to correct this or suggestions as to why this is happening and if it can have a workaround of some sort to prevent the cancelling (such as is the behavior that occurs in any other browser using dispatchEvent instead of fireEvent).
Have put together a small example for you of the success (any recent browser) or failure of the situation described: demo
TL;DR: Have put together a small way to procedurally start a jQUI sortable drag (through jquery.simulate.js, link above), but it fails to work or cancels itself in IE8-. Need some guidance or suggestions about how to overcome that. Check above demo

Using codemirror in jquery.ui.dialog loses focus onload

i try to use codemirror in a jquery ui dialog.
here you can see the result in jsfiddle.
http://jsfiddle.net/HtntY/
the problem is that the content in codemirror does not appear on first load. it only appears after you set focus on the editor and than type something, after that the preloaded content appears.
can this be fixed somehow. i tried to do it with the refresh() function without success.
thanks for you short time.
Looks like jQuery UI hasn't actually unhid the DIV when the opener runs. Putting a refresh call in a timeout (as in http://jsfiddle.net/NP9SL/ ) seems to do the trick.
I ran into the same problem and wound up running the editor.refresh() off the focus event, FWIW. I thought I'd mention another, somewhat related problem. If you try to take advantage of the CodeMirror dialog/search functionality inside of JQueryUI modal dialog, the integrated search dialog fails to get focus and you can't type into it. Interestingly I can paste text into the search field, but I cant type. Have yet to find a way around this other than setting modal to false.

Resources