Index: lams_tests/tests/org/lamsfoundation/lams/author/AuthorErrorsTests.java =================================================================== RCS file: /usr/local/cvsroot/lams_tests/tests/org/lamsfoundation/lams/author/AuthorErrorsTests.java,v diff -u -r1.1 -r1.2 --- lams_tests/tests/org/lamsfoundation/lams/author/AuthorErrorsTests.java 22 Oct 2014 19:32:14 -0000 1.1 +++ lams_tests/tests/org/lamsfoundation/lams/author/AuthorErrorsTests.java 3 Nov 2014 12:33:11 -0000 1.2 @@ -34,9 +34,9 @@ import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.PageFactory; import org.testng.Assert; -import org.testng.annotations.Test; -import org.testng.annotations.BeforeClass; import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; /** * LAMS Authoring common errors @@ -465,12 +465,70 @@ /** + * Attempts to create a cross branching transition + * + */ + @Test(dependsOnMethods="attemptSaveNoConditionsBranchesSet") + public void attempCrossBranchingTransition() { + + String branchingOne = "Branching1"; + + cleanCanvas(); + + fla.dragActivityToCanvasPosition(AuthorConstants.MULTIPLE_CHOICE_TITLE, 250, -10); + fla.dragBranchToCanvas(); + + fla.drawTransitionFromTo(AuthorConstants.MULTIPLE_CHOICE_TITLE, + AuthorConstants.BRANCHING_START_TITLE); + fla.drawTransitionFromTo(AuthorConstants.BRANCHING_START_TITLE, + AuthorConstants.BRANCH_END_TITLE); + + fla.branchingProperties(AuthorConstants.BRANCHING_TITLE) + .setBranchingType(BranchingTests.BRANCHING_TYPE_INSTRUCTOR); + + fla.dragActivityToCanvasPosition(AuthorConstants.FORUM_TITLE, 250, 200) + .dragActivityToCanvasPosition(AuthorConstants.COMMON_CARTRIDGE_TITLE, 450, 400); + + fla.drawTransitionFromTo(AuthorConstants.BRANCHING_START_TITLE, + AuthorConstants.FORUM_TITLE); + fla.drawTransitionFromTo(AuthorConstants.BRANCHING_START_TITLE, + AuthorConstants.COMMON_CARTRIDGE_TITLE); + + fla.drawTransitionFromTo(AuthorConstants.FORUM_TITLE, + AuthorConstants.BRANCH_END_TITLE); + + fla.branchingProperties(AuthorConstants.BRANCHING_TITLE).setBranchingTitle(branchingOne); + + fla.dragBranchesToCanvasPosition(150, 350); + + // fla.branchingProperties(AuthorConstants.BRANCHING_TITLE).setBranchingTitle(branchingTwo); + + fla.drawTransitionFromTo(AuthorConstants.COMMON_CARTRIDGE_TITLE, AuthorConstants.BRANCHING_START_TITLE); + + fla.dragActivityToCanvasPosition(AuthorConstants.NOTEBOOK_TITLE, 300, 500); + fla.dragActivityToCanvasPosition(AuthorConstants.IMAGE_GALLERY_TITLE, 350, 600); + + fla.drawTransitionFromTo(AuthorConstants.BRANCHING_START_TITLE, AuthorConstants.NOTEBOOK_TITLE); + fla.drawTransitionFromTo(AuthorConstants.BRANCHING_START_TITLE, AuthorConstants.IMAGE_GALLERY_TITLE); + + fla.drawTransitionFromTo(AuthorConstants.IMAGE_GALLERY_TITLE, AuthorConstants.BRANCH_END_TITLE); + fla.arrangeDesign(); + + String txt = fla.drawTransitionFromTo(AuthorConstants.NOTEBOOK_TITLE, branchingOne + " end").getAlertText(); + + Assert.assertEquals(txt, AuthorConstants.BRANCHING_CROSSBRANCHING_NOT_ALLOWED, + "It should have been given an error when attempting to do a cross branching transtion!"); + + } + + + /** * Save invalid design: no activities inside the optional * * Attempts to save a design that has no activities within the optional activity. * */ - @Test(dependsOnMethods={"attemptSaveNoConditionsBranchesSet"}) + @Test(dependsOnMethods={"attempCrossBranchingTransition"}) public void attemptSaveNoActivitiesInsideOptional() { cleanCanvas(); Index: lams_tests/tests/org/lamsfoundation/lams/author/util/AuthorConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_tests/tests/org/lamsfoundation/lams/author/util/AuthorConstants.java,v diff -u -r1.3 -r1.4 --- lams_tests/tests/org/lamsfoundation/lams/author/util/AuthorConstants.java 22 Oct 2014 19:46:37 -0000 1.3 +++ lams_tests/tests/org/lamsfoundation/lams/author/util/AuthorConstants.java 3 Nov 2014 12:33:26 -0000 1.4 @@ -39,6 +39,7 @@ public static final String BRANCHING_MUST_HAVE_AT_LEAST_MSG = "A Branching Activity must have at least one"; public static final String BRANCHING_MUST_HAVE_GROUPS_TO_BRANCHES_MSG = "Group Based Branching Activity must have all Groups assigned to Branches"; public static final String BRANCHING_MUST_HAVE_ONE_CONDITION_MSG = "Learner's Output Branching Activity must have at least one condition"; + public static final String BRANCHING_CROSSBRANCHING_NOT_ALLOWED = "Cross-branching transitions are not allowed"; public static final String OPTIONAL_MUST_HAVE_ONE_ACTIVITY_MSG = "An Optional Activity must have one or more activities"; public static final String SUPPORT_MUST_HAVE_ONE_ACTIVITY_MSG = "at least one support activity in the container";