当前位置: 首页>>代码示例>>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;未经允许,请勿转载。