Package hudson.plugins.selenium.process

Examples of hudson.plugins.selenium.process.SeleniumRunOptions


    public static DescriptorExtensionList<SeleniumNodeConfiguration, ConfigurationDescriptor> allExcept(Node current) {
        return Hudson.getInstance().<SeleniumNodeConfiguration, ConfigurationDescriptor> getDescriptorList(SeleniumNodeConfiguration.class);
    }

    public SeleniumRunOptions initOptions(Computer c) {
        SeleniumRunOptions opts = new SeleniumRunOptions();

        opts.setEnvVar("DISPLAY", display);

        return opts;
    }
View Full Code Here


    }

    @Override
    public SeleniumRunOptions initOptions(Computer c) {
        SeleniumRunOptions opt = super.initOptions(c);

        opt.addOptionIfSet("-log", getRcLog());

        try {
            opt.addOptionIfSet("-port", c.getChannel().call(new RetrieveAvailablePort(getPort())));
        } catch (Exception e) {
            // an error occured, not adding the port option
        }

        if (getRcBrowserSideLog()) {
            opt.addOption("-browserSideLog");
        }
        if (getRcDebug()) {
            opt.addOption("-debug");
        }
        if (getRcTrustAllSSLCerts()) {
            opt.addOption("-trustAllSSLCertificates");
        }
        if (getRcBrowserSessionReuse()) {
            opt.addOption("-browserSessionReuse");
        }
        if (getTimeout() != null && getTimeout() > -1) {
            opt.addOption("-timeout");
            opt.addOption(getTimeout().toString());
        }

        for (SeleniumBrowser b : browsers) {
            b.initOptions(c, opt);
        }
View Full Code Here

        }
    }

    @Override
    public SeleniumRunOptions initOptions(Computer computer) {
        SeleniumRunOptions opt = super.initOptions(computer);
        try {

            final String filename = "selenium-temp-config-" + System.currentTimeMillis() + ".json";

            if (jvmArgs != null) {
                Properties p = new Properties();
                p.load(new StringReader(jvmArgs.replace("\\", "\\\\")));
                for (Entry<Object, Object> e : p.entrySet()) {
                    opt.getJVMArguments().put(e.getKey().toString(), e.getValue().toString());
                }
            }

            if (seleniumArgs != null) {
                for (Object l : IOUtils.readLines(new StringReader(seleniumArgs))) {
                    String line = (String) l;
                    if (line.contains(" ")) {
                        StringUtils.split(line, " ", 2);
                    } else {
                        opt.addOption(line);
                    }
                }
            }

            String fullPath = computer.getNode().getRootPath().act(new FileCallable<String>() {

                /**
                 *
                 */
                private static final long serialVersionUID = -288688398601004624L;

                public String invoke(File f, VirtualChannel channel) throws IOException {
                    File conf = new File(f, filename);

                    FilePath urlConf = new FilePath(conf);
                    try {
                        urlConf.copyFrom(new ByteArrayInputStream(config.getBytes()));
                    } catch (InterruptedException e) {
                        throw new IOException2("Failed to write configuration to " + filename, e);
                    }

                    return conf.getAbsolutePath();
                }
            });

            opt.addOptionIfSet("-nodeConfig", fullPath);

            return opt;
        } catch (Exception e) {
            LOGGER.fine("Cannot write the specified configuration on the node. " + e.getMessage());
            return null;
View Full Code Here

        }
    }

    @Override
    public SeleniumRunOptions initOptions(Computer c) {
        SeleniumRunOptions opt = super.initOptions(c);
        try {
            final String filename = "selenium-temp-config-" + System.currentTimeMillis() + ".json";

            String fullPath = c.getNode().getRootPath().act(new FileCallable<String>() {

                /**
         *
         */
                private static final long serialVersionUID = -288688398601004624L;

                public String invoke(File f, VirtualChannel channel) throws IOException {
                    File conf = new File(f, filename);

                    FilePath urlConf = new FilePath(conf);
                    try {
                        urlConf.copyFrom(new URL(configURL));
                    } catch (InterruptedException e) {
                        throw new IOException2("Failed to retrieve configuration from " + configURL, e);
                    }

                    return conf.getAbsolutePath();
                }
            });

            opt.addOptionIfSet("-nodeConfig", fullPath);

            return opt;
        } catch (Exception e) {
            LOGGER.fine("Cannot download the specified configuration file on the node. " + e.getMessage());
            return null;
View Full Code Here

    }

    @Override
    public SeleniumRunOptions initOptions(Computer c) {
        SeleniumRunOptions opt = super.initOptions(c);
        try {
            opt.addOptionIfSet("-port", c.getChannel().call(new RetrieveAvailablePort(getPort())));
        } catch (Exception e) {
            // an error occured, not adding the port option
            // e.printStackTrace();
        }

        if (getTimeout() != null && getTimeout() > -1) {
            opt.addOption("-timeout");
            opt.addOption(getTimeout().toString());
        }

        for (WebDriverBrowser b : browsers) {
            b.initOptions(c, opt);
        }
View Full Code Here

        browsers.add(new IEBrowser(1, "", ""));
        browsers.add(new FirefoxBrowser(1, "", ""));
        browsers.add(new OperaBrowser(1, "", ""));

        CustomWDConfiguration cc = new CustomWDConfiguration(5000, -1, browsers, null);
        SeleniumRunOptions opt = cc.initOptions(null);
    }
View Full Code Here

TOP

Related Classes of hudson.plugins.selenium.process.SeleniumRunOptions

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.