Beispiel #1
0
void Config::processArgs(const QStringList &args)
{
    connect(m_cmdLine, SIGNAL(switchFound(const QString &)), this, SLOT(handleSwitch(const QString &)));
    connect(m_cmdLine, SIGNAL(optionFound(const QString &, const QVariant &)), this, SLOT(handleOption(const QString &, const QVariant &)));
    connect(m_cmdLine, SIGNAL(paramFound(const QString &, const QVariant &)), this, SLOT(handleParam(const QString &, const QVariant &)));
    connect(m_cmdLine, SIGNAL(parseError(const QString &)), this, SLOT(handleError(const QString &)));

    m_cmdLine->setArguments(args);
    m_cmdLine->setConfig(flags);
    m_cmdLine->parse();

    // Inject command line parameters to be picked up by GhostDriver
    if (isWebdriverMode()) {
        QStringList argsForGhostDriver;

        m_scriptFile = "main.js";                                           //< launch script

        argsForGhostDriver << QString("--ip=%1").arg(m_webdriverIp);        //< "--ip=IP"
        argsForGhostDriver << QString("--port=%1").arg(m_webdriverPort);    //< "--port=PORT"

        if (!m_webdriverSeleniumGridHub.isEmpty()) {
            argsForGhostDriver << QString("--hub=%1").arg(m_webdriverSeleniumGridHub);  //< "--hub=SELENIUM_GRID_HUB_URL"
        }

        if (!m_webdriverLogFile.isEmpty()) {
            argsForGhostDriver << QString("--logFile=%1").arg(m_webdriverLogFile);          //< "--logFile=LOG_FILE"
            argsForGhostDriver << "--logColor=false";                                   //< Force no-color-output in Log File
        }

        argsForGhostDriver << QString("--logLevel=%1").arg(m_webdriverLogLevel);    //< "--logLevel=LOG_LEVEL"

        // Clear current args and override with those
        setScriptArgs(argsForGhostDriver);
    }
}
Beispiel #2
0
void Config::processArgs(const QStringList &args)
{
    connect(m_cmdLine, SIGNAL(switchFound(const QString &)), this, SLOT(handleSwitch(const QString &)));
    connect(m_cmdLine, SIGNAL(optionFound(const QString &, const QVariant &)), this, SLOT(handleOption(const QString &, const QVariant &)));
    connect(m_cmdLine, SIGNAL(paramFound(const QString &, const QVariant &)), this, SLOT(handleParam(const QString &, const QVariant &)));
    connect(m_cmdLine, SIGNAL(parseError(const QString &)), this, SLOT(handleError(const QString &)));

    m_cmdLine->setArguments(args);
    m_cmdLine->setConfig(flags);
    m_cmdLine->parse();

    // Inject command line parameters to be picked up by GhostDriver
    if (isWebdriverMode()) {
        QStringList argsForGhostDriver;

        m_scriptFile = "main.js";                       //< launch script
        argsForGhostDriver << m_webdriver;              //< ip:port
        if (!m_webdriverSeleniumGridHub.isEmpty()) {
            argsForGhostDriver << m_webdriverSeleniumGridHub;    //< selenium grid url
        }

        // Clear current args and override with those
        setScriptArgs(argsForGhostDriver);
    }
}