Xceptance / neodymium-library

A test automation library based on common other best practice open source libraries. It adds missing functionalities but does not reinvent the wheel. Just glues stuff together nicely and adds some sprinkles.
MIT License
80 stars 11 forks source link

#148 Added optionalWaitUntilCondition and optionalWaitWhileCondition #191

Closed georgkunze closed 3 years ago

georgkunze commented 3 years ago

148 Added optionalWaitUntilCondition and optionalWaitWhileCondition function.

oomelianchuk commented 3 years ago

I just thought it might be more convenient for the user if we let them enter a full waiting time instead of a polling interval. What do you think?

occupant23 commented 3 years ago

I just thought it might be more convenient for the user if we let them enter a full waiting time instead of a polling interval. What do you think?

@oomelianchuk and @georgkunze I haven't spotted this yet. I just tested the formal side of the code until now. But this sounds very intriguing. @georgkunze Please adjust the logic accordingly. The polling time can be computed out of the total waiting time and the number of retries.

occupant23 commented 3 years ago

@georg final decision maxWaitingTime and pollingInterval you can implement a function similar to JavaScriptUtils.until

oomelianchuk commented 3 years ago

I think the changes are great now. The only thing I personally would like to change is the type of maxWaitingTime and pollingInterval. Selenide mostly requires waiting time in type long, so it would be more convenient to be able to pass the same type to the optional wait methods. WDYT?

georgkunze commented 3 years ago

I think the changes work. There is nothing to add from my side.

occupant23 commented 3 years ago

I think the changes are great now. The only thing I personally would like to change is the type of maxWaitingTime and pollingInterval. Selenide mostly requires waiting time in type long, so it would be more convenient to be able to pass the same type to the optional wait methods. WDYT?

@oomelianchuk Good point I adjusted this. Additionally, I will set up a separate issue to refacture the other timings.