Generate XRM form models for xrm-mock test framework.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
XrmMockGenerator
.gitattributes
.gitignore
LICENSE
README.md
XrmMockGenerator.sln

README.md

DynamicsCrm-xrm-mock-Generator

Join the chat at https://gitter.im/yagasoft/DynamicsCrm-xrm-mock-Generator

Version: 1.3.1.2


An XrmToolBox plugin that can be used to generate the XRM form model for xrm-mock testing framework.

Prerequisites

Offline

The following packages must be installed before using the generated model:

  • @types/xrm
  • xrm-mock

For convenience, run the following command:

npm i -D @types/xrm xrm-mock

Important note

This generator targets a version of xrm-mock that has not been released yet. Replace node_modules/xrm-mock folder in your project with the contents of this archive: link

Online

The following packages must be installed before enabling online communication:

  • @types/jquery
  • @types/jsdom
  • @types/sinon
  • jquery
  • jsdom
  • node-dcrm-service
  • sinon

For convenience, run the following command:

npm i -D @types/jquery @types/jsdom @types/sinon @types/xrm jquery jsdom node-dcrm-service sinon xrm-mock

Usage

  • Load data
  • Choose an entity
  • Select forms
  • Generate model
  • Build the model before testing
const builder = new XrmModel.ModelBuilder(new XrmModel.account());
builder.selectForm("Account");
builder.buildModel();

Enable online communication

The model generated supports forwarding HTTP requests from Xrm.WebApi and jQuery to CRM. Otherwise, the function must be stubbed manually, or an error will be produced.

const config = {<...>}
builder.enableOnlineWebApi(config)
   .then(() => Contact_OnLoad());

Configuration details can be found at DynamicsCrm-NodeCrmService.

Credit

Changes

v1.3.1.2 (2018-09-07)

  • Added: option to skip generate online communication code
  • Fixed: Early-bound conflict with other plugins

v1.2.2.3 (2018-08-28)

  • Added: boolean control support
  • Changed: plugin colours

v1.2.1.6 (2018-08-27)

  • Added: online communication option
  • Added: option to specify org URL for use with getClientUrl

v1.1.5.4 (2018-08-22)

  • Added: min, max, and precision of numbers
  • Added: max length of strings
  • Added: initial value of option-sets and booleans
  • Fixed: attribute type issue during initialisation

v1.1.4.3 (2018-08-21)

  • Fixed: labels and options not properly set

v1.1.3.3 (2018-08-21)

  • Fixed: imports
  • Fixed: constructor parameter type
  • Fixed: removed redundant folder in package

v1.1.2.2 (2018-08-19)

  • Fixed: control creation error in template
  • Fixed: sections array error in template
  • Fixed: misidentifying grids in form XML

v1.1.1.3 (2018-08-18)

  • Added: entity filter
  • Added: button icons
  • Added: reuse latest path to save/load settings

v1.0.3.2 (2018-08-17)

  • Initial release

Copyright © by Ahmed el-Sawalhy (Yagasoft) -- GPL v3 Licence