SWTBOT TDQ:QAI-10736
update tests of TDQ on 5.1.0.modified the case about ColumnAnlaysisAboutMysqlDbconnectionViewTest ColumnAnlaysisAboutMysqlDbconnectionViewTest ColumnAnlaysisAboutMssqlViewdbconnectionTest ColumnAnlaysisAboutMysqlDbconnectionViewTest git-svn-id: http://talendforge.org/svn/tis_shared/trunk@84792 f6f1c999-d317-4740-80b0-e6d1abc6f99e
This commit is contained in:
@@ -15,8 +15,7 @@ Require-Bundle: org.eclipse.swtbot.go,
|
||||
org.eclipse.draw2d,
|
||||
org.eclipse.gef;bundle-version="3.6.1",
|
||||
org.talend.core;bundle-version="5.1.0",
|
||||
org.talend.designer.core;bundle-version="5.1.0",
|
||||
org.talend.swtbot.commons;bundle-version="5.1.0"
|
||||
org.talend.designer.core;bundle-version="5.1.0"
|
||||
Import-Package: org.eclipse.draw2d
|
||||
Bundle-ClassPath: sample/,
|
||||
.
|
||||
|
||||
@@ -635,12 +635,12 @@ public class TalendSwtbotTdqCommon {
|
||||
break;
|
||||
}
|
||||
bot.button("Apply").click();
|
||||
if(bot.activeShell().getText().equals("Set database")){
|
||||
bot.waitUntil(Conditions.shellIsActive("Set database"));
|
||||
SWTBotShell shell = bot.shell("Set database");
|
||||
bot.button("OK").click();
|
||||
bot.waitUntil(Conditions.shellCloses(shell), 60000);
|
||||
}
|
||||
// if(bot.activeShell().getText().equals("Set database")){
|
||||
// bot.waitUntil(Conditions.shellIsActive("Set database"));
|
||||
// SWTBotShell shell = bot.shell("Set database");
|
||||
// bot.button("OK").click();
|
||||
// bot.waitUntil(Conditions.shellCloses(shell), 60000);
|
||||
// }
|
||||
SWTBotShell shellp;
|
||||
try {
|
||||
shellp = bot.shell("Progress Information");
|
||||
@@ -649,13 +649,14 @@ public class TalendSwtbotTdqCommon {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
if(bot.activeShell().getText().equals("Confirm")){
|
||||
System.out.println(bot.activeShell().getText()+"::::::::::::::::::");
|
||||
bot.waitUntil(Conditions.shellIsActive("Confirm"));
|
||||
SWTBotShell shell2 = bot.shell("Confirm");
|
||||
bot.button("OK").click();
|
||||
bot.waitUntil(Conditions.shellCloses(shell2),60000);
|
||||
}
|
||||
// if(bot.activeShell().getText().equals("Confirm")){
|
||||
// System.out.println(bot.activeShell().getText()+"::::::::::::::::::");
|
||||
// bot.waitUntil(Conditions.shellIsActive("Confirm"));
|
||||
// SWTBotShell shell2 = bot.shell("Confirm");
|
||||
// bot.button("OK").click();
|
||||
// bot.waitUntil(Conditions.shellCloses(shell2),60000);
|
||||
// }
|
||||
System.out.println(bot.activeShell().getText()+"::::::::::::::::::");
|
||||
if(bot.activeShell().getText().equals("Information")){
|
||||
System.out.println(bot.activeShell().getText()+"::::::::::::::::::");
|
||||
bot.waitUntil(Conditions.shellIsActive("Information"));
|
||||
@@ -663,18 +664,27 @@ public class TalendSwtbotTdqCommon {
|
||||
bot.button("OK").click();
|
||||
bot.waitUntil(Conditions.shellCloses(shellc),60000);
|
||||
}
|
||||
if(bot.activeShell().getText().equals("Warning")){
|
||||
bot.waitUntil(Conditions.shellIsActive("Warning"));
|
||||
SWTBotShell shell1 = bot.shell("Warning");
|
||||
// if(bot.activeShell().getText().equals("Warning")){
|
||||
// bot.waitUntil(Conditions.shellIsActive("Warning"));
|
||||
// SWTBotShell shell1 = bot.shell("Warning");
|
||||
// bot.button("OK").click();
|
||||
// bot.waitUntil(Conditions.shellCloses(shell1));
|
||||
// }
|
||||
bot.button("OK").click();
|
||||
bot.waitUntil(Conditions.shellCloses(shell1));
|
||||
}
|
||||
bot.button("OK").click();
|
||||
if(bot.activeShell().getText().equals("Set database")){
|
||||
bot.waitUntil(Conditions.shellIsActive("Set database"));
|
||||
bot.button("OK").click();
|
||||
bot.waitUntil(Conditions.shellCloses(shell),60000);
|
||||
}
|
||||
|
||||
// try {
|
||||
// shellp = bot.shell("Progress Information");
|
||||
// bot.waitUntil(Conditions.shellCloses(shellp), 60000);
|
||||
// } catch (TimeoutException e) {
|
||||
// // TODO Auto-generated catch block
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
// if(bot.activeShell().getText().equals("Set database")){
|
||||
// bot.waitUntil(Conditions.shellIsActive("Set database"));
|
||||
// bot.button("OK").click();
|
||||
// bot.waitUntil(Conditions.shellCloses(shell),60000);
|
||||
// }
|
||||
try {
|
||||
shellp = bot.shell("Progress Information");
|
||||
bot.waitUntil(Conditions.shellCloses(shellp), 60000);
|
||||
@@ -683,12 +693,12 @@ public class TalendSwtbotTdqCommon {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if(bot.activeShell().getText().equals("Confirm")){
|
||||
bot.waitUntil(Conditions.shellIsActive("Confirm"));
|
||||
SWTBotShell shell2 = bot.shell("Confirm");
|
||||
bot.button("OK").click();
|
||||
bot.waitUntil(Conditions.shellCloses(shell2),60000);
|
||||
}
|
||||
// if(bot.activeShell().getText().equals("Confirm")){
|
||||
// bot.waitUntil(Conditions.shellIsActive("Confirm"));
|
||||
// SWTBotShell shell2 = bot.shell("Confirm");
|
||||
// bot.button("OK").click();
|
||||
// bot.waitUntil(Conditions.shellCloses(shell2),60000);
|
||||
// }
|
||||
if(bot.activeShell().getText().equals("Information")){
|
||||
System.out.println(bot.activeShell().getText()+"::::::::::::::::::");
|
||||
bot.waitUntil(Conditions.shellIsActive("Information"));
|
||||
@@ -696,12 +706,12 @@ public class TalendSwtbotTdqCommon {
|
||||
bot.button("OK").click();
|
||||
bot.waitUntil(Conditions.shellCloses(shellc),60000);
|
||||
}
|
||||
if(bot.activeShell().getText().equals("Warning")){
|
||||
SWTBotShell shellc = bot.shell("Warning");
|
||||
bot.waitUntil(Conditions.shellIsActive("Warning"));
|
||||
bot.button("OK").click();
|
||||
bot.waitUntil(Conditions.shellCloses(shellc),60000);
|
||||
}
|
||||
// if(bot.activeShell().getText().equals("Warning")){
|
||||
// SWTBotShell shellc = bot.shell("Warning");
|
||||
// bot.waitUntil(Conditions.shellIsActive("Warning"));
|
||||
// bot.button("OK").click();
|
||||
// bot.waitUntil(Conditions.shellCloses(shellc),60000);
|
||||
// }
|
||||
|
||||
|
||||
// System.out.println(System.getProperty("reportdb.oracle.password")
|
||||
@@ -810,6 +820,7 @@ public class TalendSwtbotTdqCommon {
|
||||
bot.textWithLabel("Where clause").setText(expression);
|
||||
bot.button("Finish").click();
|
||||
System.out.println("aaaaaa");
|
||||
bot.sleep(3000);
|
||||
bot.editorByTitle(lable + " 0.1").close();
|
||||
}
|
||||
public static void deleteAndCleanCycleBin(SWTWorkbenchBot bot,TalendItemTypeEnum type, String label) {
|
||||
@@ -1037,9 +1048,16 @@ public class TalendSwtbotTdqCommon {
|
||||
case MSSQL:
|
||||
columnsNode = tree
|
||||
.expandNode("Metadata", "DB connections",
|
||||
metadata.toString(), structure).getNode(1).expand().getNode(0).expand()
|
||||
metadata.toString(), structure).getNode("dbo").expand().getNode(0).expand()
|
||||
.expandNode(table).getNode(0);
|
||||
columnsItem = columnsNode.expand().getItems();
|
||||
for(int i=0; i<columns.length; i++){
|
||||
for(SWTBotTreeItem item : columnsItem){
|
||||
if(item.getText().contains(columns[i]))
|
||||
columns[i] = item.getText();
|
||||
}
|
||||
}
|
||||
System.out.println("columnsItem");
|
||||
count = Integer.parseInt(columnsNode.getText().substring(
|
||||
columnsNode.getText().indexOf("(") + 1,
|
||||
columnsNode.getText().indexOf(")")));
|
||||
@@ -1089,9 +1107,16 @@ public class TalendSwtbotTdqCommon {
|
||||
case MSSQL:
|
||||
columnsNode = tree
|
||||
.expandNode("Metadata", "DB connections",
|
||||
metadata.toString(), structure).getNode(1).expand().getNode(1).expand()
|
||||
metadata.toString(), structure).getNode("dbo").expand().getNode(1).expand()
|
||||
.expandNode(table).getNode(0);
|
||||
columnsItem = columnsNode.expand().getItems();
|
||||
for(int i=0; i<columns.length; i++){
|
||||
for(SWTBotTreeItem item : columnsItem){
|
||||
if(item.getText().contains(columns[i]))
|
||||
columns[i] = item.getText();
|
||||
}
|
||||
}
|
||||
System.out.println("columnsItem");
|
||||
count = Integer.parseInt(columnsNode.getText().substring(
|
||||
columnsNode.getText().indexOf("(") + 1,
|
||||
columnsNode.getText().indexOf(")")));
|
||||
@@ -1104,6 +1129,8 @@ public class TalendSwtbotTdqCommon {
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
return columns;
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.eclipse.swtbot.swt.finder.matchers.WidgetOfType;
|
||||
import org.eclipse.swtbot.swt.finder.waits.Conditions;
|
||||
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
|
||||
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
|
||||
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
|
||||
import org.eclipse.swtbot.swt.finder.widgets.TimeoutException;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -23,21 +24,26 @@ public class ColumnAnlaysisAboutMssqlTabledbconnectionTest extends TalendSwtbotF
|
||||
|
||||
bot.editorByTitle(TalendMetadataTypeEnum.MSSQL.toString() + " 0.1")
|
||||
.close();
|
||||
TalendSwtbotTdqCommon
|
||||
.createAnalysis(bot, TalendAnalysisTypeEnum.COLUMN);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void ColumnAnlaysisAboutMssqlTabledbconnection(){
|
||||
|
||||
String column = TalendSwtbotTdqCommon.getColumns(bot,
|
||||
TalendMetadataTypeEnum.MSSQL , "Talend", "additionalinfomap", "dtype")[0];
|
||||
TalendMetadataTypeEnum.MSSQL , "Talend", "yhbai", "name")[0];
|
||||
String item = bot.tree().expandNode("Metadata","DB connections","MSSQL", "Talend","dbo","Tables (140)","yhbai","Columns (2)").getNodes().get(1);
|
||||
System.out.println("*******"+item+"********");
|
||||
bot.editorByTitle(TalendAnalysisTypeEnum.COLUMN.toString() + " 0.1")
|
||||
.show();
|
||||
formBot.hyperlink("Select columns to analyze").click();
|
||||
bot.waitUntil(Conditions.shellIsActive("Column Selection"));
|
||||
SWTBotTree tree = new SWTBotTree((Tree) bot.widget(WidgetOfType
|
||||
.widgetOfType(Tree.class)));
|
||||
tree.expandNode("S6581FBD").getNode(0).expand().getNode(0).expand().select("FIDEM");
|
||||
bot.table().getTableItem(column).check();
|
||||
tree.expandNode("Talend").getNode("dbo").expand().getNode(0).expand().select("yhbai");
|
||||
bot.table().getTableItem(item).check();
|
||||
bot.button("OK").click();
|
||||
formBot.ccomboBox(1).setSelection("Nominal");
|
||||
bot.toolbarButtonWithTooltip("Save").click();
|
||||
@@ -62,16 +68,18 @@ public class ColumnAnlaysisAboutMssqlTabledbconnectionTest extends TalendSwtbotF
|
||||
WidgetOfType.widgetOfType(Tree.class),
|
||||
bot.viewByTitle("DQ Repository").getWidget()));
|
||||
tree.expandNode("Metadata","DB connections",TalendMetadataTypeEnum.MSSQL.toString(),"Talend").
|
||||
getNode(1).expand().getNode(0).select();
|
||||
ContextMenuHelper.clickContextMenu(tree, "Reload column list");
|
||||
getNode("dbo").expand().getNode(0).select();
|
||||
ContextMenuHelper.clickContextMenu(tree, "Reload table list");
|
||||
bot.waitUntil(Conditions.shellIsActive("Confirm reload"));
|
||||
SWTBotShell shell = bot.shell("Progress Information");
|
||||
|
||||
bot.button("OK").click();
|
||||
SWTBotShell shell = bot.shell("Progress Information");
|
||||
bot.waitUntil(Conditions.shellIsActive("Analyzed element changed"));
|
||||
bot.button("OK").click();
|
||||
|
||||
bot.waitUntil(Conditions.shellCloses(shell));
|
||||
tree.expandNode("Metadata","DB connections",TalendMetadataTypeEnum.MSSQL.toString(),"Talend").
|
||||
getNode(1).expand().getNode(0).expand().getNode("additionalinfomap").expand().getNode(0).select();
|
||||
getNode("dbo").expand().getNode(0).expand().getNode("yhbai").expand().getNode(0).select();
|
||||
ContextMenuHelper.clickContextMenu(tree, "Reload column list");
|
||||
bot.waitUntil(Conditions.shellIsActive("Confirm reload"));
|
||||
bot.button("OK").click();
|
||||
|
||||
@@ -23,20 +23,22 @@ public class ColumnAnlaysisAboutMssqlViewdbconnectionTest extends TalendSwtbotFo
|
||||
|
||||
bot.editorByTitle(TalendMetadataTypeEnum.MSSQL.toString() + " 0.1")
|
||||
.close();
|
||||
TalendSwtbotTdqCommon
|
||||
.createAnalysis(bot, TalendAnalysisTypeEnum.COLUMN);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ColumnAnlaysisAboutMssqlViewdbconnection(){
|
||||
String column = TalendSwtbotTdqCommon.getViewColumns(bot,
|
||||
TalendMetadataTypeEnum.MSSQL , "Talend", "View_3", "id")[0];
|
||||
TalendMetadataTypeEnum.MSSQL , "Talend", "yhbai_view", "name")[0];
|
||||
bot.editorByTitle(TalendAnalysisTypeEnum.COLUMN.toString() + " 0.1")
|
||||
.show();
|
||||
formBot.hyperlink("Select columns to analyze").click();
|
||||
bot.waitUntil(Conditions.shellIsActive("Column Selection"));
|
||||
SWTBotTree tree = new SWTBotTree((Tree) bot.widget(WidgetOfType
|
||||
.widgetOfType(Tree.class)));
|
||||
tree.expandNode("Talend").getNode(1).expand().getNode(1).expand().select("View_3");
|
||||
tree.expandNode("Talend").getNode("dbo").expand().getNode(1).expand().select("yhbai_view");
|
||||
bot.table().getTableItem(column).check();
|
||||
bot.button("OK").click();
|
||||
formBot.ccomboBox(1).setSelection("Nominal");
|
||||
@@ -62,22 +64,22 @@ public class ColumnAnlaysisAboutMssqlViewdbconnectionTest extends TalendSwtbotFo
|
||||
WidgetOfType.widgetOfType(Tree.class),
|
||||
bot.viewByTitle("DQ Repository").getWidget()));
|
||||
tree.expandNode("Metadata","DB connections",TalendMetadataTypeEnum.MSSQL.toString(),"Talend").
|
||||
getNode(1).expand().getNode(1).select();
|
||||
ContextMenuHelper.clickContextMenu(tree, "Reload column list");
|
||||
getNode("dbo").expand().getNode(1).select();
|
||||
ContextMenuHelper.clickContextMenu(tree, "Reload view list");
|
||||
bot.waitUntil(Conditions.shellIsActive("Confirm reload"));
|
||||
SWTBotShell shell = bot.shell("Progress Information");
|
||||
bot.button("OK").click();
|
||||
bot.waitUntil(Conditions.shellIsActive("Analyzed element changed"));
|
||||
bot.button("OK").click();
|
||||
bot.waitUntil(Conditions.shellCloses(shell));
|
||||
// SWTBotShell shell = bot.shell("Progress Information");
|
||||
// bot.waitUntil(Conditions.shellCloses(shell));
|
||||
tree.expandNode("Metadata","DB connections",TalendMetadataTypeEnum.MSSQL.toString(),"Talend").
|
||||
getNode(1).expand().getNode(1).expand().getNode("View_3").expand().getNode(0).select();
|
||||
getNode("dbo").expand().getNode(1).expand().getNode("yhbai_view").expand().getNode(0).select();
|
||||
ContextMenuHelper.clickContextMenu(tree, "Reload column list");
|
||||
bot.waitUntil(Conditions.shellIsActive("Confirm reload"));
|
||||
bot.button("OK").click();
|
||||
bot.waitUntil(Conditions.shellIsActive("Analyzed element changed"));
|
||||
bot.button("OK").click();
|
||||
bot.waitUntil(Conditions.shellCloses(shell));
|
||||
// bot.waitUntil(Conditions.shellCloses(shell));
|
||||
bot.editorByTitle(TalendAnalysisTypeEnum.COLUMN.toString() + " 0.1").show();
|
||||
bot.toolbarButtonWithTooltip("Run").click();
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ public class ColumnAnlaysisAboutMysqlDbconnectionTest extends TalendSwtbotForTdq
|
||||
public void ColumnAnlaysisAboutMysqlDbconnectionTable(){
|
||||
String column = TalendSwtbotTdqCommon.getColumns(bot,
|
||||
TalendMetadataTypeEnum.MYSQL, "tbi", "customer", "address1")[0];
|
||||
System.out.println("*******"+column+"********");
|
||||
bot.editorByTitle(TalendAnalysisTypeEnum.COLUMN.toString() + " 0.1")
|
||||
.show();
|
||||
formBot.hyperlink("Select columns to analyze").click();
|
||||
@@ -60,10 +61,11 @@ public class ColumnAnlaysisAboutMysqlDbconnectionTest extends TalendSwtbotForTdq
|
||||
WidgetOfType.widgetOfType(Tree.class),
|
||||
bot.viewByTitle("DQ Repository").getWidget()));
|
||||
tree.expandNode("Metadata","DB connections",TalendMetadataTypeEnum.MYSQL.toString(),"tbi").getNode(0).select();
|
||||
ContextMenuHelper.clickContextMenu(tree, "Reload column list");
|
||||
ContextMenuHelper.clickContextMenu(tree, "Reload table list");
|
||||
bot.waitUntil(Conditions.shellIsActive("Confirm reload"));
|
||||
SWTBotShell shell = bot.shell("Progress Information");
|
||||
bot.button("OK").click();
|
||||
SWTBotShell shell = bot.shell("Progress Information");
|
||||
|
||||
bot.waitUntil(Conditions.shellIsActive("Analyzed element changed"));
|
||||
bot.button("OK").click();
|
||||
bot.waitUntil(Conditions.shellCloses(shell));
|
||||
|
||||
@@ -35,6 +35,7 @@ public class ColumnAnlaysisAboutMysqlDbconnectionViewTest extends TalendSwtbotFo
|
||||
SWTBotTree tree = new SWTBotTree((Tree) bot.widget(WidgetOfType
|
||||
.widgetOfType(Tree.class)));
|
||||
tree.expandNode("tbi").getNode(1).expand().select("view_customer");
|
||||
|
||||
bot.table().getTableItem(column).check();
|
||||
bot.button("OK").click();
|
||||
formBot.ccomboBox(1).setSelection("Nominal");
|
||||
@@ -60,10 +61,12 @@ public class ColumnAnlaysisAboutMysqlDbconnectionViewTest extends TalendSwtbotFo
|
||||
WidgetOfType.widgetOfType(Tree.class),
|
||||
bot.viewByTitle("DQ Repository").getWidget()));
|
||||
tree.expandNode("Metadata","DB connections",TalendMetadataTypeEnum.MYSQL.toString(),"tbi").getNode(1).select();
|
||||
ContextMenuHelper.clickContextMenu(tree, "Reload column list");
|
||||
ContextMenuHelper.clickContextMenu(tree, "Reload view list");
|
||||
bot.waitUntil(Conditions.shellIsActive("Confirm reload"));
|
||||
SWTBotShell shell = bot.shell("Progress Information");
|
||||
bot.button("OK").click();
|
||||
SWTBotShell shell = bot.shell("Progress Information");
|
||||
// bot.waitUntil(Conditions.shellCloses(shell));
|
||||
|
||||
bot.waitUntil(Conditions.shellIsActive("Analyzed element changed"));
|
||||
bot.button("OK").click();
|
||||
bot.waitUntil(Conditions.shellCloses(shell));
|
||||
@@ -78,11 +81,11 @@ public class ColumnAnlaysisAboutMysqlDbconnectionViewTest extends TalendSwtbotFo
|
||||
bot.editorByTitle(TalendAnalysisTypeEnum.COLUMN.toString() + " 0.1").show();
|
||||
bot.toolbarButtonWithTooltip("Run").click();
|
||||
|
||||
try {
|
||||
SWTBotShell shell1 = bot.shell("Run Analysis");
|
||||
bot.waitUntil(Conditions.shellCloses(shell1));
|
||||
} catch (TimeoutException e) {
|
||||
}
|
||||
// try {
|
||||
// SWTBotShell shell1 = bot.shell("Run Analysis");
|
||||
// bot.waitUntil(Conditions.shellCloses(shell1));
|
||||
// } catch (TimeoutException e) {
|
||||
// }
|
||||
bot.editorByTitle(TalendAnalysisTypeEnum.COLUMN.toString()+" 0.1").close();
|
||||
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ public class CatalogAnalysisCheatSheetTest extends TalendSwtbotForTdq{
|
||||
TalendSwtbotTdqCommon.createCSAnalysis(bot, TalendAnalysisTypeEnum.CATALOG, TalendMetadataTypeEnum.MYSQL);
|
||||
formBot.imageHyperlink("Click when complete").click();
|
||||
formBot.imageHyperlink("Click to perform").click();
|
||||
bot.sleep(60000);
|
||||
bot.editorByTitle(TalendAnalysisTypeEnum.CATALOG+" 0.1").close();
|
||||
|
||||
try {
|
||||
|
||||
@@ -42,7 +42,7 @@ public class NewColumnAnalysisCheatSheetTest extends TalendSwtbotForTdq{
|
||||
tree.expandNode("tbi").getNode(0).expand().select("customer");
|
||||
bot.table().getTableItem("birthdate(DATE)").check();
|
||||
bot.button("OK").click();
|
||||
formBot.ccomboBox(2).setSelection("Interval");
|
||||
formBot.ccomboBox(1).setSelection("Interval");
|
||||
formBot.imageHyperlink("Click to perform").click();
|
||||
bot.waitUntil(Conditions.shellIsActive("Indicator Selection"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user