All Projects → camelCaseDave → xrm-mock-generator

camelCaseDave / xrm-mock-generator

Licence: other
📖  Generates a mock Xrm.Page object. Commonly used by xrm-mock to test Dynamics 365 client-side customisations.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to xrm-mock-generator

xrm-mock
📚 A fake implementation of the Xrm object model. Written in TypeScript against @types/xrm definitions.
Stars: ✭ 64 (+326.67%)
Mutual labels:  mock, dynamics-crm, dynamics-365, xrm, unit-test, microsoft-dynamics-365
powerapps-specflow-bindings
A SpecFlow bindings library for model-driven Power Apps.
Stars: ✭ 19 (+26.67%)
Mutual labels:  dynamics-crm, dynamics-365, xrm
Xrm-Quick-Edit
A Dynamics CRM Add-In for speeding up tasks such as translating or toggling field security on or off
Stars: ✭ 13 (-13.33%)
Mutual labels:  dynamics-crm, dynamics-365, xrm
DynamicsNode
Create simple scripts to interact with Dynamics CRM using Node.js
Stars: ✭ 27 (+80%)
Mutual labels:  dynamics-crm, dynamics-365, xrm
generator-nullfactory-xrm
Yeoman generator for Dynamics 365 Solutions. It generates a project structure that facilitates the quick creation builds and automated release strategies with minimal effort.
Stars: ✭ 15 (+0%)
Mutual labels:  dynamics-crm, dynamics-365, xrm
integration-dynamics
The easiest way to connect Dynamics 365 with WordPress.
Stars: ✭ 17 (+13.33%)
Mutual labels:  dynamics-crm, dynamics-365
Microsoft.Xrm.DevOps.Data
This library provides an easy way to generate filtered data compatible with the Configuration Data Migration Tool. These zip files can be used to push specific records between Dynamics 365 environments using the Dynamics 365 Package Deployer.
Stars: ✭ 20 (+33.33%)
Mutual labels:  dynamics-crm, dynamics-365
Innofactor.Crm.CI
DevOps tools for Microsoft Dynamics 365
Stars: ✭ 23 (+53.33%)
Mutual labels:  dynamics-crm, dynamics-365
crm-powerbi-viewer
Embed tiles and reports from Power BI into Dynamics CRM Forms and Dashboards.
Stars: ✭ 24 (+60%)
Mutual labels:  dynamics-crm, dynamics-365
development-hub
A continuous integration solution for Power Apps.
Stars: ✭ 21 (+40%)
Mutual labels:  dynamics-crm, dynamics-365
mockingbird
🐦 Decorator Powered TypeScript Library for Creating Mocks
Stars: ✭ 70 (+366.67%)
Mutual labels:  mock, unit-test
kmpapp
👨‍💻 Kotlin Mobile Multiplatform App (Android & iOS). One Code To Rule Them All. MVVM, DI (Kodein), coroutines, livedata, ktor, serialization, mockk, detekt, ktlint, jacoco
Stars: ✭ 34 (+126.67%)
Mutual labels:  mock, unit-test
cds-for-code
VSCode extension for working with Microsoft Common Data Service (CDS)
Stars: ✭ 22 (+46.67%)
Mutual labels:  dynamics-crm, dynamics-365
Daxif
A framework for automating a lot of xRM development processses. By using simple F# script commands/files one can save a lot of time and effort during this process by using Delegates DAXIF# library.
Stars: ✭ 37 (+146.67%)
Mutual labels:  dynamics-crm, dynamics-365
Advanced-MultiSelect-for-Dynamics
Advanced MultiSelect for Dynamics 365 / Dynamics CRM is a multi-select / multi-checkbox control on a form. It represents a set of related data items (based on N:N relations + FetchXml) and gives a user an ability to associate/disassociate records of related entities in a quick and convenient way.
Stars: ✭ 14 (-6.67%)
Mutual labels:  dynamics-crm, dynamics-365
Dynamics365BulkSolutionExporter
[Work In Progress] Take backup of whole D365 organization or export multiple solutions.
Stars: ✭ 30 (+100%)
Mutual labels:  dynamics-crm, dynamics-365
php-crm-toolkit
Dynamics CRM Toolkit for PHP
Stars: ✭ 94 (+526.67%)
Mutual labels:  dynamics-crm, dynamics-365
automock
A library for testing classes with auto mocking capabilities using jest-mock-extended
Stars: ✭ 26 (+73.33%)
Mutual labels:  mock, unit-test
Fflib Apex Mocks
An Apex mocking framework for true unit testing in Salesforce, with Stub API support
Stars: ✭ 253 (+1586.67%)
Mutual labels:  mock, unit-test
Okhttp Json Mock
Mock your datas for Okhttp and Retrofit in json format in just a few moves
Stars: ✭ 231 (+1440%)
Mutual labels:  mock

29/03/18 This project is no longer being maintained. It has been merged into xrm-mock.

📖 xrm-mock-generator

Generates a mock Xrm.Page object.

Commonly used by xrm-mock to test Dynamics 365 client-side customisations.

Usage

  • install via npm install xrm-mock-generator

  • import var XrmMockGenerator = require("xrm-mock-generator");

  • initialise a global Xrm object var Xrm = XrmMockGenerator.initialise();

You now have a global Xrm object, as if you had loaded a form in CRM.

Add additional attributes

Create a string attribute and add it to global.Xrm

var stringAttribute = XrmMockGenerator.Attribute.createString("firstname", "Joe");

Boolean Attribute

var boolAttribute = XrmMockGenerator.Attribute.createBool("new_havingFun", true);

Date Attribute

var dateAttribute = XrmMockGenerator.Attribute.createDate("birthdate", new Date(1980, 12, 25));

DateTime Attribute

var dateTimeAttribute = XrmMockGenerator.Attribute.createDateTime("birthdate", new Date(1980, 12, 25));

Number Attribute

var numberAttribute = XrmMockGenerator.Attribute.createNumber("units", 2, 0, 10, 0);

OptionSet Attribute

var optionSetAttribute = XrmMockGenerator.Attribute.createOptionSet("countries", [
    { "Austria" : 0 },
    { "France", : 1 },
    { "Spain", 2 }
]);

Lookup Attribute

var lookupAttribute = XrmMockGenerator.Attribute.createLookup("primarycustomerid", {
  id: "{00000000-0000-0000-0000-000000000000}",
  entityType: "contact",
  name: "Joe Bloggs"
});

Example

This example showcases a contact form that changes the contact's firstname from Joe to Bob when the form is loaded.

src/contact.js

(function () {
    "use strict";
    
    var Contact = () => {  };
    
    Contact.prototype.onLoad = function () {
        Xrm.Page.getAttribute("firstname").setValue("Bob");
    }
    
    // node
    module.exports = new Contact();
    
    // browser
    global.Contact = new Contact();    
}());

test/contact.test.js

describe("Contact Form", () => {
    var XrmMockGenerator = require("xrm-mock-generator");
    var ContactForm = require("../src/contact.js");
    
    beforeEach(() => {
        XrmMockGenerator.initialise();
        XrmMockGenerator.createString("firstname", "Joe");
    });
    
    describe("default", () => {
        expect(Xrm.Page.getAttribute("firstname").getValue()).toBe("Joe"); // true
    });
    
    describe("onLoad", () => {
        Contact.onLoad();        
        expect(Xrm.Page.getAttribute("firstname").getValue()).toBe("Bob"); // true
    });
});

❤️  Roadmap

  • Automatically create attribute metadata from a Dynamics 365 instance
  • Create a d.ts file so that the project is consumable via TypeScript
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].