Codeceptjs: How to wait for a specific attribute value to be ___

Created on 19 Nov 2017  路  2Comments  路  Source: codeceptjs/CodeceptJS

Hello,
Is there any possibility in CodeceptJS wherein we could wait, maybe through waitForText() or wait() for an element attribute such as "placeholder" to have some sort of value.

==========
Example:

I have a combobox with the following HTML when the page was first loaded:
<input type="text" placeholder="Loading..." value="" id="namelist_combobox" name="">

after x seconds (data was successfully loaded from DB), the placeholder attribute is changed to:
<input type="text" placeholder="What do you want to search for" value="" id="namelist_combobox" name="">

==========
Is it possible to do:
I.waitForValue('//*[@id="namelist_combobox"][placeholder]','What do you want to search for', 5);
or
I.waitForAttributeValue('#namelist_combobox', 'What do you want to search for', 5);

Thanks in advance.

question

Most helpful comment

Try the waitForVisible via the selector "input[placeholder='What do you want to search for']" as below:
I.waitForVisible("input[placeholder='What do you want to search for']",30);
==> It the dynamic wait until possible to see that placeholder='What do you want to search for'] in input element, if ok it'll do next action code ...

All 2 comments

Try the waitForVisible via the selector "input[placeholder='What do you want to search for']" as below:
I.waitForVisible("input[placeholder='What do you want to search for']",30);
==> It the dynamic wait until possible to see that placeholder='What do you want to search for'] in input element, if ok it'll do next action code ...

Closing issue due to inactivity after a suggested solution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

medtoure18 picture medtoure18  路  14Comments

philipstanislaus picture philipstanislaus  路  10Comments

willhowlett picture willhowlett  路  9Comments

ericelliott picture ericelliott  路  13Comments

raquelgs picture raquelgs  路  30Comments