{"id":27105154,"url":"https://github.com/xrm-oss/d365-ui-test","last_synced_at":"2025-04-06T18:36:57.410Z","repository":{"id":37171281,"uuid":"194563288","full_name":"XRM-OSS/D365-UI-Test","owner":"XRM-OSS","description":"An unopinionated UI testing library for Dynamics 365 CE and Dynamics Portals. Powered by TypeScript and playwright","archived":false,"fork":false,"pushed_at":"2023-04-24T11:07:28.000Z","size":1948,"stargazers_count":59,"open_issues_count":19,"forks_count":13,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-07-30T19:55:58.510Z","etag":null,"topics":["crm","d365","dynamics","playwright","test","ui","xrm"],"latest_commit_sha":null,"homepage":"https://xrm-oss.github.io/D365-UI-Test/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XRM-OSS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-30T21:33:20.000Z","updated_at":"2024-07-23T10:15:13.000Z","dependencies_parsed_at":"2023-02-01T17:45:56.508Z","dependency_job_id":null,"html_url":"https://github.com/XRM-OSS/D365-UI-Test","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRM-OSS%2FD365-UI-Test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRM-OSS%2FD365-UI-Test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRM-OSS%2FD365-UI-Test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRM-OSS%2FD365-UI-Test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XRM-OSS","download_url":"https://codeload.github.com/XRM-OSS/D365-UI-Test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247534604,"owners_count":20954565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crm","d365","dynamics","playwright","test","ui","xrm"],"created_at":"2025-04-06T18:36:56.829Z","updated_at":"2025-04-06T18:36:57.401Z","avatar_url":"https://github.com/XRM-OSS.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# D365-UI-Test [![Known Vulnerabilities](https://snyk.io/test/github/digitalflow/d365-ui-test/badge.svg)](https://snyk.io/test/github/digitalflow/d365-ui-test) [![CI](https://github.com/XRM-OSS/D365-UI-Test/actions/workflows/main.yml/badge.svg)](https://github.com/XRM-OSS/D365-UI-Test/actions/workflows/main.yml) [![npm version](https://badge.fury.io/js/d365-ui-test.svg)](https://badge.fury.io/js/d365-ui-test) ![NPM](https://img.shields.io/npm/l/d365-ui-test) [![npm downloads](https://img.shields.io/npm/dt/d365-ui-test.svg)](http://npm-stats.org/#/d365-ui-test) \n\n## What's this?\nD365-UI-Test is an UI testing framework for easy and robust UI testing in Dynamics 365 CE and Dynamics 365 Portals.\nIt is powered by TypeScript and playwright. You can write your tests in plain JS or in TypeScript.\nVarious functions for interacting with CRM are implemented and can be used for executing your tests.\n\n## Quick Showcase\nhttps://user-images.githubusercontent.com/4287938/103551344-818f6f80-4eaa-11eb-8e77-db6e6ceb71be.mp4\n\n## What does a test look like?\nD365-UI-Test is unopinionated, so we don't enforce a specific testing library.\nThe demo tests use [jest](https://jestjs.io/), but you could just as well use Mocha or someting completely different.\n\nJest Test:\n```TypeScript\ndescribe(\"Basic operations UCI\", () =\u003e {\n    beforeAll(async () =\u003e {\n        jest.setTimeout(60000);\n\n        await xrmTest.launch(\"chromium\", {\n            headless: false,\n            args: [\"--start-fullscreen\"]\n        })\n        .then(([b, c, p]) =\u003e {\n            browser = b;\n            context = c;\n            page = p;\n        });\n    });\n\n    test(\"Start D365\", async () =\u003e {\n        const config = fs.readFileSync(path.join(__dirname, \"../../settings.txt\"), {encoding: 'utf-8'});\n        const [url, user, password] = config.split(\",\");\n    });\n\n    test(\"Open new account form\", async () =\u003e {\n        await xrmTest.Navigation.openCreateForm(\"account\");\n    });\n\n    afterAll(() =\u003e {\n        return xrmTest.close();\n    });\n});\n```\n\n## Getting started\n### Writing tests\nThera are demo projects for getting started with various test frameworks:\n- Jest: https://github.com/DigitalFlow/D365-UI-Test-Jest-Demo\n- Mocha / Chai: https://github.com/paulbreuler/D365-UI-Mocha-Test (Thanks Paul!)\n\nJust follow the instructions in there for getting started.\n\n### Designing test using D365-UI-Test-Designer\nThere is an official browser extension for Google Chrome and MS Edge available here: https://github.com/XRM-OSS/D365-UI-Test-Designer\nIt can help you to record form actions as UI tests and to assist you in defining tests.\n\n### Without template project\nInstall this project using npm to get started: `npm install d365-ui-test`.\n\nAfterwards you can import it in your code like `import { XrmUiTest } from \"d365-ui-test\";`.\n\nUse a testing framework such as Jest or Mocha for creating a test suite and set up a XrmUiTest instance in the startup step for launching a Chrome session.\nEach of your tests can then be written inside the testing framework just as you're used to.\n\nYou might want to create your own settings.txt file as in the example above or just enter your credentials inline.\nThe demo tests reside at `spec/xrm-ui-test.spec.ts`, the demo project can be found in the previous section.\nThis might give you an idea.\n\n## What's the difference to EasyRepro?\nEasyRepro focuses on interacting with the form mainly by simulating user inputs.\nWhen setting lookups, dealing with localization, renaming of labels and more topics, this seemed not the best option.\nThe CRM provides us with various global JS objects, which allow interacting with the system.\nD365-UI-Test tries to use these JS objects (such as Xrm.Navigation) as much as possible, as this API is not expected to change unexpectedly, yields fast and stable results and causes no issues with localization.\n\nD365-UI-Test also does not limit itself to Dynamics 365 CE, but also for testing connected Portals.\n\n## Continuous Integration\nD365-UI-Test is cross platform. You can run it on Windows, Linux, Mac and of course also on Azure or any other CI platform.\nFor getting started as fast as possible, there is a fully functioning predefined yaml pipeline definition for Azure DevOps available in the documentation: https://xrm-oss.github.io/D365-UI-Test/pages/Tutorials/10_DevOps.html\n\n## Current Feature Set\n- Open and log in to D365 (MS OTP tokens / two factor auth is also supported)\n- Open an App\n- Open Create / Update Forms\n- Set values for all CRM field types\n- Get values of all CRM field types\n- Get visibility and readonly state for controls\n- Get subgrid record count, refresh subgrid, open n-th record of subgrid\n- Click ribbon Buttons\n- Download files\n- Runs on Windows, Linux, Mac (also on DevOps)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxrm-oss%2Fd365-ui-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxrm-oss%2Fd365-ui-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxrm-oss%2Fd365-ui-test/lists"}