18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

TypeScript integration

vladvlad Members
Did some one tried the integration with TypeScript?
(e.g. create some project-wide libraries, that can be used from *.sah files)

Comments

  • vladvlad Members
    edited May 2018
    It turned out, that it's enough to write some stubs for sahi functions to be able to integrate it with typescript e.g. in a sahi_apis.ts:

    function _click ($element:any|null, $combo?:any|null){}
    function _link(el:any|null, domRelation?:any|null){}
    function _cell(el:any|null, domRelation?:any|null){}
    function _wait(time){}


    Instead of argument types any you could try to provide some real types to enable the actual type-checking.
    All you need then is to compile yout sahi_apis.ts with tsc and to use in your TypeScript classes with Reference syntax:

    /// <reference path="../../libs/sahi_apis.ts" />
  • vladvlad Members
    It turned out, that it's enough to write some stubs for sahi functions to be able to integrate it with typescript e.g. in a sahi_apis.ts:

    function _click ($element:any|null, $combo?:any|null){}
    function _link(el:any|null, domRelation?:any|null){}
    function _cell(el:any|null, domRelation?:any|null){}
    function _wait(time){}


    Instead of argument types any you could try to provide some real types to enable the actual type-checking.
    All you need then is to compile yout sahi_apis.ts with tsc and to use in your TypeScript classes with Reference syntax:

    /// <reference path="../../libs/sahi_apis.ts" />
Sign In or Register to comment.