Giter Club home page Giter Club logo

sdb.js's Introduction

Sdb.js

Based on Tizen WebApp SDB Command Line Devtools. You can use these npm package to install/uninstall your app by javascirpt.

Sdb.js support .wgt & .tpk Tizen App.

Sdb.js only support network connect, not support serial connect. So you need open ssh server on your tv or emulator first. If not, Sdb.js can not work.

Installation

Need install sshpass first:

$ npm install git+https://[email protected]/sutaking/sdb.js.git#master

// If you donot know how to open debug mode of tv, you can try these.
// sdb.js will try open it with shell.
$ sudo apt-get install sshpass

Usage

How to install/uninstall your app to Tizen TV.

let tv = new Sdb({
    // these opts are required
    tv:"192.168.121.93",
    user: "root", // ssh accout
    pwd: "123456", // ssh pwd
    host: '192.168.121.146',// your ssh host device ip.

    // Not required, if you want named your app on tv, you need use it.
    // if not, sdb.js will named defualt as 'testApp'
    // Have a unique name to your app, it will be help for 'ps -ef|grep xxx' to check usage of cpu & memory.
    appUUid: '3201701011486',
    appTizenId: 'zcwsruDJBm.CAPHTESTSUITEANGULAR'
});

// Step 1. start connect tv
tv.connect();

// Step 2. install your app
tv.installByFile('/home/zhaof/10.webDriver/3201701011486_1.0.2.wgt');

// you can also install app by uuid, if your app already upload to Samsung Store.
tv.installByAppId('3201701011486');

// Step 3. launch your app on Tv
tv.launch();

// Step 4. Termination your app
// If you want launch your app again, you can call launch().
tv.kill()

// Step 5. Uninstall your app on Tv
tv.uninstall();

// You also can print your app log from tv.
// It like chrome devtools Console output.
tv.tvLog('ConsoleMessage');

How to using webDriver to build E2E TEST of your app on Tizen TV. More see Example

// As Setp 3, If you want using webdriver to your app, you donot using launch().
// You need instead of launchDebug()
// These function can return Pid & debug Port of your app.
let info = tv.launchDebug();

info = {
    pid,
    port
}

// The port will be using to chromedriver for create session.
var chrome_options = new chrome.Options();
chrome_options.options_["debuggerAddress"] = tvpi + ":" + info.port;

// driver wil be work.
var driver = chrome.Driver.createSession(chrome_options, service);
driver.findElement(xxx)

License

MIT

sdb.js's People

Contributors

sutaking avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

skdhruv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.