How to get a customUIItem in TestStackwhite where control type is ControlType.Pane - white-framework

I have a windows application in which few buttons are shown as pane in UISPY.
AutomationElement
General Accessibility
AccessKey: ""
AcceleratorKey: ""
IsKeyboardFocusable: "True"
LabeledBy: "(null)"
HelpText: ""
State
IsEnabled: "True"
HasKeyboardFocus: "False"
Identification
ClassName: "WindowsForms10.Window.8.app.0.33c0d9d"
ControlType: "ControlType.Pane"
Culture: "(null)"
AutomationId: "2624504"
LocalizedControlType: "pane"
Name: "SAVE"
ProcessId: "6892 (OATDT.ATA.SP.Home)"
RuntimeId: "42 2624504"
IsPassword: "False"
IsControlElement: "True"
IsContentElement: "True"
Visibility
BoundingRectangle: "(-31471, -31598, 104, 23)"
ClickablePoint: "(null)"
IsOffscreen: "True"
ControlPatterns
How to get that pane and click that? Can any one please help

I think you can try something like this
var pane = window.Get(SearchCriteria.ByAutomationId("2624504"));
pane.Click();
This worked for me for the same

Basically Panes are controls that do not expose automation patterns or have a specific automation type.
You can still get the bounds and such and click on the control, but White cannot give you a nice high level abstraction for Panes like it does for other controls

Related

2sxc How to debug a query

I have created a view for a "details" page, and have set up a visual query to get the required item from a query string variable.
Testing the query works, and a single item is returned in the test:
{
"Default": [
{
"Title": "The Person",
"JobTitle": "CEO",
"Organization": "The Company",
etc (exactly what is expected)
}
]
}
This is piped to the Default input of the 2sxc Target, and running the test shows that 1 item is sent to the Target.
Now, when I actually execute the module, what I get is "No demo item exists for the selected template." which indicates that the data is not actually getting to the module.
I have selected the query as the data source for the view.
How to debug this?
You're running into a different problem: your view has a content-type defined, but no demo-item. In this scenario, it shows the message you see. So either say "no content-type" or give it a demo-item. Then the template is run.

Hard refresh needed to display data in Umbraco.DateTime control

I have a custom section in Umbraco, when you click a node in my custom tree, the URL is correctly displayed and the data loads successfully.
When you then click another node in the tree (sibling, exactly the same controller and view)
All the data loads...... except for the data that should shown in the calender control. If I reload the page the data loads.
For testing, I created and added an extra control but this time it is just a Umbraco.Textbox, and the data always loads correctly
So what is it about the Umbraco.DateTime all the other controls I have on the same page load drop downs, check boxes etc
Is there something I can do in my Angular(v1.6) controller to force these to update everytime?
Update: Code in my view looks like this.
<umb-property property="vm.endDateTimeTxt">
<umb-editor model="vm.endDateTimeTxt"></umb-editor>
</umb-property>
<umb-property property="vm.startDateTimePropertyEditor">
<umb-editor model="vm.startDateTimePropertyEditor"></umb-editor>
</umb-property>
<umb-property property="vm.endDateTimePropertyEditor">
<umb-editor model="vm.endDateTimePropertyEditor"></umb-editor>
</umb-property>
And For the Umbraco.DatePicker controls this is the method that genrates the property editor
function buildUmbracoClockPropertyEditor(alias, editor, view, label, description, config, mandatory = true) {
return {
editor: "Umbraco.DateTime",
label: label,
description: description,
hideLabel: false,
view: view,
alias: alias,
value: null,
validation: {
mandatory: mandatory,
pattern: ""
},
config: {
pickDate: true,
pickTime: false,
useSeconds: false,
format: "YYYY-MM-DD HH:MM:SS",
icons: {
time: "icon-time",
date: "icon-calendar",
up: "icon-chevron-up",
down: "icon-chevron-down"
}
},
}
I have also updated the format of the string when it is loaded in to the text box so now this is before a hard refresh.
And this is after
So as you can see the data is there, it gets loaded in to the text box first time you click on a node, but required me to go to my browser address bar and press enter to get the dates to load in to the Umbraco.DateTime controls.
this is just nuts! the data is there, the format is the same... what else could it be!
The reason is that Umbraco is loading all javascript on load and we need to force it to load again.
I have tried to recycle AppPool, restart website, touch web.config etc. its not easy to reload it.

ExtJS 4 - MessageBox Prompt change input field type to password

Good day. I am creating a web application which displays a Message Box from time to time. I have a message box that asks the user for a password and I want that field type to be password. So far I've tried several things but none of them seem to work, they still show the text as plain text and not as dots or asterisks.
Here's my code:
var mb = Ext.MessageBox.prompt({
title: 'Enter Override Password.',
msg: 'Please Enter the Override Password to Reprint:',
password: true, //this does not work
width: 300,
height: 125,
multiline: 1,
inputType: 'password', //this does not work
value: '',
buttons: Ext.MessageBox.YESNO,
fn: myCallback,
cls: 'msgbox',
baseCls: 'msgbox',
icon: Ext.MessageBox.WARNING
});
mb.textField.inputType = 'password'; //this does not work
Does anyone know how to specify the input field as password type? It seems that ExtJS 4.2 does not support it. Thanks in advance.
Here's what I tried and it's worked thus far. The only problem I have now is styling and that's for another question.
var myMsgBox = new Ext.window.MessageBox({
cls: 'msgbox',
bodyCls: 'popWindow'
});
myMsgBox.textField.inputType = 'password';
myMsgBox.textField.width = 240;
myMsgBox.textField.center();
myMsgBox.prompt(title, msg, myCallback);
I believe that goes a little bit beyond the scope of what the Ext.MessageBox was designed for. In looking at the source code the only things that passed into the input are the value, and height if the multiline is set.
What you could do instead, is to create your own component that extends Ext.Window and sets modal to true. This allows you to customize the window as you see fit.
Instead of Ext.MessageBox.prompt try with creating a custom window that extends Ext.Window, pop up when clicked on the button and sets modal to true and align to center.

Does the Gmail REST API have access to label colors?

Is it possible to get label colors through the new Gmail REST API? Many of our users color code their emails and it would be great to be able to carry that color coding over to our applications.
It doesn't as per the docs a label consists of:
{
"id": string,
"name": string,
"messageListVisibility": string,
"labelListVisibility": string,
"type": string
}
see: https://developers.google.com/gmail/api/v1/reference/users/labels
That does seem like a useful enhancement though.
python below
def MakeLabel(label_name, mlv='show', llv='labelShow'):
"""Create Label object.
Args:
label_name: The name of the Label.
mlv: Message list visibility, show/hide.
llv: Label list visibility, labelShow/labelHide.
Returns:
Created Label.
"""
bg_red_color = {'backgroundColor': '#cc3a21', 'textColor': '#000000'}
label = {
'color': bg_red_color,
'messageListVisibility': mlv,
'name': label_name,
'labelListVisibility': llv}
return label
I you need more colors go here https://developers.google.com/gmail/api/v1/reference/users/labels/create

How to set a position to Ext.Msg.show in sencha

How can I set a different position for Ext.Msg.show in senchatouch. I have tried using the methods
msg.getDialog().getPositionEl().setTop(50);
&
msg.getDialog().setPosition(undefined,50)
However I am getting a error Object [object Object] has no method 'getPositionEl' or Object [object Object] has no method 'getDialog'.
I have even checked these methods in my MessageBox.js file in sencha but they do not exist.
However almost solution on the net seems to recommend these methods.Experts could you kindly advise.
You can place messagebox to certain position by specifying left and top config options.
launch: function() {
var msg = Ext.Msg.show({
title:'Some title',
message:'Sample message container.',
left:50, // mention initial positioning with left and top config.
top:50,
buttons:[{ //create as many buttons you want.
text:'Ok',
ui:'action',
handler:function(btn){
if(msg.getTop() == 200) // Just for demo. Click Ok and place msg box to some other position. If clicked again, hide message box
msg.hide();
else{
msg.setTop(200);
msg.setLeft(200);
}
}
}]
});
}
Other than config options, you can align message box with setTop() and setLeft() methods as well.
See Demo. As you can see, message box is not placed at center as it's default position is center but instead it is placed with top and left set to 50.

Resources