提交 cf0f5786 编写于 作者: S Serge Rider 提交者: GitHub

Merge pull request #7483 from riednyko/swtbot_test

Added class SWTbotTest

Former-commit-id: 86c3f6dd
......@@ -8,7 +8,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.jkiss.dbeaver.core,
org.jkiss.dbeaver.model,
org.eclipse.core.resources
org.eclipse.core.resources,
org.eclipse.swtbot.eclipse.finder,
org.junit
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Vendor: JKISS
......
package org.jkiss.dbeaver.ext.test.swtbot;
import static org.junit.Assert.assertTrue;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
public class SWTbotTest {
private static SWTWorkbenchBot bot;
@BeforeClass
public static void initBot() {
bot = new SWTWorkbenchBot();
}
@AfterClass
public static void afterClass() {
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() 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();
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();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册