Skip to main content

Testing and Debug

Prepare Eclipse Plug-in

  1. Compile Web Module with ngv build command

  2. If concierge.conf.js is created then compiled web module can be found under path provided there. Usually it should be web/redappid-module_name/. Alternatively prepare package manually:

    1. After completing the Web Module development, create another directory structure web/redappid-module_name folder under root of Red App plug-in project.

      For example, web/formplugin-sabre-sdk-sample-form

    2. Next, locate the folder in your module directory. (for example: web-src/redappid-module_name/build/dist).

    3. You will find all compiled files needed for running your Web Module. Copy those files to web/redappid-module_name directory in your Red App plugin (in Eclipse).  

      (Example: com.sabre.redapp.example3.web.form\web\formplugin-sabre-sdk-sample-form)

      'manifest.js' - module’s manifest.

      'module.js' - AMD module with compiled TS code.

      'module.d.ts' - typings file contains public API’s.

      'styles.css' - CSS styles provided by module.

      'templates.js' - pre-compiled templates.

      'translations.js' - translations provided by module

      'assets/*' - in assets directory module you can provide any files like images, fonts, etc.

  3. Provide an extension point to load your Web Module.

    In plugin.xml file add below code and change module ID to yours.

    <extension point="com.sabre.edge.dynamo.web.module">
        <modules>
          <module id="formplugin-sabre-sdk-sample-form"/>
        </modules>
    </extension>
    Important
    The web module id must match the pattern: redappid-name_of_the_web_module

    Alternatively, while developing Web Module, using the following VM Argument will avoid copying and pasting the compiled Web Module code manually under the Eclipse Red App plug-in.

    This option works in development mode only.

    Example sabre.ini in SR360 standard installer
    -Dcom.sabre.edge.dynamo.web.module.path=c://workspace/redappid-module_name/build/dist
    Example sabre.ini in SR360 New Provisioning
    vmarg.XX=-Dcom.sabre.edge.dynamo.web.module.path=c://workspace/redappid-module_name/build/dist// (1)
    1. XX is next number of vmarg property in sabre.ini file

Test and Debug

Launch Sabre Red 360 from Eclipse and your modules will be loaded

When you edit any source files, you need to run 'ngv build' command again before copying the files to your Eclipse plug-in.

Reloading Web Modules

During TypeScript development, you can auto reload code changes in TS/JS/HTML files without restarting Sabre Red 360 application by pressing CTRL+R or by clicking View→Reload from Menu (shown in below screenshot).

This will auto reload your Web Modules.

image

Debugging Web Modules

To debug any TypeScript Web Module, follow the below step by step procedure.

  1. Include source map files in the build.

    Include module.js.map and styles.css.map to build the path. The ‘ngv build’ command includes source map files by default when generating the build files.

  2. Enable JxBrowser remote debug capability.

    Prepare JxBrowser to start in debug mode by setting below VM argument in run configurations.

    Example sabre.ini in SR360 standard installer
    -Ddynamo_testing_remote_debugging=true
    Example sabre.ini in SR360 New Provisioning
    vmarg.XX=-Dedge.bot.port.user.profile=1997 // (1)
    1. XX is next number of vmarg property in sabre.ini file

  3. Access debug tool.

    Setting the above property enables user to access debug tool either by accessing http://localhost:9222 from any browser that supports debugging or by using the SDK in-built debug editor.

    Note
    To debug from Chrome browser, make sure that the browser version is the same as JxBrowser Chromium version of SR360.

    SDK in-built debug tool can be accessed from menu (Tools→ Other → Browser Debug Tool). By default, this tool opens as tabbed editor and can be moved as shown below by dragging the editor by holding on the tab.

    Once that editor opens, click the ‘SRW 3.0’ link to navigate to debug tool.

    Now sources tab will show the source files loaded for SR360 and Web Modules that are included.

    image51

SWS mocks

If you want to use SWS mocked responses you need to perform two steps:

  1. In Eclipse go to Run configurations and in plug-ins tab set Auto-Start for com.sabre.edge.platform.optional.sandbox to TRUE.

  2. Before using SWS mocks send the ¤ (change) command using command panel under Manual Command mode.

Loading external web modules in eclipse

It is possible to load any web module without including it into redapp, purely for testing purposes. All you need to do is to change com.sabre.edge.dynamo.web.module.path VM parameter to path pointing at webmodule’s build/prod or other build/ subfolder.

Additionally this property supports loading multiple web modules by passing comma separated paths.