-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathweek3.test.js
37 lines (32 loc) · 1.07 KB
/
week3.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 { wdi5 } = require("wdio-ui5-service")
const Detail = require("./pageObjects/Detail")
describe("week3: detail page", () => {
before(async () => {
await Detail.open()
})
it("should have the right title", async () => {
const title = await browser.getTitle()
expect(title).toEqual("ui5-challenge")
})
it("should have button to navigate back", async () => {
const navButton = await browser.asControl({
selector: {
id: /.*navButton$/,
viewName: Detail._viewName
}
})
expect(await navButton.getVisible()).toBeTruthy()
})
it("should have button that opens dialog", async () => {
const dialogButton = await browser.asControl({
selector: {
id: "dialogButton",
viewName: Detail._viewName
}
})
await dialogButton.firePress()
//it's also possible to use WebdriverIO selectors
const dialog = await $("#myDialog")
expect(dialog.error).toBeFalsy()
})
})