Package com.googlecode.jmeter.plugins.webdriver.config

Examples of com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig


        assertThat(gui.autoDetectProxy.isSelected(), is(true));
    }

    @Test
    public void shouldSetManualProxyOnConfigure() {
        WebDriverConfig config = new WebDriverConfigImpl();
        config.setProxyType(ProxyType.MANUAL);
        gui.configure(config);

        assertThat(gui.manualProxy.isSelected(), is(true));
    }
View Full Code Here


        assertThat(gui.manualProxy.isSelected(), is(true));
    }

    @Test
    public void shouldSetPacUrlProxyOnConfigure() {
        WebDriverConfig config = new WebDriverConfigImpl();
        config.setProxyType(ProxyType.PROXY_PAC);
        gui.configure(config);

        assertThat(gui.pacUrlProxy.isSelected(), is(true));
    }
View Full Code Here

        assertThat(gui.pacUrlProxy.isSelected(), is(true));
    }

    @Test
    public void shouldSetSystemProxyOnConfigure() {
        WebDriverConfig config = new WebDriverConfigImpl();
        config.setProxyType(ProxyType.SYSTEM);
        gui.configure(config);

        assertThat(gui.systemProxy.isSelected(), is(true));
    }
View Full Code Here

    }

    @Test
    public void shouldSetRecreateBrowser() {
        gui.recreateBrowserOnIterationStart.setSelected(true);
        final WebDriverConfig testElement = (WebDriverConfig) gui.createTestElement();
        assertThat(testElement.isRecreateBrowserOnIterationStart(), is(true));
    }
View Full Code Here

    }

    @Test
    public void shouldSetDevMode() {
        gui.devMode.setSelected(true);
        final WebDriverConfig testElement = (WebDriverConfig) gui.createTestElement();
        assertThat(testElement.isDevMode(), is(true));
    }
View Full Code Here

    @Override
    public void configure(TestElement element) {
        super.configure(element);
        if(element instanceof WebDriverConfig) {
            WebDriverConfig webDriverConfig = (WebDriverConfig)element;
            switch (webDriverConfig.getProxyType()) {
                case DIRECT:
                    directProxy.setSelected(true);
                    break;
                case AUTO_DETECT:
                    autoDetectProxy.setSelected(true);
                    break;
                case MANUAL:
                    manualProxy.setSelected(true);
                    break;
                case PROXY_PAC:
                    pacUrlProxy.setSelected(true);
                    break;
                default:
                    systemProxy.setSelected(true); // fallback to system proxy
            }
            pacUrl.setText(webDriverConfig.getProxyPacUrl());
            httpProxyHost.setText(webDriverConfig.getHttpHost());
            httpProxyPort.setText(String.valueOf(webDriverConfig.getHttpPort()));
            useHttpSettingsForAllProtocols.setSelected(webDriverConfig.isUseHttpSettingsForAllProtocols());
            httpsProxyHost.setText(webDriverConfig.getHttpsHost());
            httpsProxyPort.setText(String.valueOf(webDriverConfig.getHttpsPort()));
            ftpProxyHost.setText(webDriverConfig.getFtpHost());
            ftpProxyPort.setText(String.valueOf(webDriverConfig.getFtpPort()));
            socksProxyHost.setText(webDriverConfig.getSocksHost());
            socksProxyPort.setText(String.valueOf(webDriverConfig.getSocksPort()));
            noProxyList.setText(webDriverConfig.getNoProxyHost());

            // EXPERIMENTAL
            recreateBrowserOnIterationStart.setSelected(webDriverConfig.isRecreateBrowserOnIterationStart());
            devMode.setSelected(webDriverConfig.isDevMode());
        }
    }
View Full Code Here

    @Override
    public void modifyTestElement(TestElement element) {
        configureTestElement(element);
        if(element instanceof WebDriverConfig) {
            WebDriverConfig webDriverConfig = (WebDriverConfig)element;
            if(directProxy.isSelected()) {
                webDriverConfig.setProxyType(ProxyType.DIRECT);
            } else if(autoDetectProxy.isSelected()) {
                webDriverConfig.setProxyType(ProxyType.AUTO_DETECT);
            } else if(pacUrlProxy.isSelected()) {
                webDriverConfig.setProxyType(ProxyType.PROXY_PAC);
            } else if(manualProxy.isSelected()) {
                webDriverConfig.setProxyType(ProxyType.MANUAL);
            } else {
                webDriverConfig.setProxyType(ProxyType.SYSTEM); // fallback
            }
            webDriverConfig.setProxyPacUrl(pacUrl.getText());
            webDriverConfig.setHttpHost(httpProxyHost.getText());
            webDriverConfig.setHttpPort(Integer.parseInt(httpProxyPort.getText()));
            webDriverConfig.setUseHttpSettingsForAllProtocols(useHttpSettingsForAllProtocols.isSelected());
            webDriverConfig.setHttpsHost(httpsProxyHost.getText());
            webDriverConfig.setHttpsPort(Integer.parseInt(httpsProxyPort.getText()));
            webDriverConfig.setFtpHost(ftpProxyHost.getText());
            webDriverConfig.setFtpPort(Integer.parseInt(ftpProxyPort.getText()));
            webDriverConfig.setSocksHost(socksProxyHost.getText());
            webDriverConfig.setSocksPort(Integer.parseInt(socksProxyPort.getText()));
            webDriverConfig.setNoProxyHost(noProxyList.getText());

            // EXPERIMENTAL
            webDriverConfig.setRecreateBrowserOnIterationStart(recreateBrowserOnIterationStart.isSelected());
            webDriverConfig.setDevMode(devMode.isSelected());
        }
    }
View Full Code Here

        assertThat(gui, is(CoreMatchers.instanceOf(JMeterGUIComponent.class)));
    }

    @Test
    public void shouldCreateSystemProxyByDefault() {
        final WebDriverConfig testElement = (WebDriverConfig) gui.createTestElement();
        assertThat(testElement.getProxyType(), is(ProxyType.SYSTEM));
    }
View Full Code Here

    }

    @Test
    public void shouldCreateSystemProxy() {
        gui.systemProxy.setSelected(true);
        final WebDriverConfig testElement = (WebDriverConfig) gui.createTestElement();
        assertThat(testElement.getProxyType(), is(ProxyType.SYSTEM));
    }
View Full Code Here

    }

    @Test
    public void shouldCreateNoProxy() {
        gui.directProxy.setSelected(true);
        final WebDriverConfig testElement = (WebDriverConfig) gui.createTestElement();
        assertThat(testElement.getProxyType(), is(ProxyType.DIRECT));
    }
View Full Code Here

TOP

Related Classes of com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.