/testcomplete-typescript

TestComplete framework and definition files written in TypeScript

Primary LanguageTypeScript

testcomplete-typescript

TestComplete framework and definition files written in TypeScript

Video Blog Series

Links

Notes

Visual Studio Code Keyboard Shortcuts

  • Ctrl-shift-B: run build task
  • Format: shift-alt-F
  • JSDOC: /**

Sample tsconfig.json file

{
  "compilerOptions": {
    "noLib": true,
    "target": "es3",
    "rootDir": ".\\ts\\",
    "outDir": ".",
    "diagnostics": true,
    "noImplicitAny": false,
    "noEmitHelpers": false,
    "removeComments": false,
    "declaration": false
  },
  "exclude": [
    "typings"
  ]
}

First TypeScript Object

class Desktop {
  public Name: string;

  constructor(message: string) {
    this.Name = message;
  }
}

Hide unneeded files to reduce noise: Sample Settings.json

{
    "files.exclude": {
        "**/*.tcScript": true,
        "**/*.js": true,
        "**/*.sj": true,
        "**/*.bak": true
    }
}

Use TestComplete objects Sys.Desktop and Log in TypeScript

declare var Log: any;
declare var Sys: any;

class Desktop {
  public Name: string;

  constructor(message: string) {
    this.Name = message;
  }

  public screenshot() {
    Log.Picture(Sys.Desktop.Picture(), "Screenshot of " + this.Name);
  }
}

function test() {
  var desktop = new Desktop("Desktop");
  desktop.screenshot();
}