mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
[driver] Add KDoc about correct usage of waitForProjectOpen and waitForIndicators
GitOrigin-RevId: fefc7acea0ac7b62f029120710d2c734f8781d58
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b66ffeeffd
commit
8a627f258e
@@ -20,20 +20,37 @@ fun Driver.areIndicatorsVisible(project: Project): Boolean {
|
||||
return getProgressIndicators(project).isNotEmpty()
|
||||
}
|
||||
|
||||
/**
|
||||
* !!!ATTENTION!!!
|
||||
*
|
||||
* The only guarantee you have after this method is that reference to Project won't be null.
|
||||
* The UI, Project View, services and everything else might not be yet initialized.
|
||||
* Use [waitForIndicators] instead if you're not 100% sure otherwise you might get flaky test.
|
||||
* Also, you can avoid calling this method before [waitForIndicators] since it also waits for open project.
|
||||
*/
|
||||
fun Driver.waitForProjectOpen(timeout: Duration = 1.minutes) {
|
||||
waitFor("Project is opened", timeout) {
|
||||
isProjectOpened()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method waits till project is opened and there are no indicators for 10 seconds.
|
||||
*/
|
||||
fun Driver.waitForIndicators(project: Project, timeout: Duration) {
|
||||
waitForIndicators({ project }, timeout)
|
||||
}
|
||||
|
||||
/**
|
||||
* Method waits till project is opened and there are no indicators for 10 seconds.
|
||||
*/
|
||||
fun Driver.waitForIndicators(timeout: Duration) {
|
||||
waitForIndicators(::singleProject, timeout)
|
||||
}
|
||||
|
||||
/**
|
||||
* Method waits till project is opened and there are no indicators for 10 seconds.
|
||||
*/
|
||||
private fun Driver.waitForIndicators(projectGet: () -> Project, timeout: Duration) {
|
||||
var smartLongEnoughStart: Instant? = null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user