[ml-tests] make login test more stable

GitOrigin-RevId: 9521106ddfb16f67b2b312f9d343327ccd1e4353
This commit is contained in:
Roman.Ivanitskii
2024-03-14 00:48:51 +01:00
committed by intellij-monorepo-bot
parent f900e0625a
commit 281b7dafbe
3 changed files with 28 additions and 1 deletions

View File

@@ -1005,4 +1005,8 @@ fun <T : CommandChain> T.repeatCommand(times: Int, commandChain: (CommandChain)
fun <T : CommandChain> T.createScratchFile(filename: String, content: String): T = apply {
val modifiedContent = content.replace("\n", "\\n").replace(" ", "_")
addCommand("${CMD_PREFIX}createScratchFile $filename $modifiedContent")
}
fun <T : CommandChain> T.disableKotlinNotification(): T = apply {
addCommand("${CMD_PREFIX}disableKotlinNotification")
}

View File

@@ -109,7 +109,8 @@ public final class BaseCommandProvider implements CommandProvider {
Map.entry(WaitForEDTQueueUnstuckCommand.PREFIX, WaitForEDTQueueUnstuckCommand::new),
Map.entry(CreateScratchFile.PREFIX, CreateScratchFile::new),
Map.entry(StoreHighlightingResultsCommand.PREFIX, StoreHighlightingResultsCommand::new),
Map.entry(AddContentRootToModule.PREFIX, AddContentRootToModule::new)
Map.entry(AddContentRootToModule.PREFIX, AddContentRootToModule::new),
Map.entry(DisableKotlinNotificationCommand.PREFIX, DisableKotlinNotificationCommand::new)
);
}
}

View File

@@ -0,0 +1,22 @@
package com.jetbrains.performancePlugin.commands
import com.intellij.ide.util.PropertiesComponent
import com.intellij.openapi.ui.playback.PlaybackContext
private const val NOTIFICATION_PROPERTIES_KEY = "kotlin.code.style.migration.dialog.show.count"
class DisableKotlinNotificationCommand(text: String, line: Int) : PerformanceCommandCoroutineAdapter(text, line) {
companion object {
const val NAME: String = "disableKotlinNotification"
const val PREFIX: String = CMD_PREFIX + NAME
}
override suspend fun doExecute(context: PlaybackContext) {
PropertiesComponent.getInstance().setValue(NOTIFICATION_PROPERTIES_KEY, Integer.MAX_VALUE, 0)
}
override fun getName(): String {
return NAME
}
}