diff --git a/test/org.jkiss.dbeaver.ext.test/src/org/jkiss/dbeaver/ext/test/swtbot/SWTbotTest.java b/test/org.jkiss.dbeaver.ext.test/src/org/jkiss/dbeaver/ext/test/swtbot/SWTbotTest.java index 7675dfb5a87b8ceefcb48833f1b3212154fa3f75..d5b9fe764fc5a55e16d5c1f05ad6fddac3bd5c3f 100644 --- a/test/org.jkiss.dbeaver.ext.test/src/org/jkiss/dbeaver/ext/test/swtbot/SWTbotTest.java +++ b/test/org.jkiss.dbeaver.ext.test/src/org/jkiss/dbeaver/ext/test/swtbot/SWTbotTest.java @@ -4,9 +4,15 @@ package org.jkiss.dbeaver.ext.test.swtbot; import static org.junit.Assert.assertTrue; import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; +import org.eclipse.swtbot.swt.finder.finders.ContextMenuHelper; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; +import org.eclipse.swt.widgets.TreeItem; +import org.eclipse.swt.widgets.TableItem; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.swt.widgets.TreeColumn; public class SWTbotTest { private static SWTWorkbenchBot bot; @@ -20,13 +26,37 @@ public class SWTbotTest { bot.resetWorkbench(); } + //For the script to work correctly, only the "DBeaver Sample Database (SQLite)" database must be connected in dbeaver before it is executed" @Test - public void testSampleMenu() { + public void testSampleMenu() throws Exception { + assertTrue(true); + + bot.toolbarDropDownButtonWithTooltip("Новое соединение").menuItem("PostgreSQL").click(); + bot.tabItem("Общее").activate(); + bot.button("Finish").click(); bot.toolbarDropDownButtonWithTooltip("Новое соединение").menuItem("MariaDB").click(); bot.tabItem("Общее").activate(); bot.button("Finish").click(); - - assertTrue(true); + bot.tree().getTreeItem("MariaDB - localhost").select(); + bot.tree().contextMenu("Удалить").click(); + bot.button("Yes").click(); + bot.tree().getTreeItem("DBeaver Sample Database (SQLite)").expand(); + Thread.currentThread().sleep(3000); + bot.tree().getTreeItem("DBeaver Sample Database (SQLite)").getNode("Таблицы").select(); + bot.tree().getTreeItem("DBeaver Sample Database (SQLite)").getNode("Таблицы").doubleClick(); + bot.tree().getTreeItem("DBeaver Sample Database (SQLite)").getNode("Таблицы").expand(); + Thread.currentThread().sleep(3000); + bot.tree().getTreeItem("DBeaver Sample Database (SQLite)").getNode("Таблицы").getNode("Album").select(); + Thread.currentThread().sleep(3000); + bot.tree().getTreeItem("DBeaver Sample Database (SQLite)").getNode("Таблицы").getNode("Album").expand(); + Thread.currentThread().sleep(3000); + bot.tree().getTreeItem("DBeaver Sample Database (SQLite)").getNode("Таблицы").getNode("Album").getNode("Колонки").expand(); + Thread.currentThread().sleep(3000); + bot.tree().getTreeItem("DBeaver Sample Database (SQLite)").getNode("Таблицы").getNode("Album").getNode("Колонки").getNode("Column1 (BLOB)").select(); + bot.tree().getTreeItem("DBeaver Sample Database (SQLite)").getNode("Таблицы").getNode("Album").getNode("Колонки").getNode("Column1 (BLOB)").doubleClick(); + Thread.currentThread().sleep(3000); + bot.editorByTitle("Column1").show(); + } }