You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expect that results of this commands will be similar. But in case DOM changing while test running, results will be different.
I have create simple example in which results of two above commands isn't similar. I test page on which change elements count after 1.5s after page initialising. Builtin find command has expected behaviour, it retries command for a few seconds and test successfully finished. But in case custom findByCypressId don't retry elements find so test failing. Below I'm leaving Vue single file component example and cypress test, also link to simple project example.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
In case custom commands with previously yielded subject (
prevSubject: true
) should be usedcy.wrap()
function.But two similars commands at the first glance in some case will give different results. For example:
and
Where
findByCypressId
is defined:I expect that results of this commands will be similar. But in case DOM changing while test running, results will be different.
I have create simple example in which results of two above commands isn't similar. I test page on which change elements count after 1.5s after page initialising. Builtin
find
command has expected behaviour, it retries command for a few seconds and test successfully finished. But in case customfindByCypressId
don't retry elements find so test failing. Below I'm leaving Vue single file component example and cypress test, also link to simple project example.Page tests:
For testing please clone and run tests in public project: https://github.com/ValeronAI/cypress-test.
Beta Was this translation helpful? Give feedback.
All reactions