-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(matcher): i18n, ancestor, descendant, sibling, labelFor
* feat(devtools): add DEBUG flag with auto open dev tools * feat(#129): i18n text matcher * revert: auto-open-dev-tools * feat(128): add test for descendant matcher * refactor: matcher test to a separate file * feat(matchers): add new matcher types * feat(matcher): ancestor and labelFor * fix(matcher): ancestor * fix(matcher): interactable * feat(matcher): prep for matcher with constructor * fix(matcher): update siblings matcher and test with todo * fix: rm double ancestor * fix: createMatcher * fix: matcher test * fix: rm siblings matcher * feat(combobox): two matcher examples for combobox #121 * docs: github issue * feat(test): separated wdio and wdi5 test * fix(wdio): rm test for wdio id selector * fix: revert searchfield test * fix(searchfield): rm searchfield Co-authored-by: dominik.feininger <[email protected]> Co-authored-by: Simon Coen <[email protected]>
- Loading branch information
1 parent
6c92004
commit 1fd328c
Showing
8 changed files
with
262 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
const Main = require("./pageObjects/Main") | ||
|
||
describe("ui5 matcher tests", () => { | ||
before(async () => { | ||
await Main.open() | ||
}) | ||
|
||
it("check i18nText Button matcher", async () => { | ||
const i18nSelector = { | ||
selector: { | ||
i18NText: { | ||
propertyName: "text", | ||
key: "startPage.navButton.text" | ||
}, | ||
controlType: "sap.m.Button", | ||
viewName: "test.Sample.view.Main" | ||
} | ||
} | ||
|
||
const button = await browser.asControl(i18nSelector) | ||
const buttonText = await button.getText() | ||
expect(buttonText).toEqual("to Other view") | ||
}) | ||
|
||
it("check i18nText matcher user button", async () => { | ||
const i18nSelector = { | ||
selector: { | ||
i18NText: { | ||
propertyName: "text", | ||
key: "startPage.userButton.text" | ||
}, | ||
controlType: "sap.m.Button", | ||
viewName: "test.Sample.view.Main" | ||
} | ||
} | ||
|
||
const button = await browser.asControl(i18nSelector) | ||
const buttonText = await button.getText() | ||
expect(buttonText).toEqual("User Test Text") | ||
}) | ||
|
||
it("check descendant matcher for panel", async () => { | ||
const descendantSelector = { | ||
selector: { | ||
controlType: "sap.m.Panel", | ||
descendant: { | ||
viewName: "test.Sample.view.Main", | ||
controlType: "sap.m.Title", | ||
properties: { | ||
text: "Custom Toolbar with a header text" | ||
} | ||
} | ||
} | ||
} | ||
|
||
const panel = await browser.asControl(descendantSelector) | ||
|
||
const sPanelText = await panel.getHeaderText() | ||
expect(sPanelText).toEqual("Header Text") | ||
|
||
const bPanelExpandable = await panel.getExpandable() | ||
expect(bPanelExpandable).toEqual(true) | ||
}) | ||
|
||
it("check labelFor matcher ", async () => { | ||
const labelForSelector = { | ||
selector: { | ||
controlType: "sap.m.DateTimePicker", | ||
labelFor: { | ||
text: "labelFor DateTimePicker" | ||
} | ||
} | ||
} | ||
|
||
const datePicker = await browser.asControl(labelForSelector) | ||
|
||
const sDatePickerPlaceholder = await datePicker.getPlaceholder() | ||
expect(sDatePickerPlaceholder).toEqual("Enter Date ...") | ||
}) | ||
|
||
it("check anchestor matcher", async () => { | ||
const ancestorSelector = { | ||
selector: { | ||
controlType: "sap.m.Title", | ||
ancestor: { | ||
viewName: "test.Sample.view.Main", | ||
controlType: "sap.m.Panel" | ||
} | ||
} | ||
} | ||
|
||
const title = await browser.asControl(ancestorSelector) | ||
|
||
const sTitleText = await title.getText() | ||
expect(sTitleText).toEqual("Custom Toolbar with a header text") | ||
}) | ||
|
||
it("check siblings matcher first Occurance", async () => { | ||
const siblingsSelector = { | ||
selector: { | ||
controlType: "sap.m.Button", | ||
sibling: { | ||
viewName: "test.Sample.view.Main", | ||
controlType: "sap.m.Button", | ||
properties: { | ||
text: "open Barcodescanner" | ||
} | ||
} | ||
} | ||
} | ||
|
||
const button = await browser.asControl(siblingsSelector) | ||
|
||
const sButtonText = await button.getText() | ||
expect(sButtonText).toEqual("to Other view") | ||
}) | ||
|
||
// TODO: ciblings matacher with options parameter | ||
it.skip("check siblings matcher next Occurance", async () => { | ||
const siblingsSelector = { | ||
selector: { | ||
controlType: "sap.m.Button", | ||
sibling: { | ||
viewName: "test.Sample.view.Main", | ||
controlType: "sap.m.Button", | ||
properties: { | ||
text: "open Barcodescanner" | ||
}, | ||
options: { | ||
next: true | ||
} | ||
} | ||
} | ||
} | ||
|
||
const button = await browser.asControl(siblingsSelector) | ||
|
||
const sButtonText = await button.getText() | ||
expect(sButtonText).toEqual("open Dialog") | ||
}) | ||
|
||
it("check interactable matcher", async () => { | ||
const interactableSelector = { | ||
selector: { | ||
controlType: "sap.m.Button", | ||
interactable: true, | ||
visible: true | ||
} | ||
} | ||
|
||
const button = await browser.asControl(interactableSelector) | ||
|
||
const sButtonStatus = await button.getEnabled() | ||
expect(sButtonStatus).toBeTruthy() | ||
}) | ||
|
||
// #131 | ||
/* it("check for Searchfield Properties", async () => { | ||
const searchFieldSelector = { | ||
selector: { | ||
// id: "idSearchfield", | ||
viewName: "test.Sample.view.Main", | ||
interactable: true, | ||
visible: true, | ||
controlType: "sap.m.SearchField" | ||
} | ||
} | ||
expect(await browser.asControl(searchFieldSelector).getValue()).toEqual("search Value") | ||
}) */ | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.