Skip to content

Commit

Permalink
fix: pass interaction matcher in press function
Browse files Browse the repository at this point in the history
  • Loading branch information
Siolto committed May 13, 2024
1 parent d404b4a commit 0080ce1
Show file tree
Hide file tree
Showing 4 changed files with 409 additions and 6,745 deletions.
45 changes: 45 additions & 0 deletions examples/ui5-js-app/webapp/test/e2e/press.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,49 @@ describe("custom wdi5 press event", async () => {
const popup = await browser.asControl(dialogSelector)
await expect(await popup.getVisible()).toBeTruthy()
})

it("press() with 'idSuffix'", async () => {
const dateTime = browser.asControl({
selector: {
id: "idDateTime",
viewName: "test.Sample.view.Main"
}
})

await dateTime.setValue("2024-05-01-12-00-00")
await browser
.asControl({
selector: {
id: "container-Sample---Main--idDateTime-icon"
}
})
.press()

await browser
.asControl({
selector: {
id: "container-Sample---Main--idDateTime-cal--Month0",
searchOpenDialogs: true,
interaction: {
idSuffix: "20240511"
}
}
})
.press()

await browser
.asControl({
selector: {
id: "container-Sample---Main--idDateTime-OK",
searchOpenDialogs: true,
interaction: {
idSuffix: "BDI-content"
}
}
})
.press()

const value = await dateTime.getValue()
expect(value).toEqual("2024-05-11-12-00-00")
})
})
2 changes: 1 addition & 1 deletion examples/ui5-js-app/webapp/view/Main.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</content>
</Panel>
<Label labelFor="idDateTime" text="labelFor DateTimePicker" />
<DateTimePicker id="idDateTime" placeholder="Enter Date ..." />
<DateTimePicker id="idDateTime" placeholder="Enter Date ..." valueFormat="yyyy-MM-dd-HH-mm-ss" />
<Button text="{testModel>/buttonText}" press="onTest" class="myTestClass" />
<Input value="{testModel>/inputValue}" />
<CheckBox id="idCheckbox" selected="{testModel>/checkbox}" text="test checkbox" select="onSelect" />
Expand Down
Loading

0 comments on commit 0080ce1

Please sign in to comment.