use of com.android.tools.idea.tests.gui.framework.fixture.ProxySettingsDialogFixture in project android by JetBrains.
the class GradlePreSyncTest method testAddProxyConfigureToPropertyFile.
// Verifies that the IDE, during sync, asks the user to copy IDE proxy settings to gradle.properties, if applicable.
// See https://code.google.com/p/android/issues/detail?id=65325
// Similar to {@link com.android.tools.idea.gradle.util.GradlePropertiesTest#testSetProxySettings} test, but also tests the UI
// element that is involved.
@Test
public void testAddProxyConfigureToPropertyFile() throws IOException {
guiTest.importSimpleApplication();
String host = "myproxy.test.com";
int port = 443;
HttpConfigurable ideSettings = HttpConfigurable.getInstance();
ideSettings.USE_HTTP_PROXY = true;
ideSettings.PROXY_HOST = host;
ideSettings.PROXY_PORT = port;
ideSettings.PROXY_AUTHENTICATION = true;
ideSettings.setProxyLogin("test");
ideSettings.setPlainProxyPassword("testPass");
ProxySettings ideProxySettings = new ProxySettings(ideSettings);
GradleProperties properties = new GradleProperties(guiTest.ideFrame().getProject());
assertNotEquals(ideProxySettings, properties.getHttpProxySettings());
guiTest.ideFrame().requestProjectSync();
ProxySettingsDialogFixture proxySettingsDialog = ProxySettingsDialogFixture.find(guiTest.robot());
proxySettingsDialog.enableHttpsProxy();
proxySettingsDialog.clickOk();
properties = new GradleProperties(guiTest.ideFrame().getProject());
assertEquals(ideProxySettings, properties.getHttpProxySettings());
ideProxySettings.setProxyType(ProxySettings.HTTPS_PROXY_TYPE);
assertEquals(ideProxySettings, properties.getHttpsProxySettings());
guiTest.ideFrame().waitForGradleProjectSyncToFinish();
}
use of com.android.tools.idea.tests.gui.framework.fixture.ProxySettingsDialogFixture in project android by JetBrains.
the class GradlePreSyncTest method testDoNotShowProxySettingDialog.
@Test
public void testDoNotShowProxySettingDialog() throws IOException {
guiTest.importSimpleApplication();
PropertiesComponent.getInstance(guiTest.ideFrame().getProject()).setValue("show.do.not.copy.http.proxy.settings.to.gradle", "true");
File gradlePropertiesPath = new File(guiTest.ideFrame().getProjectPath(), "gradle.properties");
createIfNotExists(gradlePropertiesPath);
HttpConfigurable ideSettings = HttpConfigurable.getInstance();
ideSettings.USE_HTTP_PROXY = true;
ideSettings.PROXY_HOST = "myproxy.test.com";
ideSettings.PROXY_PORT = 443;
guiTest.ideFrame().requestProjectSync();
ProxySettingsDialogFixture proxySettingsDialog = ProxySettingsDialogFixture.find(guiTest.robot());
proxySettingsDialog.setDoNotShowThisDialog(true);
proxySettingsDialog.clickOk();
guiTest.ideFrame().waitForGradleProjectSyncToStart().waitForGradleProjectSyncToFinish();
// Force a change on the proxy, otherwise the project sync may be ignored.
ideSettings.PROXY_HOST = "myproxy2.test.com";
// Verifies that the "Do not show this dialog in the future" does not show up. If it does show up the test will timeout and fail.
guiTest.ideFrame().requestProjectSync().waitForGradleProjectSyncToFinish();
}
Aggregations