mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[gui-test] tests for plugins. add regexp for path
This commit is contained in:
@@ -149,7 +149,7 @@ open class GuiTestCase {
|
||||
*/
|
||||
fun chooseFileInFileChooser(path: String, timeout: Long = defaultTimeout) {
|
||||
val macNativeFileChooser = SystemInfo.isMac() && (System.getProperty("ide.mac.file.chooser.native", "true").toLowerCase() == "true")
|
||||
if (macNativeFileChooser) {
|
||||
if (!macNativeFileChooser) {
|
||||
MacFileChooserDialogFixture(robot()).selectByPath(path)
|
||||
}
|
||||
else {
|
||||
@@ -170,6 +170,7 @@ open class GuiTestCase {
|
||||
}
|
||||
val dialogFixture = JDialogFixture(robot(), fileChooserDialog)
|
||||
with(dialogFixture) {
|
||||
asyncProcessIcon().waitUntilStop(20)
|
||||
textfield("")
|
||||
invokeAction("\$SelectAll")
|
||||
typeText(path)
|
||||
|
||||
+19
-8
@@ -25,6 +25,7 @@ import com.intellij.testGuiFramework.launcher.system.SystemInfo
|
||||
import com.intellij.testGuiFramework.remote.transport.MessageType
|
||||
import com.intellij.testGuiFramework.remote.transport.TransportMessage
|
||||
import org.fest.swing.exception.WaitTimedOutError
|
||||
import java.io.File
|
||||
import javax.swing.JDialog
|
||||
|
||||
open class PluginTestCase : GuiTestCase() {
|
||||
@@ -34,6 +35,23 @@ open class PluginTestCase : GuiTestCase() {
|
||||
private val WIN_PLUGIN_HOME = "/Users/jetbrains/Documents/plugins/"
|
||||
private val LINUX_PLUGIN_HOME = "/Users/jetbrains/Documents/plugins/"
|
||||
|
||||
private fun getPluginHomePath(): String {
|
||||
return when {
|
||||
SystemInfo.isMac() -> MAC_PLUGIN_HOME
|
||||
SystemInfo.isWin() -> WIN_PLUGIN_HOME
|
||||
else -> {
|
||||
LINUX_PLUGIN_HOME
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun findPlugin(pluginName: String): String {
|
||||
val f = File(getPluginHomePath())
|
||||
return f.listFiles { _, name ->
|
||||
name.startsWith(pluginName)
|
||||
}[0].toString()
|
||||
}
|
||||
|
||||
fun installPluginAndRestart(installPluginsFunction: () -> Unit) {
|
||||
val PLUGINS_INSTALLED = "PLUGINS_INSTALLED"
|
||||
if (guiTestRule.getTestName() == GuiTestOptions.getResumeTestName() &&
|
||||
@@ -69,14 +87,7 @@ open class PluginTestCase : GuiTestCase() {
|
||||
}
|
||||
}
|
||||
|
||||
fun installPluginFromDisk(pluginDir: String, pluginName: String) {
|
||||
var pluginPath: String = when {
|
||||
SystemInfo.isMac() -> MAC_PLUGIN_HOME
|
||||
SystemInfo.isWin() -> WIN_PLUGIN_HOME
|
||||
else -> {
|
||||
LINUX_PLUGIN_HOME
|
||||
}
|
||||
} + pluginDir
|
||||
fun installPluginFromDisk(pluginPath: String, pluginName: String) {
|
||||
welcomeFrame {
|
||||
actionLink("Configure").click()
|
||||
popupClick("Plugins")
|
||||
|
||||
Reference in New Issue
Block a user