Closed cwang1221 closed 2 years ago
interesting observation. AFAIK, we don't have a testcase for invisible elements yet.
is your input
actually in the DOM, hidden by css? or not rendered yet? can you provide more code-context as to what control etc pp
please?
Thank you @vobu !
We just used the standard UI5 function myInput.setVisible(false)
to hide it. This means:
Since WDI5's selector is very similar to OPA5's, I also tried visible: false
, which means "I want to locate the control no matter if it's visible or not" in OPA5. But it didn't work.
The test scenario is, I want to assert the input is successfully hidden with myInput.setVisible(false)
. I know this should be done with OPA5 test. But I just want to see if WDI5 can achieve it.
Thank you!
thanks for providing the details!
I got curious and validated your use case
→ result: doesn't work, meaning wdi5
currently doesn't support the visible: false
property of sap.ui.test.Opa5#waitFor
😒
But I've added this as a feature request 😸: #106
FWIW, you can still locate the DOM equivalent of the (unrendered) UI5 control by utilizing wdio
's native feature (that wdi5
is built on):
UI5 control:
<!-- sap.m namespace -->
<Input id="visibleInputField"
value="bla"
visible="false" />
const id = 'visibleInputField';
// wdio-native selector
const wdioInput = browser.$(`[id$="${id}"]`); // ID ends with "visibleInputField"
expect(wdioInput.getProperty('id')).toContain('sap-ui-invisible');
Thank you @vobu ! It's really great to see improvements in wdi5!
Hi Experts,
I'm new to WDI5, I was trying to assert a UI5 control is not visible on UI, but it didn't work.
It seems that I can only assert visible controls, but not invisible ones?
Thank you and best regards.