Ejemplo n.º 1
0
  public void testAdapterUpdateInScriptActivity() {
    String look1ImagePath = lookDataList.get(0).getAbsolutePath();
    String look2ImagePath = lookDataList.get(1).getAbsolutePath();
    assertTrue(lookName + " is not selected in Spinner", solo.isSpinnerTextSelected(lookName));

    UiTestUtils.clickOnBottomBar(solo, R.id.button_play);
    solo.waitForActivity(StageActivity.class.getSimpleName());
    String lookPath =
        ProjectManager.getInstance().getCurrentSprite().getLookDataList().get(0).getAbsolutePath();
    assertEquals(
        "Wrong image shown in stage --> Problem with Adapter update in Script",
        look1ImagePath,
        lookPath);
    solo.goBack();
    solo.goBack();

    for (int i = 0; i < 5; ++i) {
      selectLook(lookName2, lookName, look2ImagePath);
      selectLook(lookName, lookName2, look1ImagePath);
    }
  }
Ejemplo n.º 2
0
  public void testSelectLookAndPlay() {
    assertTrue(lookName + " is not selected in Spinner", solo.isSpinnerTextSelected(lookName));

    UiTestUtils.clickOnBottomBar(solo, R.id.button_play);

    solo.waitForActivity(StageActivity.class.getSimpleName());
    solo.sleep(1000);
    Look look = ProjectManager.getInstance().getCurrentProject().getSpriteList().get(0).look;
    assertEquals("look not set", look.getImagePath(), lookDataList.get(0).getAbsolutePath());
    solo.goBack();
    solo.goBack();
    solo.waitForActivity(ScriptActivity.class.getSimpleName());

    solo.clickOnText(lookName);
    solo.clickOnText(lookName2);
    assertTrue(lookName2 + " is not selected in Spinner", solo.searchText(lookName2));

    UiTestUtils.clickOnBottomBar(solo, R.id.button_play);

    solo.waitForActivity(StageActivity.class.getSimpleName());
    solo.sleep(1000);
    look = ProjectManager.getInstance().getCurrentProject().getSpriteList().get(0).look;
    assertEquals("look not set", look.getImagePath(), lookDataList.get(1).getAbsolutePath());
  }