Author: rhopp
Date: 2012-02-21 06:28:49 -0500 (Tue, 21 Feb 2012)
New Revision: 38934
Modified:
trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsTest.java
Log:
Document section test
Modified:
trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsTest.java
===================================================================
---
trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsTest.java 2012-02-21
11:22:00 UTC (rev 38933)
+++
trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsTest.java 2012-02-21
11:28:49 UTC (rev 38934)
@@ -7,15 +7,19 @@
import org.jboss.tools.ui.bot.ext.SWTBotFactory;
import org.jboss.tools.ui.bot.ext.SWTFormsBotExt;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.condition.BrowserIsLoaded;
+import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotBrowserExt;
import org.jboss.tools.ui.bot.ext.parts.SWTBotTwistie;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-@Require(server=(a)org.jboss.tools.ui.bot.ext.config.Annotations.Server(type=ServerType.JbossAS))
+//@Require(server=(a)org.jboss.tools.ui.bot.ext.config.Annotations.Server(type=ServerType.JbossAS))
public class CreateProjectsTest extends SWTTestExt{
private static final String JBOSS_INSTALL_PATH = "/tmp/jbossAS";
@@ -31,7 +35,7 @@
deleteDirectory(new File(JBOSS_INSTALL_PATH));
}
- @Test
+ //@Test
public void createProjectsSectionTest(){
//waitForAWhile();
SWTFormsBotExt formsBot = SWTBotFactory.getFormsBot();
@@ -113,9 +117,8 @@
bot.activeShell().close();
}
- @Test
+ //@Test
public void projectExamplesSectionTest(){
- //SWTBotSection section = bot.section("Project Examples");
SWTBotTwistie twistieBot = bot.twistieByLabel("JBoss Quickstarts");
if (!twistieBot.isExpanded()){
twistieBot.toggle();
@@ -123,29 +126,47 @@
SWTFormsBotExt formsBot = SWTBotFactory.getFormsBot();
formsBot.formTextWithText("Helloworld").click();
bot.clickButton("Start");
- waitForAllMultipleTimes(3);
+ bot.waitWhile(new NonSystemJobRunsCondition(), TaskDuration.NORMAL.getTimeout());
formsBot.formTextWithText("Numberguess").click();
bot.clickButton("Start");
- waitForAllMultipleTimes(3);
+ bot.waitWhile(new NonSystemJobRunsCondition(), TaskDuration.NORMAL.getTimeout());
log.info(bot.activeEditor().getTitle());
formsBot.formTextWithText("Login").click();
bot.clickButton("Start");
- waitForAllMultipleTimes(3);
+ bot.waitWhile(new NonSystemJobRunsCondition(),TaskDuration.NORMAL.getTimeout());
formsBot.formTextWithText("Kitchensink").click();
bot.clickButton("Start");
- waitForAllMultipleTimes(3);
+ bot.waitWhile(new NonSystemJobRunsCondition(), TaskDuration.NORMAL.getTimeout());
}
- /**
- * calls method waitForAll x times
- * @param value how many times waitForAll should be called
- */
- private void waitForAllMultipleTimes(int value){
- for (int i=0; i<value; i++){
- util.waitForAll();
- }
+ @Test
+ public void documentationSectionTest(){
+ /*bot.hyperlink("New and Noteworthy").click();
+ bot.waitUntil(new BrowserIsLoaded(bot.browserExt()), TaskDuration.LONG.getTimeout());
+ assertFalse("JBoss Central sould not be active editor right now",
bot.activeEditor().getTitle().equals("JBoss Central"));
+ bot.activeEditor().close();
+ bot.hyperlink("User Forum").click();
+ bot.waitUntil(new BrowserIsLoaded(bot.browserExt()), TaskDuration.LONG.getTimeout());
+ assertFalse("JBoss Central sould not be active editor right now",
bot.activeEditor().getTitle().equals("JBoss Central"));
+ bot.activeEditor().close();*/
+ testHyperlinkToBrowser("New and Noteworthy");
+ testHyperlinkToBrowser("User Forum");
+ testHyperlinkToBrowser("Reference");
+ testHyperlinkToBrowser("Developer Forum");
+ testHyperlinkToBrowser("FAQ");
+ testHyperlinkToBrowser("Wiki");
+ testHyperlinkToBrowser("Screencasts");
+ testHyperlinkToBrowser("Issue Tracker");
+ bot.sleep(TIME_10S);
}
+ private void testHyperlinkToBrowser(String hyperlinkText){
+ bot.hyperlink(hyperlinkText).click();
+ bot.waitUntil(new BrowserIsLoaded(bot.browserExt()), TaskDuration.LONG.getTimeout());
+ assertFalse("JBoss Central sould not be active editor right now",
bot.activeEditor().getTitle().equals("JBoss Central"));
+ bot.activeEditor().close();
+ }
+
private void waitForAWhile(){
bot.sleep(Long.MAX_VALUE);
}
Show replies by date