-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combobox: multiple fixes. #674
Changes from 1 commit
b4e53a5
b0199b3
ff26def
23c5824
80e6270
3f36ca1
50a0edf
95a0fb2
4d46111
49fabb6
1ff8cb7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -403,7 +403,127 @@ define([ | |
valueNodeValueAtLatestInputEvent: "China,Germany", | ||
widgetValueAtLatestChangeEvent: ["China", "Germany"], | ||
valueNodeValueAtLatestChangeEvent: "China,Germany" | ||
}, "after clicking again the root node (close)"); | ||
}, "after clicking on the 'Ok' button (close)"); | ||
}) | ||
.end(); | ||
}; | ||
|
||
var checkMultiSelectionCancel = function (remote, comboId) { | ||
var executeExpr = "return getComboState(\"" + comboId + "\");"; | ||
return loadFile(remote, "./ComboPopup.html") | ||
.findById(comboId) | ||
.execute(executeExpr) | ||
.then(function (comboState) { | ||
// The first option should be the one selected, | ||
// the popup is closed initially | ||
checkComboState(comboId, comboState, | ||
{ // expected combo state | ||
inputNodeValue: comboState.multipleChoiceNoSelectionMsg, | ||
popupInputNodeValue: "", // invisible! | ||
widgetValue: [], | ||
valueNodeValue: "", | ||
opened: false, | ||
selectedItemsCount: 0, | ||
itemRenderersCount: 37, | ||
inputEventCounter: 0, // no event so far | ||
changeEventCounter: 0, | ||
widgetValueAtLatestInputEvent: undefined, // never received | ||
valueNodeValueAtLatestInputEvent: undefined, | ||
widgetValueAtLatestChangeEvent: undefined, | ||
valueNodeValueAtLatestChangeEvent: undefined | ||
}, "right after load"); | ||
}) | ||
.click() | ||
.sleep(500) // wait for List's loading panel to go away | ||
.execute(executeExpr) | ||
.then(function (comboState) { | ||
// The first option should be the one selected, | ||
// the first click just opens the dropdown. | ||
checkComboState(comboId, comboState, | ||
{ // expected combo state | ||
inputNodeValue: comboState.multipleChoiceNoSelectionMsg, | ||
popupInputNodeValue: "", // invisible | ||
widgetValue: [], | ||
valueNodeValue: "", | ||
opened: true, | ||
selectedItemsCount: 0, | ||
itemRenderersCount: 37, | ||
inputEventCounter: 0, // no event so far | ||
changeEventCounter: 0, | ||
widgetValueAtLatestInputEvent: undefined, // never received | ||
valueNodeValueAtLatestInputEvent: undefined, | ||
widgetValueAtLatestChangeEvent: undefined, | ||
valueNodeValueAtLatestChangeEvent: undefined | ||
}, "after click on root node"); | ||
}) | ||
.end() | ||
.findById(comboId + "_item1") // "Germany" | ||
.click() | ||
.sleep(500) // wait for popup to close | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment seems wrong, the ComboPopup doesn't close until you click the OK or cancel buttons. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, now I see that You could make There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. About your first comment: yes, it was a copy-paste mistake. |
||
.execute(executeExpr) | ||
.then(function (comboState) { | ||
checkComboState(comboId, comboState, | ||
{ // expected combo state | ||
inputNodeValue: "Germany", | ||
popupInputNodeValue: "", // invisible | ||
widgetValue: ["Germany"], | ||
valueNodeValue: "Germany", | ||
opened: true, | ||
selectedItemsCount: 1, | ||
itemRenderersCount: 37, | ||
inputEventCounter: 1, | ||
changeEventCounter: 0, | ||
widgetValueAtLatestInputEvent: ["Germany"], | ||
valueNodeValueAtLatestInputEvent: "Germany", | ||
widgetValueAtLatestChangeEvent: undefined, | ||
valueNodeValueAtLatestChangeEvent: undefined | ||
}, "after clicking option (Germany))"); | ||
}) | ||
.end() | ||
.findById(comboId + "_item6") // "China" | ||
.click() | ||
.sleep(500) // wait for popup to close | ||
.execute(executeExpr) | ||
.then(function (comboState) { | ||
checkComboState(comboId, comboState, | ||
{ // expected combo state | ||
inputNodeValue: string.substitute(comboState.multipleChoiceMsg, {items: 2}), | ||
popupInputNodeValue: "", // invisible | ||
widgetValue: ["China", "Germany"], | ||
valueNodeValue: "China,Germany", | ||
opened: true, | ||
selectedItemsCount: 2, | ||
itemRenderersCount: 37, | ||
inputEventCounter: 1, | ||
changeEventCounter: 0, | ||
widgetValueAtLatestInputEvent: ["China", "Germany"], | ||
valueNodeValueAtLatestInputEvent: "China,Germany", | ||
widgetValueAtLatestChangeEvent: undefined, | ||
valueNodeValueAtLatestChangeEvent: undefined | ||
}, "after clicking option (China))"); | ||
}) | ||
.end() | ||
.findByCssSelector(".d-combo-cancel-button") | ||
.click() | ||
.sleep(500) // wait for the async closing of the popup | ||
.execute(executeExpr) | ||
.then(function (comboState) { | ||
checkComboState(comboId, comboState, | ||
{ // expected combo state | ||
inputNodeValue: comboState.multipleChoiceNoSelectionMsg, | ||
popupInputNodeValue: "", // invisible | ||
widgetValue: [], | ||
valueNodeValue: "", | ||
opened: false, | ||
selectedItemsCount: 0, | ||
itemRenderersCount: 37, | ||
inputEventCounter: 1, | ||
changeEventCounter: 1, // incremented | ||
widgetValueAtLatestInputEvent: [], | ||
valueNodeValueAtLatestInputEvent: "", | ||
widgetValueAtLatestChangeEvent: [], | ||
valueNodeValueAtLatestChangeEvent: "" | ||
}, "after clicking on the 'Cancel' button (close)"); | ||
}) | ||
.end(); | ||
}; | ||
|
@@ -570,6 +690,21 @@ define([ | |
return checkMultiSelection(remote, "combo3"); | ||
}, | ||
|
||
"multi selection selection (combo3)": function () { | ||
var remote = this.remote; | ||
|
||
if (remote.environmentType.browserName === "internet explorer") { | ||
// https://github.com/theintern/leadfoot/issues/17 | ||
return this.skip("click() doesn't generate mousedown/mouseup, so popup won't open"); | ||
} | ||
if (remote.environmentType.platformName === "iOS") { | ||
// https://github.com/theintern/leadfoot/issues/61 | ||
return this.skip("click() doesn't generate touchstart/touchend, so popup won't open"); | ||
} | ||
|
||
return checkMultiSelectionCancel(remote, "combo3"); | ||
}, | ||
|
||
"tab navigation (combo3)": function () { | ||
var remote = this.remote; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this code call _validateMultiple() even for single-selection Comboboxes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but I don't understand what you are referring to.
cancelHandler
function runs only when user press "Cancel" button, which is visible only ifselectionMode=multiple
.In
selectionMode=single
we don't have any button shown.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh OK I didn't realize that.