当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript selenium-webdriver.Options类代码示例

本文整理汇总了TypeScript中selenium-webdriver.Options的典型用法代码示例。如果您正苦于以下问题:TypeScript Options类的具体用法?TypeScript Options怎么用?TypeScript Options使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Options类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: TestWebDriverOptions

function TestWebDriverOptions() {
    let driver: webdriver.WebDriver = new webdriver.Builder().
        withCapabilities(webdriver.Capabilities.chrome()).
        build();

    let options: webdriver.Options = new webdriver.Options(driver);
    let promise: webdriver.promise.Promise<void>;

    let name: string = 'name';
    let value: string = 'value';
    let path: string = 'path';
    let domain: string = 'domain';
    let secure: boolean = true;
    let httpOnly: boolean = true;

    // Add Cookie
    promise = options.addCookie({ name, value });
    promise = options.addCookie({ name, value, path });
    promise = options.addCookie({ name, value, path, domain });
    promise = options.addCookie({ name, value, path, domain, secure });
    promise = options.addCookie({ name, value, path, domain, secure, httpOnly });
    promise = options.addCookie({ name, value, path, domain, secure, httpOnly, expiry: 123 });
    promise = options.addCookie({ name, value, path, domain, secure, httpOnly, expiry: Date.now() });

    promise = options.deleteAllCookies();
    promise = options.deleteCookie('name');
    options.getCookie('name').then((cookie: webdriver.IWebDriverCookie) => {
        let expiry: number | undefined = cookie.expiry;
     });
    options.getCookies().then((cookies: webdriver.IWebDriverCookie[]) => { });

    let logs: webdriver.Logs = options.logs();
    let timeouts: webdriver.Timeouts = options.timeouts();
    let window: webdriver.Window = options.window();
}
开发者ID:Rick-Kirkham,项目名称:DefinitelyTyped,代码行数:35,代码来源:index.ts

示例2: TestWebDriverOptions

function TestWebDriverOptions() {
    var driver: webdriver.WebDriver = new webdriver.Builder().
        withCapabilities(webdriver.Capabilities.chrome()).
        build();

    var options: webdriver.Options = new webdriver.Options(driver);
    var promise: webdriver.promise.Promise<void>;

    // Add Cookie
    promise = options.addCookie('name', 'value');
    promise = options.addCookie('name', 'value', 'path');
    promise = options.addCookie('name', 'value', 'path', 'domain');
    promise = options.addCookie('name', 'value', 'path', 'domain', true);
    promise = options.addCookie('name', 'value', 'path', 'domain', true, 123);
    promise = options.addCookie('name', 'value', 'path', 'domain', true, Date.now());

    promise = options.deleteAllCookies();
    promise = options.deleteCookie('name');
    options.getCookie('name').then(function (cookies: webdriver.IWebDriverOptionsCookie) { });
    options.getCookies().then(function (cookies: webdriver.IWebDriverOptionsCookie[]) { });

    var logs: webdriver.Logs = options.logs();
    var timeouts: webdriver.Timeouts = options.timeouts();
    var window: webdriver.Window = options.window();
}
开发者ID:ArtemZag,项目名称:DefinitelyTyped,代码行数:25,代码来源:index.ts


注:本文中的selenium-webdriver.Options类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。