Codeceptjs: rename waituntilexists method

Created on 27 Dec 2017  路  3Comments  路  Source: codeceptjs/CodeceptJS

_note: This is just an idea, the issue can be closed if you don't feel is relevant because I know is a pain to change an already existing API._

I think that the method waitUntilExist naming is confusing:
https://github.com/Codeception/CodeceptJS/blob/c2a1388546a0d10ca01a9becb2df4054073e0e19/docs/helpers/Puppeteer.md#waituntilexists

I would rename it to something like waitWhileExists

Details

  • CodeceptJS version: 1.1
  • NodeJS Version: 8.9.1

Most helpful comment

The new release v1.1.5 has refactored these functions in an attempt to remove the confusion.

waitForDetached was chosen to replace the functionality that was previously erroneously provided by waitUntilExists. waitForDetached waits until the DOM element is detached/removed from the DOM.

Here is the exert from the corresponding release notes.

[WebDriverIO][Protractor][Puppeteer][Nightmare] waitUntilExists deprecated in favor of waitForElement
[WebDriverIO][Protractor] waitForStalenessOf deprecated in favor of waitForDetached
[WebDriverIO][Protractor][Puppeteer][Nightmare] waitForDetached added

All 3 comments

I think it makes sense if we change it because it is confusing as it has the opposite affect of its stated name.

Though I see that the PR in December had its name changed during the PR review, so I'm guessing there was some reason for it.

In terms of changing it, at least the function was only introduce in 1.1.0, so changing it now, would not be just a big deal IMO.

I'm happy to do the PR, though I want to gather some thoughts before blindly submitting.

@DavertMik

Yes this function is really confusing. I suggest the name

waitUntilNotExists

The new release v1.1.5 has refactored these functions in an attempt to remove the confusion.

waitForDetached was chosen to replace the functionality that was previously erroneously provided by waitUntilExists. waitForDetached waits until the DOM element is detached/removed from the DOM.

Here is the exert from the corresponding release notes.

[WebDriverIO][Protractor][Puppeteer][Nightmare] waitUntilExists deprecated in favor of waitForElement
[WebDriverIO][Protractor] waitForStalenessOf deprecated in favor of waitForDetached
[WebDriverIO][Protractor][Puppeteer][Nightmare] waitForDetached added
Was this page helpful?
0 / 5 - 0 ratings

Related issues

DavertMik picture DavertMik  路  3Comments

jenschude picture jenschude  路  4Comments

DenisChulkov picture DenisChulkov  路  4Comments

himanshuqdabra picture himanshuqdabra  路  3Comments

lets-open-source picture lets-open-source  路  4Comments