KIF test failing - view is not enabled for interaction - xcode

Trying to run a KIF test. I want to tap the button with accessibility label "LOG IN" but it times out with the message "view is not enabled for interaction".
[tester tapViewWithAccessibilityLabel:#"SIGN IN"];
The button is there, and it has this text in its label. How do I "enable" this UI element?

FOR KIF: Another way to tell information for user interaction on views is to turn on the Accessibility Inspector within the iOS simulator. This will let you click on views and see if they're actually clickable/or blocked by other views inadvertently. It will also show you if the view has an accessibility label, trait (button, label, static text), and/or frame. Useful for checking your user interaction - ie. if it's static text or a button etc.
TO TURN ON ACCESSIBILITY INSPECTOR: Run your app, open the simulator--->click on the home button---->go to settings--->general--->accessibility--->toggle the accessibility inspector to ON--->run your app again or click on HOME button again, then click on your app.

You get this error message if isUserInteractionActuallyEnabled of a view yields NO. For example have a look at the definition of tapAccessibilityElement:inView: in KIFUITestActor.m. The method isUserInteractionActuallyEnabled is implemented in UIView-KIFAdditions.m and basically checks the property isUserInteractionEnabled of a view and does some more elaborate checks if you tap a button in a navigation bar or an action sheet.

You should try to set accessibilityLabel in Xcode's interface builder under the identity inspector at the user defined runtime attributes (with the key path set to "accessibilityLabel", type set to "String" and value set to "SIGN IN".
There are other ways to set accessibilityLabel like from code you can say:
[_buttonName setValue:#"SIGN IN" forKey:#"accessibilityLabel"];
I hope this one helped.

Related

Xamarin master detail page with static header and context menu

I need to do a master detail layout page in Xamarin which then will be used in child pages.
Please check the screenshot below:
I need to have a header part with button for notifications and a button for context menu plus a header.
What is the best approach how I can create this layout in Xamarin?
I will assume that you want to use Xamarin.Forms, instead of using Xamarin.Android and Xamarin.iOS separately.
One approach would be to use default MasterDetailPage as described here or even better to try it with Shell as described here.
Then, you would need to create your CustomNavigationPage and write a custom renderer for it.
Second approach would be to do some tricks, again creating your CustomNavigationPage with template(so that the navigation bar is always displayed) and that you change content dynamically.
Also, you would need to hide default navigation bar and attach click events to your menu button to really open up the menu.
Hope you got it clearly.
MasterDetailPage already provides nearly all functionality that you have asked for, so in some way your question isn't quite clear as you already mention MasterDetailPage. The only remaining problem I can see is how to set up a custom header, and that is than with NavigationPage.TitleView.

Polymer <polymer-element name="core-spa" extends="core-scaffold"> Wish List Item

I am working on creating a SPA (Single Page Application) in Polymer that is based on the Core Scaffold. What is missing is URL Routing that keeps the current view and some data in a pretty URL that can be shared and gives the user a clear preview of the page based on the URL.
The best Router I have found is https://github.com/erikringsmuth/app-router
The main navigation will be the current "Hamburger" menu (with submenus) at the top left which changes the content of the main area and a "More or Settings" menu at the top right which pops up modal dialog boxes with things like login, settings, preferences etc.
A fast splash page followed by "Lazy Loading" is also required.
And a "Full Screen" button that hides all the clutter and give the mobile use maximum workspace.
Gluing this all together the "Polymer Way" is still confusing. Any suggestions would be appreciated.

MFC form designer

According to my understanding if I need design MFC form with button I have only one possibility - write everything in code editor. There is no designer. Except cases when I need design dialog form. I can use designer and generate resources for dialogs. But in case normal Frame there is possibility to drop buttons in designer window. Is that truth?
If you want to use a form as a main window, create your project with a CFormView as a base class. You can select that inside the new project wizard. Then you get a dialog resource for that view. It works just like a dialog.
Go to Resource view
Create a new dialog template
Double click the dialog template name
Once the dialog opens, the toolbox get enabled
You can drag&drop the controls to the form now

firefox addons panel hide

My addon opens a popup panel (popup.html).
When the user changes the current tab to different tab, the popup panel is hidden
When the tab is selected second time I need it to still available contentURL (popup.html) but I did find the way to do it.
You can create your panel like this:
<panel
id="yourPanel"
type="arrow"
noautohide="true"
level="parent">
</panel>
Explanation:
level = "parent" means the panel is shown just above the window the panel is in, but behind other windows above it.
noautohide = "true" means the panel will only be closed when the hidePopup method is called.
With these two combined, you get the behavior you're looking for.
For reference see mdn panel page

How to enable toolbaritems in NSToolbar?

I have created an application in which I have implemented a custom toolbar, and I have put a custom item in that toolbar. But I am unable to click on it; it shows
that it's disabled. How to solve this problem?
If toolbar buttons are disabled by default and you haven't implemented NSToolbarItemValidation, it's usually because you have forgotten to connect the buttons to IBActions, or you have but you haven't implemented the actions.
Implement the NSToolbarItemValidation protocol in your NSToolbar's delegate, and return NO for every NSToolbarItem that you want disabled (return YES to enable it).
i had similar issue, and got resolved by subclassing NSToolbarItem and override validate Method in it.
NSToolbarItem are disabled by default if you do not implement the corresponding action on the target. Be sure to have a corresponding method for the action on the target instance.
In the Storyboard, select the tool bar item.
In the Utilities panel in the right side select Attributes inspector.
Turn off the Autovalidates option for Behaviour.

Resources