mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[gui-test] Check WEbStorm plugins id IDEA ultimate tests
This commit is contained in:
+1
-1
@@ -193,7 +193,7 @@ class JUnitServerImpl : JUnitServer {
|
||||
LOG.info("Server Receive Thread started")
|
||||
while (connection.isConnected) {
|
||||
val obj = objectInputStream.readObject()
|
||||
LOG.info("Receiving message: $obj")
|
||||
LOG.debug("Receiving message: $obj")
|
||||
assert(obj is TransportMessage)
|
||||
val message = obj as TransportMessage
|
||||
receivingMessages.put(message)
|
||||
|
||||
+34
-6
@@ -21,6 +21,7 @@ import com.intellij.testGuiFramework.impl.GuiTestThread
|
||||
import com.intellij.testGuiFramework.impl.GuiTestUtilKt
|
||||
import com.intellij.testGuiFramework.impl.GuiTestUtilKt.waitProgressDialogUntilGone
|
||||
import com.intellij.testGuiFramework.launcher.GuiTestOptions
|
||||
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
|
||||
@@ -28,6 +29,11 @@ import javax.swing.JDialog
|
||||
|
||||
open class PluginTestCase : GuiTestCase() {
|
||||
|
||||
|
||||
private val MAC_PLUGIN_HOME = "/Users/jetbrains/Documents/plugins/"
|
||||
private val WIN_PLUGIN_HOME = "/Users/jetbrains/Documents/plugins/"
|
||||
private val LINUX_PLUGIN_HOME = "/Users/jetbrains/Documents/plugins/"
|
||||
|
||||
fun installPluginAndRestart(installPluginsFunction: () -> Unit) {
|
||||
val PLUGINS_INSTALLED = "PLUGINS_INSTALLED"
|
||||
if (guiTestRule.getTestName() == GuiTestOptions.getResumeTestName() &&
|
||||
@@ -63,15 +69,37 @@ open class PluginTestCase : GuiTestCase() {
|
||||
}
|
||||
}
|
||||
|
||||
fun installPluginFromDisk(pluginPath: String) {
|
||||
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
|
||||
welcomeFrame {
|
||||
actionLink("Configure").click()
|
||||
popupClick("Plugins")
|
||||
dialog("Plugins") {
|
||||
button("Install plugin from disk...").click()
|
||||
chooseFileInFileChooser(pluginPath)
|
||||
button("OK").click()
|
||||
ensureButtonOkHasPressed(this@PluginTestCase)
|
||||
//Check if plugin has already been installed
|
||||
try {
|
||||
table(pluginName, timeout = 1L).cell(pluginName).click()
|
||||
button("OK").click()
|
||||
ensureButtonOkHasPressed(this@PluginTestCase)
|
||||
}
|
||||
catch (e: Exception) {
|
||||
button("Install plugin from disk...").click()
|
||||
chooseFileInFileChooser(pluginPath)
|
||||
button("OK").click()
|
||||
ensureButtonOkHasPressed(this@PluginTestCase)
|
||||
}
|
||||
}
|
||||
try {
|
||||
message("IDE and Plugin Updates", timeout = 5L) {
|
||||
button("Shutdown").click()
|
||||
}
|
||||
}
|
||||
catch (e: Exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,7 +110,7 @@ open class PluginTestCase : GuiTestCase() {
|
||||
GuiTestUtilKt.waitUntilGone(robot = guiTestCase.robot(),
|
||||
timeoutInSeconds = 2,
|
||||
matcher = GuiTestUtilKt.typeMatcher(
|
||||
JDialog::class.java) { it.isShowing && it.title == dialogTitle })
|
||||
JDialog::class.java) { it.isShowing && it.title == dialogTitle })
|
||||
}
|
||||
catch (timeoutError: WaitTimedOutError) {
|
||||
with(guiTestCase) {
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ class PluginInstallTest : PluginTestCase() {
|
||||
|
||||
@Test
|
||||
fun testPluginByPath() {
|
||||
installPluginAndRestart { installPluginFromDisk("/Users/jetbrains/Downloads/Dart-172.4155.35.zip") }
|
||||
installPluginAndRestart { installPluginFromDisk("/Users/jetbrains/Downloads/Dart-172.4155.35.zip", "Dart") }
|
||||
checkPluginsFunctionality("Dart")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user