use of com.android.tools.idea.tests.gui.framework.RunIn in project android by JetBrains.
the class InstantRunTest method coldSwap.
/**
* Verifies that instant run cold swap works as expected.
* <p>
* This is run to qualify releases. Please involve the test team in substantial changes.
* <p>
* TR ID: C14581584
* <p>
* <pre>
* Test Steps:
* 1. Import SimpleApplication.
* 2. Update the gradle plugin version if necessary for testing purpose.
* 3. Create an AVD with a system image API 21 or above.
* 4. Run on the AVD
* 5. Verify 1.
* 6. Edit a resource xml file.
* 7. Run again.
* 8. Verify 2.
* Verify:
* 1. Make sure the right app is installed and started in Run tool window.
* 2. Make sure the instant run cold swap is applied in Run tool window.
* </pre>
*/
@RunIn(TestGroup.QA)
@Test
public void coldSwap() throws Exception {
IdeFrameFixture ideFrameFixture = guiTest.importSimpleApplication();
updateGradleVersion(guiTest.getProjectPath());
createAVD();
ideFrameFixture.runApp(APP_NAME).selectDevice(AVD_NAME).clickOk();
ideFrameFixture.getRunToolWindow().findContent(APP_NAME).waitForOutput(new PatternTextMatcher(RUN_OUTPUT), 120);
ideFrameFixture.getEditor().open("app/src/main/res/layout/activity_my.xml", EditorFixture.Tab.DESIGN).getLayoutEditor(false).dragComponentToSurface("Widgets", "TextView").waitForRenderToFinish();
ideFrameFixture.waitForGradleProjectSyncToFinish().findRunApplicationButton().click();
ideFrameFixture.getRunToolWindow().findContent(APP_NAME).waitForOutput(new PatternTextMatcher(COLD_SWAP_OUTPUT), 120);
}
use of com.android.tools.idea.tests.gui.framework.RunIn in project android by JetBrains.
the class NewProjectTest method testStillBuildingMessage.
@RunIn(TestGroup.UNRELIABLE)
@Test
public void testStillBuildingMessage() throws Exception {
// Create a new project and open a layout file.
// If the first build is still going on when the rendering happens, simply show a message that a build is going on,
// and check that the message disappears at the end of the build.
newProject("Test Application").withBriefNames().withMinSdk("15").withoutSync().create();
final EditorFixture editor = guiTest.ideFrame().getEditor();
Wait.seconds(5).expecting("file to open").until(() -> "A.java".equals(editor.getCurrentFileName()));
editor.open("app/src/main/res/layout/activity_a.xml", EditorFixture.Tab.EDITOR);
NlEditorFixture layoutEditor = editor.getLayoutEditor(true);
layoutEditor.waitForRenderToFinish();
if (layoutEditor.hasRenderErrors()) {
layoutEditor.waitForErrorPanelToContain("still building");
assertThat(layoutEditor.getErrorText()).doesNotContain("Missing styles");
guiTest.ideFrame().waitForGradleProjectSyncToFinish();
layoutEditor.waitForRenderToFinish();
assertThat(layoutEditor.hasRenderErrors()).isFalse();
}
}
use of com.android.tools.idea.tests.gui.framework.RunIn in project android by JetBrains.
the class NewProjectTest method createNewProjectNameWithSpace.
/**
* Verify able to create a new project with name containing a space.
* <p>
* This is run to qualify releases. Please involve the test team in substantial changes.
* <p>
* <pre>
* Steps:
* 1. Create a new project with min sdk 23.
* 2. Enter a project name with at least one space.
* 3. Accept all other defaults.
* 4. Wait for build to finish.
* 5. Project is created successfully.
* Verify:
* Successfully created new project with name containing a space.
* </pre>
*/
@RunIn(TestGroup.QA)
@Test
public void createNewProjectNameWithSpace() {
EditorFixture editor = newProject("Test Application").withMinSdk("23").create().getEditor().open("app/src/main/res/values/strings.xml", EditorFixture.Tab.EDITOR);
String text = editor.getCurrentFileContents();
assertThat(text).contains("Test Application");
}
use of com.android.tools.idea.tests.gui.framework.RunIn in project android by JetBrains.
the class NewProjectTest method testCreateNewMobileProject.
/**
* Verify creating a new project from default template.
* <p>
* This is run to qualify releases. Please involve the test team in substantial changes.
* <p>
* <pre>
* Steps:
* 1. From the welcome screen, click on "Start a new Android Studio project".
* 2. Enter a unique project name.
* 3. Accept all other defaults.
* Verify:
* 1. Check that the project contains 2 module.
* 2. Check that MainActivity is in AndroidManifest.
* </pre>
*/
@RunIn(TestGroup.QA)
@Test
public void testCreateNewMobileProject() {
newProject("Test Application").create();
EditorFixture editor = guiTest.ideFrame().getEditor();
editor.open("app/src/main/res/layout/activity_main.xml", EditorFixture.Tab.EDITOR);
guiTest.ideFrame().requireModuleCount(2);
// Make sure that the activity registration uses the relative syntax
// (regression test for https://code.google.com/p/android/issues/detail?id=76716)
editor.open("app/src/main/AndroidManifest.xml", EditorFixture.Tab.EDITOR);
assertThat(editor.getCurrentFileContents()).contains("\".MainActivity\"");
}
use of com.android.tools.idea.tests.gui.framework.RunIn in project android by JetBrains.
the class NewProjectTest method testRenderResourceInitialization.
@RunIn(TestGroup.UNRELIABLE)
@Test
public void testRenderResourceInitialization() throws IOException {
// Regression test for https://code.google.com/p/android/issues/detail?id=76966
newProject("Test Application").withBriefNames().withMinSdk("9").create();
EditorFixture editor = guiTest.ideFrame().getEditor();
assertThat(editor.getCurrentFileName()).isEqualTo("A.java");
editor.close();
assertThat(editor.getCurrentFileName()).isEqualTo("activity_a.xml");
NlEditorFixture layoutEditor = editor.getLayoutEditor(true);
layoutEditor.waitForRenderToFinish();
guiTest.ideFrame().invokeProjectMake();
layoutEditor.waitForRenderToFinish();
assertFalse(layoutEditor.hasRenderErrors());
guiTest.waitForBackgroundTasks();
}
Aggregations