element(by.control({
// <matcher properties>
});
element.all(by.control({
// <matcher properties>
});
id: "id"
viewName: "myViewName"
controlType: "UI5 control type" // e.g. "sap.m.ObjectHeader"
bindingPath: {path: "myPath", propertyPath: "myPropertyPath", modelName: "myModelName"}
i18NText: {propertyName: "text", key: "buttonText"}
labelFor: {key: "labelText", modelName: "i18n"}
labelFor: {text: "myText"}
properties: {text: "My Header Text"}
aggregationContainsPropertyEqual: {aggregationName: "myAggregation", propertyName: "enabled", propertyValue: true}
aggregationLengthEquals: {name: "myAggregation", length: 1}
aggregationEmpty: {name: "myAggregation"}
aggregationFilled: {name: "myAggregation"},
ancestor: {id: /^foo/, properties: {text: "My Ancestor Text"}},
descendant: {id: /^bar/, properties: {text: "My Descendant Text"}}
Also you can chain locators: element(by.control({})).element(by.control({}))… or element(by.control({})).all(by.control({}))
const multiComboBoxElement= element(by.control({
controlType: "sap.m.MultiComboBox",
id: "multiComboBoxId" , // you can use regular expression here e.g. /ComboBoxId$/
interaction: {idSuffix: "arrow"} // it’s important! Without this property you’ll likely have issues with interactions with sap.m.MultiComboBox.
}));
const multiComboBoxElement = element(by.control({
controlType: "sap.m.MultiComboBox",
properties: {enabled: true},
interaction: {idSuffix: "arrow"}, // it’s important! Without this property you’ll likely have issues with interactions with sap.m.MultiComboBox.
ancestor: {
controlType: "sap.m.HBox",
descendant: {
controlType: "sap.m.Label",
properties: {text: "LabelText"}
}
}
}));
const selectElement = element(by.control({
controlType: "sap.m.Select",
id: "selectId",
interaction: {idSuffix: "arrow"} // it’s important! Without this property you’ll likely have issues with interactions with sap.m.Select.
}));
const configureParametersSwitch = newLandscapePage.element(by.control({
controlType: "sap.m.Switch",
ancestor: {
controlType: "sap.m.Toolbar",
descendant: {
controlType: "sap.m.Label",
properties: {text: "LabelText"}
}
}
}));
const archiveUploadInput = element(by.control({
controlType: "sap.ui.unified.FileUploader"
}));
const absolutePath = path.resolve(__dirname, 'test.txt'); // here you should configure full path to the file
archiveUploadInput.sendKeys(absolutePath);
const filterItem = element(by.control({
controlType: "sap.ui.unified.MenuTextFieldItem",
interaction: {idSuffix: "tf"} // it’s important! Without this property you’ll likely have issues with interactions with sap.ui.unified.MenuTextFieldItem.
}));
const fromDatePicker = element(by.control({
controlType: "sap.m.DateTimePicker",
interaction: {idSuffix: "inner"} // it isn’t important.
}));
const dateTimePicker = element(by.control({
controlType: "sap.m.DateTimePicker",
interaction: {idSuffix: "inner"},
bindingPath: {
modelName: "vm",
propertyPath: "/alertsRangeDateFilter/endDate"
}
}));
const changeVersionDialog = element(by.control({
controlType: "sap.m.Dialog",
bindingPath: {
modelName: "appView",
propertyPath: "/bPhoneSize"
}
}));
const versionStandardTreeItems = changeVersionDialog.all(by.control({
controlType: "sap.m.StandardTreeItem",
id: /-versionList-/
}));
versionStandardTreeItems.then(standardTreeItems => {
// here we have array of objects
standardTreeItems.forEach(standardTreeItem => {
// here we work with each object in array and get its property
standardTreeItem.asControl().getProperty("title").then(version => {
if (version === "1.89.0") {
standardTreeItem.click()
}
})
})
});
element(by.jq(<jquery selector>);
element.all(by.jq(<jquery selector>);
const expandNodeIcons = element.all(by.jq('span[id*="-treeicon"][title="Expand Node"]'));
const objectRow = element(by.jq(`tr[id*="${tableId}-rows"]:has('td:contains("${objectColumnValue}")')`));
const rows = element.all(by.jq('tr[id*="idCttObjectsTable"][title="Click to Select"]'))
const selectAll = element(by.jq(`div[id*="-selall"]`))
element(by.css(<css selector>))
browser.driver.wait(function () {
return browser.driver.findElements(by.css('.sapMITHTextContent'))
.then(function (elements) {
return !!elements.length;
});
}, browser.getPageTimeout, 'Waiting for page reload to finish')
// we need to load UI5 dependencies (go to https://github.com/SAP/ui5-uiveri5/blob/master/docs/usage/browser.md for more details)
.then(() => browser.loadUI5Dependencies())
.then(() => …)
element(by.id(<id>))
const changeVersionButton = element(by.id("sdk---app--changeVersionButton"));
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
4 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 |