-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
prop-array.test.js
37 lines (32 loc) · 1.2 KB
/
prop-array.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const Main = require("./pageObjects/Main")
const multiComboBoxSelector = {
forceSelect: true,
selector: {
interaction: "root",
id: "multiComboBox",
viewName: "test.Sample.view.Main"
}
}
describe("ui5 property array test", () => {
before(async () => {
await Main.open()
})
it("should get empty array", async () => {
const oMultiComboBox = await browser.asControl(multiComboBoxSelector)
const aSelectedKeys = await oMultiComboBox.getSelectedKeys()
expect(aSelectedKeys.length).toEqual(0)
})
it("select two countries from list", async () => {
const oMultiComboBox = await browser.asControl(multiComboBoxSelector)
await oMultiComboBox.setSelectedKeys(["IN", "BR"])
const aSelectedKeys = await oMultiComboBox.getSelectedKeys()
expect(aSelectedKeys.length).toEqual(2)
})
it("get text from items list", async () => {
const oMultiComboBox = await browser.asControl(multiComboBoxSelector)
await oMultiComboBox.open()
const items = await oMultiComboBox.getItems()
const firstItemText = await items[2].getTitle()
expect(firstItemText).toEqual("Australia")
})
})