Search in sources :

Example 1 with BuildTypesTabFixture

use of com.android.tools.idea.tests.gui.framework.fixture.projectstructure.BuildTypesTabFixture in project android by JetBrains.

the class BuildTypesTest method addNewBuildType.

/**
   * Verifies addition of new build types
   * <p>This is run to qualify releases. Please involve the test team in substantial changes.
   * <p>TR ID: C14581580
   * <pre>
   *   Test Steps:
   *   1. Open the project structure dialog
   *   2. Select a module
   *   3. Click the Build Types tab
   *   4. Create new Build Type and name it newBuildType
   *   5. Set properties debuggable and version Name Suffix to valid values
   *   Verification:
   *   1. Open the build.gradle file for that module and verify
   *   entries for build types to contain new build type added.
   *   2. Verify the properties in the file match the values
   *   set in the project structure flavor dialog
   * </pre>
   */
@RunIn(TestGroup.QA)
@Test
public void addNewBuildType() throws Exception {
    IdeFrameFixture ideFrame = guiTest.importSimpleApplication();
    ProjectStructureDialogFixture projectStructureDialog = ideFrame.openFromMenu(ProjectStructureDialogFixture::find, "File", "Project Structure...");
    BuildTypesTabFixture buildTypesTab = projectStructureDialog.selectConfigurable("app").selectBuildTypesTab();
    buildTypesTab.setName("newBuildType").setDebuggable("true").setVersionNameSuffix("suffix");
    projectStructureDialog.clickOk();
    ideFrame.waitForGradleProjectSyncToFinish();
    EditorFixture editor = ideFrame.getEditor().open("/app/build.gradle");
    String gradleFileContents = editor.getCurrentFileContents();
    assertThat(gradleFileContents).containsMatch("newBuildType \\{\\n[\\s]*debuggable true\\n[\\s]*versionNameSuffix 'suffix'\\n[\\s]*\\}");
}
Also used : ProjectStructureDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.projectstructure.ProjectStructureDialogFixture) EditorFixture(com.android.tools.idea.tests.gui.framework.fixture.EditorFixture) IdeFrameFixture(com.android.tools.idea.tests.gui.framework.fixture.IdeFrameFixture) BuildTypesTabFixture(com.android.tools.idea.tests.gui.framework.fixture.projectstructure.BuildTypesTabFixture) Test(org.junit.Test) RunIn(com.android.tools.idea.tests.gui.framework.RunIn)

Aggregations

RunIn (com.android.tools.idea.tests.gui.framework.RunIn)1 EditorFixture (com.android.tools.idea.tests.gui.framework.fixture.EditorFixture)1 IdeFrameFixture (com.android.tools.idea.tests.gui.framework.fixture.IdeFrameFixture)1 BuildTypesTabFixture (com.android.tools.idea.tests.gui.framework.fixture.projectstructure.BuildTypesTabFixture)1 ProjectStructureDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.projectstructure.ProjectStructureDialogFixture)1 Test (org.junit.Test)1