From f38b15bc38f64e98950f3610dc7fca221e4ddec8 Mon Sep 17 00:00:00 2001 From: Lukas Sembera Date: Sun, 20 Sep 2015 19:43:16 +0200 Subject: [PATCH 01/18] Add missing headers() function to restangular's IResponse --- restangular/restangular-tests.ts | 3 ++- restangular/restangular.d.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/restangular/restangular-tests.ts b/restangular/restangular-tests.ts index 33c46a421..9b5a9c30b 100644 --- a/restangular/restangular-tests.ts +++ b/restangular/restangular-tests.ts @@ -92,7 +92,8 @@ myApp.controller('TestCtrl', ( Restangular.setMethodOverriders(["put", "patch"]); Restangular.setErrorInterceptor(function (response) { - console.error('' + response.status + ' ' + response.data); + let location: string = response.headers('Location'); + console.error('' + response.status + ' ' + response.data + ' ' + location); }); Restangular.setRequestSuffix('.json'); diff --git a/restangular/restangular.d.ts b/restangular/restangular.d.ts index bce357482..b09e4affd 100644 --- a/restangular/restangular.d.ts +++ b/restangular/restangular.d.ts @@ -43,6 +43,7 @@ declare module restangular { interface IResponse { status: number; data: any; + headers(name: string): string; config: { method: string; url: string; From d9e56a56392e5cde59b516e214e3a4a08dab7fac Mon Sep 17 00:00:00 2001 From: progre Date: Mon, 21 Sep 2015 12:17:18 +0900 Subject: [PATCH 02/18] Remove unused reference --- node-notifier/node-notifier.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/node-notifier/node-notifier.d.ts b/node-notifier/node-notifier.d.ts index d003001a3..9e612453e 100644 --- a/node-notifier/node-notifier.d.ts +++ b/node-notifier/node-notifier.d.ts @@ -3,7 +3,6 @@ // Definitions by: Qubo // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// /// declare module "node-notifier" { From bb370b898e6a1528c5959932b4e238a574f22869 Mon Sep 17 00:00:00 2001 From: Geir Sagberg Date: Mon, 21 Sep 2015 11:40:10 +0200 Subject: [PATCH 03/18] Add declaration for 'js-cookie' Supports e.g. `import Cookies = require('js-cookie')` for CommonJS. --- js-cookie/js-cookie.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js-cookie/js-cookie.d.ts b/js-cookie/js-cookie.d.ts index fc3e95c02..7fc1a5125 100644 --- a/js-cookie/js-cookie.d.ts +++ b/js-cookie/js-cookie.d.ts @@ -90,3 +90,7 @@ declare module Cookies { } declare var Cookies: Cookies.CookiesStatic; + +declare module 'js-cookie' { + export = Cookies; +} From 50972e00188534dc26a03540c7da9b001d4574da Mon Sep 17 00:00:00 2001 From: Stefan Schacherl Date: Mon, 21 Sep 2015 15:52:43 +0200 Subject: [PATCH 04/18] Added definitions for rest-io --- rest-io/rest-io-tests.ts | 18 +++++ rest-io/rest-io.d.ts | 148 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 166 insertions(+) create mode 100644 rest-io/rest-io-tests.ts create mode 100644 rest-io/rest-io.d.ts diff --git a/rest-io/rest-io-tests.ts b/rest-io/rest-io-tests.ts new file mode 100644 index 000000000..5f558b77a --- /dev/null +++ b/rest-io/rest-io-tests.ts @@ -0,0 +1,18 @@ +/// + +import express = require('express'); +import restIO = require('rest-io'); +import mongoose = require('mongoose'); + +var app = express(); + +// register the express app with rest.io +restIO.restIO(app, { + resources: __dirname + '/resources' +}); + +mongoose.connect('mongodb://localhost:27017/test'); +app.listen(3000, function () { + console.log('Server has started under port: 3000'); +}); +module.exports = app; \ No newline at end of file diff --git a/rest-io/rest-io.d.ts b/rest-io/rest-io.d.ts new file mode 100644 index 000000000..a2dac465b --- /dev/null +++ b/rest-io/rest-io.d.ts @@ -0,0 +1,148 @@ +// Type definitions for rest-io 4.0 +// Project: https://github.com/EnoF/rest-io +// Definitions by: Andy Tang , Stefan Schacherl +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + + +declare module 'rest-io' { +import {Router, Application, Response, Request} from 'express'; + +import {Mongoose, Schema, Model, Document, Types, Promise} from 'mongoose'; + + function restIO(app: Application, config?: IRestIOConfig): RestIO; + + export interface RestIO { + resource: ResourceModule + } + + export interface IRestIOConfig { + resources: string; + db?: Mongoose; + } + + export interface ResourceModule { + Resource: Resource; + AuthorizedResource: AuthorizedResource; + authorizedResource: AuthorizedResourceModule; + UserResource: UserResource; + SubResource: SubResource; + } + + export class Resource { + baseUrl: string; + url: string; + parameterizedUrl: string; + model: Model; + resDef: IResource; + parentResource: Resource; + router: Router; + app: Application; + db: Mongoose; + paramId: string; + parentRef: string; + populate: string; + + constructor(resDef: IResource); + + createModel(resDef: IResource): Model; + + toClassName(name: string): string; + + setupRoutes(): void; + + getAll(req: Request, res: Response): void; + + buildParentSearch(req: Request): any; + + getById(req: Request, res: Response): void; + + create(req: Request, res: Response): void; + + update(req: Request, res: Response): void; + + del(req: Request, res: Response): void; + + errorHandler(err: Error, res: Response): void; + } + + export interface IResource { + name: string; + model: any; + parentRef?: string; + populate?: string; + plural?: string; + parentResource?: Resource; + } + + export interface AuthorizedResourceModule { + AuthorizedResource: AuthorizedResource + ROLES: Roles + } + + export interface Roles { + USER: string; + SUPER_USER: string; + MODERATOR: string; + ADMIN: string; + } + + export class AuthorizedResource extends Resource { + methodAccess: IMethodAccess; + + maxDays: number; + + permissions: IMethodAccess; + + isTokenExpired(createdAt: Date): boolean; + + getRoles(id: string): Promise; + + hasAuthorizedRole(roles: Array, authorizedRoles: Array): boolean; + + hasAccessRightsDefined(req: Request, authorizedRoles: Array): boolean; + + isAuthorized(req: Request, authorizedRoles: Array): boolean; + + sendUnauthorized(error: Error, res: Response): void; + } + + export interface IMethodAccess { + getAll: Array; + getById: Array; + create: Array; + update: Array; + del: Array; + } + + export class UserResource extends AuthorizedResource { + ensureBaseUserModel(model: any): void; + + createRoleModel(): void; + + isSelf(req: Request): boolean; + + login(req: Request, res: Response): void; + } + + export class SubResource extends Resource { + constructor(resDef: ISubResource); + + createProjectionQuery(req: Request): any; + + createPullQuery(req: Request): any; + + createFindQuery(req: Request): any; + + createSubUpdateQuery(req: Request): any; + } + + export interface ISubResource { + name: string; + plural?: string; + parentResource: Resource; + populate?: string; + } +} \ No newline at end of file From c5c929c4fb3383db5f4d78bba5e5fce81279b8a8 Mon Sep 17 00:00:00 2001 From: rhysd Date: Tue, 22 Sep 2015 00:38:55 +0900 Subject: [PATCH 05/18] fix isEnabled() method --- auto-launch/auto-launch-tests.ts | 9 ++++++++- auto-launch/auto-launch.d.ts | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/auto-launch/auto-launch-tests.ts b/auto-launch/auto-launch-tests.ts index 735985624..24d6aad14 100644 --- a/auto-launch/auto-launch-tests.ts +++ b/auto-launch/auto-launch-tests.ts @@ -14,4 +14,11 @@ var a2 = new AutoLaunch({ a1.enable(); a2.disable(); -var enabled: boolean = a1.isEnabled(); + +a1.isEnabled(function(enabled: boolean) { + if (enabled) { + return; + } + + a1.enable(function(err){ console.log(err.message); }); +}); diff --git a/auto-launch/auto-launch.d.ts b/auto-launch/auto-launch.d.ts index c208d10fd..0b277c79f 100644 --- a/auto-launch/auto-launch.d.ts +++ b/auto-launch/auto-launch.d.ts @@ -32,7 +32,7 @@ declare class AutoLaunch { /** * Returns if auto start up is enabled */ - isEnabled(callback?: (err: Error) => void): boolean; + isEnabled(callback: (enabled: boolean) => void): void; } declare module "auto-launch" { From 09d00974493060a4eec0ce0442e8e6c45878bae3 Mon Sep 17 00:00:00 2001 From: Shiak1 Date: Mon, 21 Sep 2015 14:11:48 -0400 Subject: [PATCH 06/18] Update AuthOptions interface. Missing bearer token https://github.com/request/request#http-authentication --- request/request.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/request/request.d.ts b/request/request.d.ts index a4507a6e2..a4c10a832 100644 --- a/request/request.d.ts +++ b/request/request.d.ts @@ -141,6 +141,7 @@ declare module 'request' { pass?: string; password?: string; sendImmediately?: boolean; + bearer?: string; } export interface OAuthOptions { From fe92aa252c8e90161de9d1a4430814fdaf4cae02 Mon Sep 17 00:00:00 2001 From: rushi216 Date: Tue, 22 Sep 2015 17:05:34 +0530 Subject: [PATCH 07/18] added extraPlugins property on configuration object --- ckeditor/ckeditor.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/ckeditor/ckeditor.d.ts b/ckeditor/ckeditor.d.ts index 3bb90c760..37e609484 100644 --- a/ckeditor/ckeditor.d.ts +++ b/ckeditor/ckeditor.d.ts @@ -572,6 +572,7 @@ declare module CKEDITOR { colorButton_colors?: string; startupFocus?: boolean; on?: any; + extraPlugins?: string; } From 2cb8fd4638231efd24929f99d56372bdb57d337b Mon Sep 17 00:00:00 2001 From: Paulo Cesar Date: Tue, 22 Sep 2015 09:35:19 -0300 Subject: [PATCH 08/18] update for 1.6 --- express-jwt/express-jwt.d.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/express-jwt/express-jwt.d.ts b/express-jwt/express-jwt.d.ts index 615afd2ac..77f296b1f 100644 --- a/express-jwt/express-jwt.d.ts +++ b/express-jwt/express-jwt.d.ts @@ -12,12 +12,22 @@ declare module "express-jwt" { function jwt(options: jwt.Options): jwt.RequestHandler; + interface IDoneCallback { + (err: Error, result: T): void; + } + + type ICallback = (req: express.Request, payload: T, done: IDoneCallback) => void; + module jwt { export interface Options { - secret: string; + secret: string|ICallback; userProperty?: string; skip?: string[]; credentialsRequired?: boolean; + isRevoked?: boolean; + requestProperty?: string; + getToken?: ICallback; + [property: string]: any; } export interface RequestHandler extends express.RequestHandler { unless?: typeof unless; From ae656fbca140033ed13c12e536cd6a2f66d4ed69 Mon Sep 17 00:00:00 2001 From: Nicola Sanitate Date: Tue, 22 Sep 2015 14:38:08 +0200 Subject: [PATCH 09/18] Fix typo in DropzoneOptions interface --- dropzone/dropzone.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dropzone/dropzone.d.ts b/dropzone/dropzone.d.ts index 50dd433e3..93f9ca25b 100644 --- a/dropzone/dropzone.d.ts +++ b/dropzone/dropzone.d.ts @@ -41,7 +41,7 @@ interface DropzoneOptions { filesizeBase?: number; maxFiles?: number; params?: {}; - headers?: {}, + headers?: {}; clickable?: boolean|string|HTMLElement|(string|HTMLElement)[]; ignoreHiddenFiles?: boolean; acceptedFiles?: string; From 01e5a67adccfe86516432c18f79e52788440de00 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Date: Tue, 22 Sep 2015 10:10:05 -0300 Subject: [PATCH 10/18] missing non-optional email, fixes for 1.6 --- mailcheck/mailcheck.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/mailcheck/mailcheck.d.ts b/mailcheck/mailcheck.d.ts index 64b5f93c4..66d90ba0c 100644 --- a/mailcheck/mailcheck.d.ts +++ b/mailcheck/mailcheck.d.ts @@ -46,6 +46,7 @@ declare module MailcheckModule { } export interface IOptions { + email: string; domains?: string[]; secondLevelDomains?: string[]; topLevelDomains?: string[]; From 63e8414266d3d547cf50220628acb96ab1e7efa3 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Date: Tue, 22 Sep 2015 10:11:13 -0300 Subject: [PATCH 11/18] update test --- mailcheck/mailcheck-tests.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mailcheck/mailcheck-tests.ts b/mailcheck/mailcheck-tests.ts index 4a5caa12a..b3152b1d9 100644 --- a/mailcheck/mailcheck-tests.ts +++ b/mailcheck/mailcheck-tests.ts @@ -14,6 +14,7 @@ var superStringDistance = function(string1: string, string2: string): number { $('#email').on('blur', function() { $(this).mailcheck({ + email: 'nonoptional@example.com', domains: domains, // optional secondLevelDomains: secondLevelDomains, // optional topLevelDomains: topLevelDomains, // optional @@ -28,6 +29,7 @@ $('#email').on('blur', function() { }); Mailcheck.run({ + email: 'nonoptional@example.com', domains: domains, // optional secondLevelDomains: secondLevelDomains, // optional topLevelDomains: topLevelDomains, // optional @@ -41,6 +43,7 @@ Mailcheck.run({ }); MC.run({ + email: 'nonoptional@example.com', domains: domains, // optional secondLevelDomains: secondLevelDomains, // optional topLevelDomains: topLevelDomains, // optional From 73d4a4660b3cf57cacb22629f1c6260273f6ebad Mon Sep 17 00:00:00 2001 From: hansrwindhoff Date: Tue, 22 Sep 2015 22:02:13 -0600 Subject: [PATCH 12/18] Update node.d.ts --- node/node.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/node/node.d.ts b/node/node.d.ts index 7498e401f..2dfa0fc2b 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1772,6 +1772,7 @@ declare module "util" { export function isDate(object: any): boolean; export function isError(object: any): boolean; export function inherits(constructor: any, superConstructor: any): void; + export function debuglog(key:string): (msg:string,...param: any[])=>void; } declare module "assert" { From 67e5a7613cf81cc50aa844473c9b84f3bf3502cd Mon Sep 17 00:00:00 2001 From: rushi216 Date: Wed, 23 Sep 2015 10:23:51 +0530 Subject: [PATCH 13/18] added height, toolbarlocation, readonly properties in config object --- ckeditor/ckeditor.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ckeditor/ckeditor.d.ts b/ckeditor/ckeditor.d.ts index 37e609484..a8f268074 100644 --- a/ckeditor/ckeditor.d.ts +++ b/ckeditor/ckeditor.d.ts @@ -573,6 +573,9 @@ declare module CKEDITOR { startupFocus?: boolean; on?: any; extraPlugins?: string; + height?: string | number; + toolbarLocation?: string; + readOnly?: boolean; } From 4087da1722026728c2741331b8fe57337cbb9a4b Mon Sep 17 00:00:00 2001 From: Adam Roderick Date: Tue, 22 Sep 2015 23:11:07 -0600 Subject: [PATCH 14/18] Update diff.d.ts JsDiff can now diff javascript objects with the "diffJson" function. --- diff/diff.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/diff/diff.d.ts b/diff/diff.d.ts index 9ccbb10a8..f5c2cc48f 100644 --- a/diff/diff.d.ts +++ b/diff/diff.d.ts @@ -39,6 +39,8 @@ declare module JsDiff { function diffWordsWithSpace(oldStr:string, newStr:string):IDiffResult[]; + function diffJson(oldObj: Object, newObj: Object): IDiffResult[]; + function diffLines(oldStr:string, newStr:string):IDiffResult[]; function diffCss(oldStr:string, newStr:string):IDiffResult[]; From 8287192198a14bcb31533afe381aa24ac7eed4c6 Mon Sep 17 00:00:00 2001 From: Jason Killian Date: Wed, 23 Sep 2015 11:58:31 -0400 Subject: [PATCH 15/18] Accept arrays and nested arrays as classNames does --- classnames/classnames-tests.ts | 9 ++++++++- classnames/classnames.d.ts | 8 ++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/classnames/classnames-tests.ts b/classnames/classnames-tests.ts index 7b085c4fb..3c3086c51 100644 --- a/classnames/classnames-tests.ts +++ b/classnames/classnames-tests.ts @@ -8,9 +8,16 @@ classNames('foo', 'bar'); // => 'foo bar' classNames('foo', { bar: true }); // => 'foo bar' classNames({ foo: true }, { bar: true }); // => 'foo bar' classNames({ foo: true, bar: true }); // => 'foo bar' +classNames(10, 11); // => '10 11'; // lots of arguments of various types -classNames('foo', { bar: true, duck: false }, 'baz', { quux: true }) // => 'foo bar baz quux' +classNames('foo', { bar: true, duck: false }, 'baz', { quux: true }); // => 'foo bar baz quux' + +classNames(['foo', 'bar', 'baz']); // => 'foo bar baz' +classNames([1, 2, 3]); // => '1 2 3' +classNames([{ foo: true, bar: false }, { baz: true }]); // => 'foo baz' + +classNames(["foo", ["bar", {baz: true}]]); // => 'foo bar baz' // other falsy values are just ignored // NOTE: We don't really want to allow this kind of thing with Typescript (otherwise what's the point!) diff --git a/classnames/classnames.d.ts b/classnames/classnames.d.ts index 22ab1858a..58a3e096f 100644 --- a/classnames/classnames.d.ts +++ b/classnames/classnames.d.ts @@ -1,14 +1,18 @@ // Type definitions for classnames // Project: https://github.com/JedWatson/classnames -// Definitions by: Dave Keen , Adi Dahiya +// Definitions by: Dave Keen , Adi Dahiya , Jason Killian // Definitions: https://github.com/borisyankov/DefinitelyTyped +declare type ClassValue = string | number | ClassDictionary | ClassArray; + interface ClassDictionary { [id: string]: boolean; } +interface ClassArray extends Array { } + interface ClassNamesFn { - (...classes: (string | ClassDictionary)[]): string; + (...classes: ClassValue[]): string; } declare var classNames: ClassNamesFn; From 99ceaf2b88d5226a6cfd13114bf560a97ca2707d Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Wed, 23 Sep 2015 23:19:26 +0300 Subject: [PATCH 16/18] Added definitions for geoip-lite --- geoip-lite/geoip-lite-tests.ts | 19 +++++++++++++++++++ geoip-lite/geoip-lite.d.ts | 22 ++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 geoip-lite/geoip-lite-tests.ts create mode 100644 geoip-lite/geoip-lite.d.ts diff --git a/geoip-lite/geoip-lite-tests.ts b/geoip-lite/geoip-lite-tests.ts new file mode 100644 index 000000000..fb809369b --- /dev/null +++ b/geoip-lite/geoip-lite-tests.ts @@ -0,0 +1,19 @@ +/// + +// require geoip-lite +import geoip = require('geoip-lite'); + +// lookup an IP addres +var geo = geoip.lookup('199.16.156.125'); + +// convert the ip block range to string +if (geo) { + let rangeStart = geoip.pretty(geo.range[0]); + let rangeEnd = geoip.pretty(geo.range[1]); +} + +// start the data update watcher +geoip.startWatchingDataUpdate(); + +// stop the data update watcher +geoip.stopWatchingDataUpdate(); diff --git a/geoip-lite/geoip-lite.d.ts b/geoip-lite/geoip-lite.d.ts new file mode 100644 index 000000000..7e5057d49 --- /dev/null +++ b/geoip-lite/geoip-lite.d.ts @@ -0,0 +1,22 @@ +// Type definitions for GeoIP-lite 1.1.6 +// Project: https://github.com/bluesmoon/node-geoip +// Definitions by: Yuce Tekol +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'geoip-lite' { + module mod { + export interface Lookup { + range: Array; // range start, end + country: string; + region: string; + city: string; + ll: Array; // latitude, longitude + } + + export function lookup(ip: string): Lookup; + export function pretty(ip: number): string; + export function startWatchingDataUpdate(): void; + export function stopWatchingDataUpdate(): void; + } + export = mod; +} From 750135879ebbb4d92f0e90544d5a6694696340ed Mon Sep 17 00:00:00 2001 From: Julio Casal Date: Wed, 23 Sep 2015 16:28:16 -0700 Subject: [PATCH 17/18] Add support for Spec Picker, add By.text(), refactor ActionBars --- msportalfx-test/msportalfx-test-tests.ts | 22 +++++++++++---- msportalfx-test/msportalfx-test.d.ts | 36 ++++++++++++++++++++---- 2 files changed, 48 insertions(+), 10 deletions(-) diff --git a/msportalfx-test/msportalfx-test-tests.ts b/msportalfx-test/msportalfx-test-tests.ts index 4bf402d1b..98f86dcd4 100644 --- a/msportalfx-test/msportalfx-test-tests.ts +++ b/msportalfx-test/msportalfx-test-tests.ts @@ -34,6 +34,7 @@ function TestPortal() { var bladePromise = testFx.portal.openResourceBlade(resourceId, summaryBlade.title, 20000) var stringPromise = testFx.portal.takeScreenshot("TestPortal"); var stringArrayPromise = testFx.portal.getBrowserLogs(testFx.LogLevel.All); + anyPromise = testFx.portal.waitUntilElementDoesNotContainAttribute(testFx.Locators.By.className('part'), 'class', 'invalid'); } function TestBlades() { @@ -41,14 +42,16 @@ function TestBlades() { blade.clickCommand('Delete'); var createBlade = new testFx.Blades.CreateBlade(bladeTitle); - voidPromise = createBlade.actionBar.clickCreate(); - voidPromise = createBlade.actionBar.clickDelete(); + voidPromise = createBlade.actionBar.createButton.click(); var browseBlade = new testFx.Blades.BrowseResourceBlade(bladeTitle); voidPromise = browseBlade.selectResource(resourceName); var pickerBlade = new testFx.Blades.PickerBlade(bladeTitle); pickerBlade.pickItem('abc'); + + var specPickerBlade = new testFx.Blades.SpecPickerBlade(bladeTitle); + specPickerBlade.pickSpec('S2'); } function TestParts() { @@ -60,6 +63,9 @@ function TestParts() { var resourceSummary = new testFx.Parts.ResourceSummaryPart(summaryBlade.getLocator()); var count = resourceSummary.properties.length; + + var pricingTier = new testFx.Parts.PricingTierPart(summaryBlade.getLocator()); + voidPromise = pricingTier.click(); } function TestControls() { @@ -75,7 +81,13 @@ function TestControls() { } function TestActionBars() { - var bar = new testFx.ActionBars.ActionBar(summaryBlade.getLocator()); - voidPromise = bar.clickCreate(); - voidPromise = bar.clickDelete(); + var createBar = new testFx.ActionBars.CreateActionBar(summaryBlade.getLocator()); + voidPromise = createBar.createButton.click(); + + var deleteBar = new testFx.ActionBars.DeleteActionBar(summaryBlade.getLocator()); + voidPromise = deleteBar.deleteButton.click(); + voidPromise = deleteBar.cancelButton.click(); + + var pickerBar = new testFx.ActionBars.PickerActionBar(summaryBlade.getLocator()); + voidPromise = pickerBar.selectButton.click(); } \ No newline at end of file diff --git a/msportalfx-test/msportalfx-test.d.ts b/msportalfx-test/msportalfx-test.d.ts index cb0d6de41..5ba413484 100644 --- a/msportalfx-test/msportalfx-test.d.ts +++ b/msportalfx-test/msportalfx-test.d.ts @@ -38,16 +38,35 @@ declare module MsPortalTestFx { static partialLinkText(value: string): Locator; static tagName(value: string): Locator; static xpath(value: string): Locator; + static text(value: string): Locator; static chained(...values: Locator[]): Locator; static content(...values: Locator[]): Locator; } } export module ActionBars { - export class ActionBar extends MsPortalTestFx.PortalElement { + export class ActionBarButton extends PortalElement { + constructor(parentLocator?: Locators.Locator, baseLocator?: Locators.Locator); + click(): Q.Promise; + } + + export class CreateActionBar extends PortalElement { + public createButton: ActionBarButton; + + constructor(parentLocator?: Locators.Locator); + } + + export class DeleteActionBar extends PortalElement { + public deleteButton: ActionBarButton; + public cancelButton: ActionBarButton; + + constructor(parentLocator?: Locators.Locator); + } + + export class PickerActionBar extends PortalElement { + public selectButton: ActionBarButton; + constructor(parentLocator?: Locators.Locator); - clickCreate(): Q.Promise; - clickDelete(): Q.Promise; } } @@ -60,7 +79,7 @@ declare module MsPortalTestFx { } export class CreateBlade extends Blade { - public actionBar: ActionBars.ActionBar; + public actionBar: ActionBars.CreateActionBar; } export class BrowseResourceBlade extends Blade { @@ -70,9 +89,12 @@ declare module MsPortalTestFx { } export class PickerBlade extends Blade { - constructor(title: string); pickItem(item: string): Q.Promise; } + + export class SpecPickerBlade extends Blade { + pickSpec(specCode: string): Q.Promise; + } } export module Controls { @@ -137,6 +159,9 @@ declare module MsPortalTestFx { constructor(parentLocator?: Locators.Locator); } + class PricingTierPart extends Part { + } + export class Tile extends MsPortalTestFx.PortalElement { public progressLocator: Locators.Locator; @@ -201,6 +226,7 @@ declare module MsPortalTestFx { getAttribute(locator: Locators.Locator, attributeName: string, timeout?: number): Q.Promise; waitForElementNotVisible(locator: Locators.Locator, timeout?: number): Q.Promise; waitUntilElementContainsAttribute(locator: Locators.Locator, attributeName: string, attributeValue: string, timeout?: number): Q.Promise; + waitUntilElementDoesNotContainAttribute(locator: Locators.Locator, attributeName: string, attributeValue: string, timeout?: number): Q.Promise; waitForElementLocated(locator: Locators.Locator, timeout?: number): Q.Promise; takeScreenshot(filePrefix?: string): Q.Promise; goHome(timeout?: number): Q.Promise; From 6bc6cddfd9498ce23e6a7d8e44e7ef295d69749a Mon Sep 17 00:00:00 2001 From: Jonathan Carvalhosa Date: Thu, 24 Sep 2015 19:28:09 -0300 Subject: [PATCH 18/18] adding matchAny to should.d.ts --- should/should.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/should/should.d.ts b/should/should.d.ts index a787b622c..ba32f571b 100644 --- a/should/should.d.ts +++ b/should/should.d.ts @@ -49,6 +49,10 @@ interface ShouldAssertion { matchEach(other: (val: any) => any, description?: string): ShouldAssertion; matchEach(regexp: RegExp, description?: string): ShouldAssertion; matchEach(other: any, description?: string): ShouldAssertion; + matchAny(other: {}, description?: string): ShouldAssertion; + matchAny(other: (val: any) => any, description?: string): ShouldAssertion; + matchAny(regexp: RegExp, description?: string): ShouldAssertion; + matchAny(other: any, description?: string): ShouldAssertion; length(n: number, description?: string): ShouldAssertion; property(name: string, description?: string): ShouldAssertion; property(name: string, val: any, description?: string): ShouldAssertion;