use of com.android.tools.idea.tests.gui.framework.fixture.npw.NewXmlValueWizardFixture in project android by JetBrains.
the class NewComponentTest method testNewValueWizard.
@Test
public void testNewValueWizard() throws IOException {
guiTest.importSimpleApplication();
guiTest.ideFrame().getProjectView().selectAndroidPane();
guiTest.ideFrame().invokeMenuPath("File", "New", "XML", "Values XML File");
final NewXmlValueWizardFixture wizardFixture = NewXmlValueWizardFixture.find(guiTest.robot());
final JButtonFixture finishFixture = wizardFixture.findWizardButton("Finish");
finishFixture.requireEnabled();
wizardFixture.getFileNameField().enterText("strings");
final JLabelFixture errorLabel = wizardFixture.findLabel("Values File Name must be unique");
Wait.seconds(1).expecting("Finish to be disabled").until(() -> !finishFixture.isEnabled());
wizardFixture.getFileNameField().enterText("2");
Wait.seconds(1).expecting("Finish to be enabled").until(finishFixture::isEnabled);
// Now test an invalid file name. Currently we have "strings2" so add an space to make it invalid.
wizardFixture.getFileNameField().enterText(" ");
Wait.seconds(1).expecting("Finish to be disabled").until(() -> !finishFixture.isEnabled());
errorLabel.requireText("Values File Name is not set to a valid resource name: ' ' is not a valid resource name character");
// UI tests should close all dialogs before finishing
wizardFixture.findWizardButton("Cancel").click();
}
Aggregations