當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript firefox.Options類代碼示例

本文整理匯總了TypeScript中selenium-webdriver/firefox.Options的典型用法代碼示例。如果您正苦於以下問題:TypeScript Options類的具體用法?TypeScript Options怎麽用?TypeScript Options使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Options類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: async

 const buildDriverInstance = async () => {
   switch (browserType) {
     case 'chrome':
       const chromeOptions = new chrome.Options();
       const loggingPref = new logging.Preferences();
       loggingPref.setLevel(logging.Type.BROWSER, logging.Level.ALL);
       chromeOptions.setLoggingPrefs(loggingPref);
       if (process.env.TEST_BROWSER_HEADLESS) {
         // Use --disable-gpu to avoid an error from a missing Mesa library, as per
         // See: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
         chromeOptions.addArguments('headless', 'disable-gpu');
       }
       return new Builder()
         .forBrowser(browserType)
         .setChromeOptions(chromeOptions)
         .setChromeService(new chrome.ServiceBuilder(chromeDriver.path).enableVerboseLogging())
         .build();
     case 'firefox':
       const firefoxOptions = new firefox.Options();
       if (process.env.TEST_BROWSER_HEADLESS) {
         // See: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode
         firefoxOptions.addArguments('-headless');
       }
       return new Builder()
         .forBrowser(browserType)
         .setFirefoxOptions(firefoxOptions)
         .setFirefoxService(new firefox.ServiceBuilder(geckoDriver.path).enableVerboseLogging())
         .build();
     default:
       throw new Error(`${browserType} is not supported yet`);
   }
 };
開發者ID:spalger,項目名稱:kibana,代碼行數:32,代碼來源:webdriver.ts

示例2: TestFirefoxOptions

function TestFirefoxOptions() {
    let options: firefox.Options = new firefox.Options();

    options = options.setBinary('binary');
    options = options.setProfile('profile');
    options = options.setProxy({ proxyType: 'proxy' });
}
開發者ID:Lavoaster,項目名稱:DefinitelyTyped,代碼行數:7,代碼來源:firefox.ts

示例3: TestFirefoxOptions

function TestFirefoxOptions() {
    var options: firefox.Options = new firefox.Options();

    options = options.setBinary('binary');
    options = options.setBinary(new firefox.Binary());
    options = options.setLoggingPreferences(new webdriver.logging.Preferences());
    options = options.setProfile('profile');
    options = options.setProfile(new firefox.Profile());
    options = options.setProxy({ proxyType: 'proxy' });
    var capabilities: webdriver.Capabilities = options.toCapabilities();
}
開發者ID:Kroisse,項目名稱:DefinitelyTyped,代碼行數:11,代碼來源:firefox.ts

示例4: TestFirefoxOptions

function TestFirefoxOptions() {
    let options: firefox.Options = new firefox.Options();

    options = options.addArguments('foo', 'bar');
    options = options.windowSize({ width: 320, height: 480 });
    options = options.addExtensions('foo', 'bar');
    options = options.setPreference('a', 1);
    options = options.setPreference('a', true);
    options = options.setPreference('a', '1');
    options = options.setBinary('binary');
    options = options.setBinary(new firefox.Binary());
    options = options.setLoggingPreferences(new webdriver.logging.Preferences());
    options = options.setProfile('profile');
    options = options.setProfile(new firefox.Profile());
    options = options.setProxy({ proxyType: 'proxy' });
    let capabilities: webdriver.Capabilities = options.toCapabilities();
}
開發者ID:Jeremy-F,項目名稱:DefinitelyTyped,代碼行數:17,代碼來源:firefox.ts


注:本文中的selenium-webdriver/firefox.Options類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。