@capagents/forgeqe 2.9.3 → 2.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HOW_TO_USE.md +78 -13
- package/README.md +1 -1
- package/dist/docs-site/docs/architecture/index.html +1 -1
- package/dist/docs-site/docs/index.html +66 -10
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/forgeqe.js +1679 -1640
- package/dist/web/assets/Agent-BU8FKiQt.js +7 -0
- package/dist/web/assets/ApiTests-Bsv3NhD5.js +10 -0
- package/dist/web/assets/Browse-D-ho9bS_.js +2 -0
- package/dist/web/assets/{Chat-BdlfK2ra.js → Chat-czaM5kUi.js} +3 -3
- package/dist/web/assets/CommandPalette-CrLuxoE5.js +1 -0
- package/dist/web/assets/{Compare-BxUfo0rI.js → Compare-DfHMTNGi.js} +1 -1
- package/dist/web/assets/Cost-BYb3T8-c.js +1 -0
- package/dist/web/assets/Data-EF_k6c_T.js +6 -0
- package/dist/web/assets/Desktop-DY5Q1Sd3.js +1 -0
- package/dist/web/assets/DesktopReview-DFKpYor2.js +1 -0
- package/dist/web/assets/Evidence-Db9H4-Nu.js +1 -0
- package/dist/web/assets/{Explore--B18Jvg9.js → Explore-B0EkFCFe.js} +2 -2
- package/dist/web/assets/{Features-BerYifH7.js → Features-8jsv2A1d.js} +1 -1
- package/dist/web/assets/{Flags-ABMq---p.js → Flags-DtzmOA5o.js} +2 -2
- package/dist/web/assets/{Flaky-DKeceXsa.js → Flaky-BCzOx7Mq.js} +1 -1
- package/dist/web/assets/{ForceGraph-C9HFjZX3.js → ForceGraph-i1zlas5l.js} +1 -1
- package/dist/web/assets/Impact-Da9L1tDd.js +3 -0
- package/dist/web/assets/Jobs-CHw00lcx.js +5 -0
- package/dist/web/assets/KindPage-DiOmtzVZ.js +6 -0
- package/dist/web/assets/Migration-Cu4JgOj1.js +2 -0
- package/dist/web/assets/{Product-CgVhHMMY.js → Product-DmvUI7pH.js} +3 -3
- package/dist/web/assets/{Production-OdB4gZ3T.js → Production-CLoOV4jl.js} +1 -1
- package/dist/web/assets/{Quality-DOV4suvD.js → Quality-ylTg9e0c.js} +1 -1
- package/dist/web/assets/{Readiness-DawfUUHc.js → Readiness-BMD5Uj8D.js} +1 -1
- package/dist/web/assets/{Record-C9uAKGYM.js → Record-CoCnmfqW.js} +2 -2
- package/dist/web/assets/Regression-D_Hy9bMt.js +5 -0
- package/dist/web/assets/{Reports-BHOS6af1.js → Reports-DXphAHAy.js} +2 -2
- package/dist/web/assets/{Response-qfMk4Nrh.js → Response-PDQ8zEZU.js} +2 -2
- package/dist/web/assets/{RunDiff-BNywFV7t.js → RunDiff-C3MIKipo.js} +1 -1
- package/dist/web/assets/{Runs-BJPYXRiB.js → Runs-DSQZwCpE.js} +2 -2
- package/dist/web/assets/Steps-CY6WROAr.js +2 -0
- package/dist/web/assets/{TestCases-DcYY2l9q.js → TestCases-BjgWdtPi.js} +1 -1
- package/dist/web/assets/TestData-CDziNp2d.js +2 -0
- package/dist/web/assets/TestDebt-D59zFYSu.js +1 -0
- package/dist/web/assets/Tosca-umw1O224.js +3 -0
- package/dist/web/assets/{WhatsNew-CIOTidx-.js → WhatsNew-DqNMAytd.js} +1 -1
- package/dist/web/assets/{dataParts-CUb0Q0IZ.js → dataParts-DGVc48Ed.js} +3 -3
- package/dist/web/assets/{families-C9MndVzT.js → families-DlfXDoO8.js} +1 -1
- package/dist/web/assets/{filters-Bk7ovF3M.js → filters-NVjc0d8i.js} +1 -1
- package/dist/web/assets/{fold-97yBCSav.js → fold-BKAl2p_2.js} +1 -1
- package/dist/web/assets/frame-B0nzdTfN.js +4 -0
- package/dist/web/assets/index-BLUj4Sgh.js +73 -0
- package/dist/web/assets/index-RzPHjTCW.css +2 -0
- package/dist/web/assets/{logos-CbNeXLAM.js → logos-J0WPxDqj.js} +1 -1
- package/dist/web/assets/{palette-Dg3RS-ff.js → palette-DViz4KwG.js} +1 -1
- package/dist/web/assets/{parts-CPAyV15O.js → parts-W2J4TR3o.js} +1 -1
- package/dist/web/assets/{productParts-BpXw1jMa.js → productParts-_8gKGn4o.js} +1 -1
- package/dist/web/assets/{qualityParts-8TPKphgl.js → qualityParts-DnbSeK-G.js} +1 -1
- package/dist/web/assets/{recordTest-DvnpHsd2.js → recordTest-etYNiLQy.js} +1 -1
- package/dist/web/assets/{rows-BdYJLCRD.js → rows-CbXelp5_.js} +1 -1
- package/dist/web/assets/{segmented-DlF5rvSR.js → segmented-B7n6eLrO.js} +1 -1
- package/dist/web/assets/{thread-DlyX7xQt.js → thread-BIUxcjeu.js} +1 -1
- package/dist/web/assets/{usePageChat-Dhu3upXA.js → usePageChat-DMOtRwzT.js} +1 -1
- package/dist/web/index.html +4 -4
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/user-guide.html +66 -10
- package/forgeqe.example.yaml +4 -1
- package/package.json +1 -1
- package/prompts/README.md +2 -0
- package/prompts/brain.md +9 -0
- package/prompts/business-persona.md +62 -0
- package/prompts/heal.md +2 -0
- package/prompts/page-differs.md +16 -0
- package/prompts/test-agent.md +4 -3
- package/prompts/test-rules.md +1 -10
- package/py/forgeqe_engine/copilot_gateway.py +31 -0
- package/py/forgeqe_engine/persona.py +28 -11
- package/py/forgeqe_engine/service.py +2 -0
- package/skills/bdd-gherkin/SKILL.md +141 -0
- package/skills/bdd-gherkin/references/cucumber-js.md +52 -0
- package/skills/bdd-gherkin/references/cucumber-jvm.md +54 -0
- package/skills/bdd-gherkin/references/python-bdd.md +50 -0
- package/skills/bdd-gherkin/references/reqnroll-specflow.md +83 -0
- package/skills/bdd-gherkin/references/review-checklist.md +37 -0
- package/skills/bdd-scenario-design/SKILL.md +50 -0
- package/skills/dynamics-365/SKILL.md +30 -15
- package/skills/dynamics-365-automation/SKILL.md +72 -0
- package/skills/dynamics-365-automation/references/elements.md +187 -0
- package/skills/dynamics-365-automation/references/recipes.md +97 -0
- package/dist/web/assets/Agent-B6xfobJ9.js +0 -4
- package/dist/web/assets/ApiTests-BwgezlYi.js +0 -10
- package/dist/web/assets/Browse-DDzk_KTh.js +0 -2
- package/dist/web/assets/CommandPalette-Cla7m818.js +0 -1
- package/dist/web/assets/Cost-Dpa8aWQG.js +0 -1
- package/dist/web/assets/Data-D_7m2GL6.js +0 -6
- package/dist/web/assets/Desktop-CgslBkAr.js +0 -1
- package/dist/web/assets/DesktopReview-CsW65QZz.js +0 -1
- package/dist/web/assets/Evidence-SYt-mbDx.js +0 -1
- package/dist/web/assets/Impact-DQ2c0dTT.js +0 -3
- package/dist/web/assets/Jobs-Dy_C2x36.js +0 -5
- package/dist/web/assets/KindPage-DQzstMyM.js +0 -6
- package/dist/web/assets/Migration-B4GWsCLR.js +0 -2
- package/dist/web/assets/Regression-DZdddPfI.js +0 -5
- package/dist/web/assets/Steps-Cdzyueit.js +0 -2
- package/dist/web/assets/TestData-CrzKA3xh.js +0 -2
- package/dist/web/assets/TestDebt-CVDJT511.js +0 -1
- package/dist/web/assets/Tosca-CBwGCrbL.js +0 -3
- package/dist/web/assets/frame-CqWJMIHh.js +0 -4
- package/dist/web/assets/index-ASvNRLI7.js +0 -73
- package/dist/web/assets/index-B5o9vY-v.css +0 -2
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Reqnroll and SpecFlow (C#)
|
|
2
|
+
|
|
3
|
+
Reqnroll is the open-source successor of SpecFlow, with the same model: `using Reqnroll;` instead of
|
|
4
|
+
`using TechTalk.SpecFlow;`, `reqnroll.json` instead of `specflow.json`. Follow whichever the `.csproj` references; do not
|
|
5
|
+
migrate a SpecFlow project to Reqnroll unless asked.
|
|
6
|
+
|
|
7
|
+
## Project
|
|
8
|
+
- Packages: `Reqnroll.NUnit` / `Reqnroll.xUnit` / `Reqnroll.MsTest` (or `SpecFlow.NUnit` …), plus the test framework
|
|
9
|
+
and often `Microsoft.Playwright` or `Selenium.WebDriver`. `Reqnroll.Tools.MsBuild.Generation` (SpecFlow) generates
|
|
10
|
+
`*.feature.cs` at build: never edit or commit changes to them by hand.
|
|
11
|
+
- `reqnroll.json`: `"language": { "feature": "en-US" }`, `"bindingAssemblies"` for steps in another project,
|
|
12
|
+
`"generator": { "addNonParallelizableMarkerForTags": [...] }`.
|
|
13
|
+
- Folders are usually `Features/`, `StepDefinitions/` (or `Steps/`), `Pages/`, `Hooks/`, `Support/` or `Drivers/`.
|
|
14
|
+
|
|
15
|
+
## Step definitions
|
|
16
|
+
```csharp
|
|
17
|
+
[Binding]
|
|
18
|
+
public sealed class CheckoutSteps
|
|
19
|
+
{
|
|
20
|
+
private readonly CheckoutPage _checkout;
|
|
21
|
+
private readonly OrderContext _order; // a plain class shared by every binding of the scenario
|
|
22
|
+
|
|
23
|
+
public CheckoutSteps(CheckoutPage checkout, OrderContext order) // context injection
|
|
24
|
+
{
|
|
25
|
+
_checkout = checkout;
|
|
26
|
+
_order = order;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[When("the customer pays with a saved {string} card")]
|
|
30
|
+
public async Task WhenTheCustomerPaysWithASavedCard(string cardType)
|
|
31
|
+
{
|
|
32
|
+
_order.Number = await _checkout.PayWithSavedCardAsync(cardType);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[Then("the order confirmation shows a total of {decimal} EUR")]
|
|
36
|
+
public async Task ThenTheConfirmationShowsTotal(decimal total)
|
|
37
|
+
{
|
|
38
|
+
(await _checkout.ConfirmedTotalAsync()).Should().Be(total);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
- Cucumber expressions (`{string}`, `{int}`, `{decimal}`, `{word}`, `{DateTime}`, custom) are the default in Reqnroll
|
|
43
|
+
and SpecFlow 4; SpecFlow 3 uses regular expressions (`@"the customer adds (\d+) ""(.*)"" to the cart"`). Use the
|
|
44
|
+
repository's style.
|
|
45
|
+
- Binding methods are `public`, `async Task` when they await. Never `.Result` or `.Wait()`.
|
|
46
|
+
- `[StepDefinition("...")]` matches Given, When and Then: use it only where the repository does.
|
|
47
|
+
- A binding class's constructor takes what it needs; Reqnroll's container (BoDi) creates one instance per scenario of
|
|
48
|
+
each injected class. Prefer typed context classes (`OrderContext`) to `ScenarioContext["key"]`.
|
|
49
|
+
- `ScenarioContext`, `FeatureContext` and `IReqnrollOutputHelper` (`ISpecFlowOutputHelper`) are injected too: use the
|
|
50
|
+
output helper for log lines, not `Console.WriteLine`.
|
|
51
|
+
- Custom types: `[StepArgumentTransformation]` on a method in a `[Binding]` class, or `[Binding] public class
|
|
52
|
+
Transforms` with `[StepArgumentTransformation(@"(\d+) days from today")] public DateTime DaysFromToday(int days)`.
|
|
53
|
+
|
|
54
|
+
## Tables
|
|
55
|
+
```csharp
|
|
56
|
+
[Given("the customer has these items in the cart")]
|
|
57
|
+
public async Task GivenItems(DataTable table) // Reqnroll; SpecFlow: Table
|
|
58
|
+
{
|
|
59
|
+
foreach (var item in table.CreateSet<CartItem>()) await _cart.AddAsync(item.Product, item.Quantity);
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
- `CreateInstance<T>()` for a vertical (field | value) table, `CreateSet<T>()` for rows; columns map to properties by
|
|
63
|
+
name. Compare with `table.CompareToSet(actual)` / `CompareToInstance`.
|
|
64
|
+
|
|
65
|
+
## Hooks and the browser
|
|
66
|
+
- `[Binding] public class Hooks` with `[BeforeScenario]`, `[AfterScenario]`, `[BeforeTestRun]` (static),
|
|
67
|
+
`[BeforeFeature]` (static), `[AfterStep]`. Order with `Order = n`; scope with `[BeforeScenario("@ui")]` or
|
|
68
|
+
`[Scope(Tag = "ui")]`.
|
|
69
|
+
- The browser or driver is usually created in a `[BeforeScenario]` hook or a driver class registered in the
|
|
70
|
+
`IObjectContainer` (`container.RegisterInstanceAs(page)`), then injected into page objects. Follow it; do not start a
|
|
71
|
+
browser in a step.
|
|
72
|
+
- Screenshots and traces on failure belong in `[AfterScenario]` with `ScenarioContext.TestError`.
|
|
73
|
+
|
|
74
|
+
## Parallel runs
|
|
75
|
+
- NUnit: `[assembly: Parallelizable(ParallelScope.Fixtures)]` runs features in parallel; xUnit runs per class.
|
|
76
|
+
Everything shared must be in the scenario's container. Tag `@non-parallelizable` only as the repository configures.
|
|
77
|
+
|
|
78
|
+
## Run one scenario
|
|
79
|
+
- `dotnet build <Tests.csproj>`, then
|
|
80
|
+
`dotnet test <Tests.csproj> --no-build --filter "Category=TC_1234"` (a tag becomes an NUnit/MsTest Category, an xUnit
|
|
81
|
+
trait `Category`) or `--filter "FullyQualifiedName~CheckoutFeature.FreeShippingAppliesToOrdersOver100EUR"`
|
|
82
|
+
(the generated class is `<FeatureTitle>Feature`, the method the scenario title without spaces).
|
|
83
|
+
- An undefined step is reported at run time ("No matching step definition found"): read the output, add the binding.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# BDD review checklist
|
|
2
|
+
|
|
3
|
+
Check each line before you finish. Fix what fails; say in notes what you could not.
|
|
4
|
+
|
|
5
|
+
## Feature file
|
|
6
|
+
- [ ] The feature file is where its capability's features are, named like them (`checkout.feature`, `Checkout.feature`).
|
|
7
|
+
- [ ] The Gherkin choices in the notes are all followed (Examples, Background, Rule, data tables).
|
|
8
|
+
- [ ] No locator, URL path, CSS, XPath, wait, click or key press in any step.
|
|
9
|
+
- [ ] Each scenario: Given (state), one When (the behaviour), Then (observable outcome). No Then before When.
|
|
10
|
+
- [ ] Scenario titles say behaviour and outcome, and are unique in the feature.
|
|
11
|
+
- [ ] Background holds only Given steps that every scenario of the file needs.
|
|
12
|
+
- [ ] A Scenario Outline uses every column, every placeholder has a column, rows are business cases, and there is more
|
|
13
|
+
than one row.
|
|
14
|
+
- [ ] Rule blocks are used only if the runner's version supports them, one business rule each.
|
|
15
|
+
- [ ] Tags follow the repository (suite tag, test case or work item tag); nothing new is left `@wip` or `@ignore`.
|
|
16
|
+
- [ ] No secret, password or token anywhere in the file; dates are relative.
|
|
17
|
+
|
|
18
|
+
## Steps
|
|
19
|
+
- [ ] Every step reuses an existing phrase where one means the same, word for word.
|
|
20
|
+
- [ ] No new expression matches an existing step (no ambiguity) and no existing expression matches a new step.
|
|
21
|
+
- [ ] Values are parameters (Cucumber expressions or the repository's regex style), not hard-coded in the phrase.
|
|
22
|
+
- [ ] New bindings are in the step class or file of their domain.
|
|
23
|
+
- [ ] Bindings are thin: they call page objects or helpers and assert; no locators, no sleeps.
|
|
24
|
+
- [ ] State goes through the scenario context (injection, World, `context`, `target_fixture`), never static or global.
|
|
25
|
+
- [ ] Tables are converted to typed objects or maps by column name.
|
|
26
|
+
- [ ] The dry run reports no undefined, ambiguous or pending step.
|
|
27
|
+
|
|
28
|
+
## Page objects
|
|
29
|
+
- [ ] The existing page object of the page is extended; a new one only for a page without one, named and placed like
|
|
30
|
+
the others.
|
|
31
|
+
- [ ] Locators follow the repository's preference (role, label, test id, then CSS); none by position.
|
|
32
|
+
- [ ] Waits are for conditions, inside page objects or retrying assertions.
|
|
33
|
+
- [ ] Page objects hold no test data and no scenario state.
|
|
34
|
+
|
|
35
|
+
## Run
|
|
36
|
+
- [ ] The new scenario passes alone (by tag, name or line), then the whole feature file passes.
|
|
37
|
+
- [ ] No generated file (`*.feature.cs`, `.features-gen/`) was edited by hand.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bdd-scenario-design
|
|
3
|
+
description: "Use when the user asks for BDD or Gherkin: feature files, scenarios, Given/When/Then, a Scenario Outline with Examples, Background or Rule, or a test written into a repository that uses Reqnroll, SpecFlow, Cucumber (cucumber-js, Cucumber-JVM, Serenity), behave or pytest-bdd (.feature files): asking the user how the scenarios are shaped (Examples or not, Background, Rule, data tables) before anything is written, writing scenarios from a story's acceptance criteria, and passing the choices to write_test."
|
|
4
|
+
agents: [forgeqe]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Designing BDD scenarios
|
|
8
|
+
|
|
9
|
+
## Ask before you create
|
|
10
|
+
Before you write a feature file, or call write_test for a repository with `.feature` files, the user decides the shape.
|
|
11
|
+
Ask it as one question with numbered options, recommended option first, and set outcome to needs_input. Ask only what
|
|
12
|
+
the user's request, an earlier answer in this conversation, or the feature file the test goes into does not answer.
|
|
13
|
+
|
|
14
|
+
1. **Examples**: "Write it as a Scenario Outline with an Examples table (one row per data case), or as concrete
|
|
15
|
+
Scenarios with the values in the steps?" Recommend the Outline when the request or the story has several values for
|
|
16
|
+
the same flow (card types, roles, boundaries); otherwise concrete Scenarios.
|
|
17
|
+
2. **Background**: "Put the shared Given steps (for example, signed in as a customer) in a Background, or keep them in
|
|
18
|
+
each scenario?" Ask only for a new feature file, or when the file has no Background yet.
|
|
19
|
+
3. **Rule**: "Group the scenarios under Rule blocks, one per business rule (needs Gherkin 6 support in the runner)?"
|
|
20
|
+
Ask when the story has two or more business rules or acceptance-criteria groups.
|
|
21
|
+
4. **Data tables**: ask only when a step takes a form or a list (an address, cart items).
|
|
22
|
+
|
|
23
|
+
You MUST ask about Examples every time it is not already answered. You MUST NOT create the feature file or call
|
|
24
|
+
write_test until the user has answered. You MUST NOT ask the same thing again in the conversation.
|
|
25
|
+
|
|
26
|
+
Example of the question:
|
|
27
|
+
"Before I write the checkout scenarios: 1) Scenario Outline with Examples for the 3 card types (recommended), or
|
|
28
|
+
3 concrete scenarios? 2) A Background for 'Given the customer is signed in with items in the cart' (recommended), or
|
|
29
|
+
those steps in each scenario? 3) Group them under Rules 'Saved cards' and 'New cards', or no Rules?"
|
|
30
|
+
|
|
31
|
+
## Passing the answers to the test writer
|
|
32
|
+
- Call write_test with `bdd` holding the user's answers: `examples` outline or none, `background` use, none or
|
|
33
|
+
repository, `rule` use or none, `data_tables` use or none. Leave out what the user did not decide. Give the other
|
|
34
|
+
arguments as usual.
|
|
35
|
+
- Report the feature file, the scenarios and the choices that shaped them, the step definitions that were reused and
|
|
36
|
+
the new ones, the page objects that changed, and the command that runs the scenario.
|
|
37
|
+
|
|
38
|
+
## Writing scenarios yourself (from a story, for review, or as test cases)
|
|
39
|
+
When the user asks for Gherkin scenarios as text (not a test in a repository), ask the same question first, then write:
|
|
40
|
+
- One Feature per capability, with a short description (`As a … I want … so that …` or the rule).
|
|
41
|
+
- Scenarios from the acceptance criteria: the happy path, each rule's boundary, invalid input, and the role or state
|
|
42
|
+
differences the story names. Mark what the story does not say as an assumption.
|
|
43
|
+
- Declarative business steps (no clicks, locators, URLs or waits), Given for state, one When, Then for an observable
|
|
44
|
+
outcome; scenario titles that say behaviour and outcome.
|
|
45
|
+
- Steps phrased for reuse: the same phrase for the same meaning, values as parameters (`"Visa"`, `3`).
|
|
46
|
+
- Tag each scenario with the story or test case key the user gave (for example `@ABC-123`), and a suite tag only if the
|
|
47
|
+
user uses one.
|
|
48
|
+
- No passwords or tokens in steps or Examples: a role or login name instead.
|
|
49
|
+
- Follow the user's language: when the project's features use `# language: <code>` or the request is in another
|
|
50
|
+
language, write the Gherkin keywords and steps in it.
|
|
@@ -1,21 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dynamics-365
|
|
3
|
-
description: "Use when the site is Microsoft Dynamics 365 or a Power Apps model-driven app (hosts like *.crm.dynamics.com or *.crm4.dynamics.com, URLs with main.aspx?appid=): lookup fields, choices, date fields, grids and
|
|
3
|
+
description: "Use when the site is Microsoft Dynamics 365 or a Power Apps model-driven app (hosts like *.crm.dynamics.com or *.crm4.dynamics.com, URLs with main.aspx?appid=): the site map, Quick Find (Search this view), lookup fields and Advanced lookup, choices, Yes/No, date fields, grids, views and subgrids, the command bar and More commands, Quick Create, the header flyout, form tabs, business process flows, dialogs, notifications, and loading indicators."
|
|
4
4
|
agents: [browser]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Dynamics 365 / model-driven apps
|
|
7
|
+
# Dynamics 365 / model-driven apps: names of its controls
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
9
|
+
Wait until loading ends (spinner, moving dots, grey placeholder bars) before every action. "---" in a field means loaded and empty.
|
|
10
|
+
|
|
11
|
+
Navigation
|
|
12
|
+
- Site map: the left pane (≡ "Site map" button collapses it). Area switcher: the button at its bottom changes area (Sales, Service, Settings). App switcher: the app name at the top left.
|
|
13
|
+
- Quick Create: the "+" in the top bar ("New" menu); opens a narrow form on the right with "Save and Close".
|
|
14
|
+
- Search box in the top bar searches all tables (Dataverse search); "Search this view" above a grid searches only that view.
|
|
15
|
+
|
|
16
|
+
Grids, views, subgrids
|
|
17
|
+
- View selector: the view name with a ⌄ above the grid (e.g. "My Active Accounts"); pick another view from its list.
|
|
18
|
+
- Quick Find: the "Search this view" box (filter by keyword); type, then Enter.
|
|
19
|
+
- Rows: open one with the link in the primary name column; select with the round check at the row's left; "Select All" in the header. Column header menus sort and filter. Paging: arrows at the bottom.
|
|
20
|
+
- Subgrid: a grid inside a form (e.g. Contacts on an account), with its own command bar ("+ New Contact", "Add Existing") and "⋯" for more.
|
|
21
|
+
- Related: the "Related" tab of a form lists related tables.
|
|
22
|
+
|
|
23
|
+
Forms
|
|
24
|
+
- Header: title and key fields at the top; the ⌄ at the header's right opens the header flyout with more header fields.
|
|
25
|
+
- Form selector: the ⌄ next to the form name under the title switches forms. Tabs (Summary, Details, Related) hold more fields.
|
|
26
|
+
- Command bar: Save, Save & Close, New, Deactivate, Delete, Assign... Buttons that do not fit are under "More commands" (⋯).
|
|
27
|
+
- Text field: click, type, press Tab. Required: red asterisk; recommended: blue plus.
|
|
28
|
+
- Lookup field (magnifier icon): type part of the name, wait for the results flyout, click the row whose name matches exactly (never "+ New"). "Advanced lookup" at the flyout's bottom opens a dialog with a search box, a view picker and "Done". A set lookup shows the record as a link; hover and click its X to clear it.
|
|
29
|
+
- Choice (option set): a dropdown, pick by text. Choices (multi-select): pick several, each shows as a tag. Yes/No: a toggle or two options. Date: type in the format shown (e.g. 6/15/2026) and Tab; the time is the box next to it.
|
|
30
|
+
- Business process flow: the stage bar under the header; click a stage to open its flyout of fields; "Next Stage" moves on, "Set Active" makes a stage current; the pin docks the flyout.
|
|
31
|
+
|
|
32
|
+
Saving and messages
|
|
33
|
+
- Save: command bar or Ctrl+S; wait until "Saving..." is gone and the title no longer says "Unsaved". The form reloads: look again.
|
|
34
|
+
- Form notification bar: a banner under the command bar (errors in red, e.g. required fields left empty); expand it to see all.
|
|
35
|
+
- Dialogs: "Duplicate records found" (Ignore and save / Cancel), "Unsaved changes" (Save and continue / Discard changes), Assign (Me / User or team), confirm dialogs (OK, Confirm, Cancel).
|
|
36
|
+
- Leave a form with its back arrow, never the browser's Back.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dynamics-365-automation
|
|
3
|
+
description: "Use when writing or fixing test code for Microsoft Dynamics 365 / Power Apps model-driven apps (Unified Interface, *.crm.dynamics.com, main.aspx?appid=), with Playwright, Selenium, EasyRepro (Microsoft.Dynamics365.UIAutomation.Api.UCI, XrmApp, WebClient) or a BDD layer on top: the names and stable locators of D365 controls (Quick Find, lookups and Advanced lookup, option sets, Yes/No, dates, multi-select, grids, subgrids, command bar, Quick Create, header flyout, business process flow, dialogs, notifications), waiting for the app to be idle, deep links, and page objects for D365."
|
|
4
|
+
agents: [scribe]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Automating Dynamics 365 (model-driven apps)
|
|
8
|
+
|
|
9
|
+
`references/elements.md` is the catalogue of D365 control names and their locators (from Microsoft's EasyRepro). Read
|
|
10
|
+
it before you write a locator for a D365 control, and use the names from it in page-object members.
|
|
11
|
+
`references/recipes.md` has the steps for each control (lookup, option set, date, grid, BPF, Quick Create, dialogs).
|
|
12
|
+
|
|
13
|
+
## How D365 names its elements
|
|
14
|
+
- A field is found by its **logical name** (schema name, lowercase: `name`, `parentcustomerid`, `emailaddress1`,
|
|
15
|
+
`new_customfield`), never by its label: labels change with language and customization.
|
|
16
|
+
- The field's container: `[data-id="<field>-FieldSectionItemContainer"]`.
|
|
17
|
+
- The control inside: `[data-id*="<field>.fieldControl"]`, and for each kind `<field>.fieldControl-<kind>`:
|
|
18
|
+
`LookupResultsDropdown_<field>…` (lookup), `option-set-container` (choice), `date-time-input` (date),
|
|
19
|
+
`checkbox-container` / `checkbox-toggle` / `toggle-container` (Yes/No), `pickliststatus-comboBox` (status reason).
|
|
20
|
+
- The same field in the header has a `header_` prefix (`header_<field>…`); in a business process flow
|
|
21
|
+
`header_process_<field>…`; in Quick Create it is inside `section[data-id="quickCreateRoot"]`.
|
|
22
|
+
- Find the logical name in the repository's page objects or constants first, then on the live page (the `data-id`
|
|
23
|
+
of the field's container), or ask; never guess it from the label.
|
|
24
|
+
- Commands are found by their command id in `data-id` (`[data-id*="Mscrm.Form.account.Save"]`, `Assign`,
|
|
25
|
+
`Delete`, `MarkAsWon`) or the button's `aria-label`, scoped to the command bar (`ul[data-lp-id*="commandbar-Form"]`
|
|
26
|
+
on a form, `commandbar-HomePageGrid` on a list, `commandbar-SubGridStandard:<subgrid>` on a subgrid).
|
|
27
|
+
- Grids: the Power Apps grid control (`[data-lp-id*="MscrmControls.Grid.PCFGridControl"]`), rows `div[role="row"]`
|
|
28
|
+
with `row-index`, cells `div[role="gridcell"]`, column headers `div[role="columnheader"]` labelled by title.
|
|
29
|
+
- Shared flyouts and menus render outside their control, under `#__flyoutRootNode`: look for "More commands",
|
|
30
|
+
view lists, notification lists and subtabs there, not inside the control.
|
|
31
|
+
- These attributes are internal to D365 and can change in a release (the catalogue was taken from EasyRepro's 2024
|
|
32
|
+
code). Prefer, in this order: the repository's existing locator; a `data-id` from the catalogue checked on the live
|
|
33
|
+
page; role and accessible name (`getByRole('button', { name: 'Save & Close' })`); text. Never an absolute XPath or a
|
|
34
|
+
generated id (`id__123`).
|
|
35
|
+
|
|
36
|
+
## Waiting
|
|
37
|
+
- D365 loads in many steps. After navigation, a save, a lookup search or a stage change, wait until the app is idle:
|
|
38
|
+
`window.UCWorkBlockTracker?.isAppIdle()` returns true (EasyRepro's `WaitForTransaction`), then for the element you
|
|
39
|
+
need. Never a fixed sleep.
|
|
40
|
+
- A save is done when the command bar is enabled again and the title has no "- Unsaved" marker; the form re-renders,
|
|
41
|
+
so find elements again after it (stale elements in Selenium).
|
|
42
|
+
|
|
43
|
+
## Navigation without clicking through menus
|
|
44
|
+
- Open a record: `main.aspx?appid=<appid>&pagetype=entityrecord&etn=<table>&id=<guid>`; a new one: the same without
|
|
45
|
+
`id`; a list: `pagetype=entitylist&etn=<table>` (add `&viewid=<guid>` for a view). Use the `appid` the repository's
|
|
46
|
+
config holds. Clicking through the site map is only for tests of navigation itself.
|
|
47
|
+
- Set up data (accounts, contacts, orders) through the Dataverse Web API or the repository's data helpers when a test
|
|
48
|
+
is not about creating it in the UI.
|
|
49
|
+
|
|
50
|
+
## Page objects for D365
|
|
51
|
+
- One base class for what every D365 page has (wait for idle, command bar, notifications, dialogs, save), and one page
|
|
52
|
+
object per table form (`AccountForm`, `OpportunityForm`) and per list, built on generic control helpers:
|
|
53
|
+
`Lookup(field)`, `OptionSet(field)`, `DateField(field)`, `BooleanField(field)`, `SubGrid(name)`, `Bpf()`.
|
|
54
|
+
- Members are named after the D365 control and the field (`ParentAccountLookup`, `QuickFindBox`, `MoreCommandsButton`),
|
|
55
|
+
take the logical name, and keep test data out.
|
|
56
|
+
- The same helper works in the main form, the header flyout, Quick Create and a BPF stage: pass the scope (the form,
|
|
57
|
+
`quickCreateRoot`, the BPF flyout) to it rather than duplicating it.
|
|
58
|
+
- Read a field's value from the control (an input's value, a lookup's selected tag); reading it through
|
|
59
|
+
`Xrm.Page`/`formContext` in page script is only for checks the repository already does that way.
|
|
60
|
+
|
|
61
|
+
## EasyRepro repositories (C#, Selenium)
|
|
62
|
+
- Tests use `XrmApp` (`xrmApp.Navigation.OpenApp`, `OpenSubArea`, `xrmApp.Grid.Search`/`OpenRecord`,
|
|
63
|
+
`xrmApp.Entity.SetValue("name", "...")`, `SetValue(new LookupItem { Name = "parentcustomerid", Value = "..." })`,
|
|
64
|
+
`SetValue(new OptionSet { Name = "...", Value = "..." })`, `SetValue("field", DateTime, "M/d/yyyy")`,
|
|
65
|
+
`xrmApp.Entity.Save()`, `xrmApp.CommandBar.ClickCommand("...")`, `xrmApp.BusinessProcessFlow.NextStage("...")`,
|
|
66
|
+
`xrmApp.QuickCreate`, `xrmApp.Dialogs`, `xrmApp.ThinkTime(ms)`). Use these before raw Selenium; add a raw locator only
|
|
67
|
+
for what EasyRepro does not cover, from the catalogue, through `AppElements.Xpath` the way the repository extends it.
|
|
68
|
+
- Sign-in: `xrmApp.OnlineLogin.Login(uri, username, password, mfaSecretKey)` takes `SecureString`s
|
|
69
|
+
(`.ToSecureString()`). Microsoft's samples read them from `app.config` AppSettings: in a real repository take them
|
|
70
|
+
from environment variables or a `.runsettings` file that is not committed, never values in `app.config`.
|
|
71
|
+
- Run one test: `dotnet test <project> --filter "FullyQualifiedName~<Class>.<Method>"` (MSTest); EasyRepro is
|
|
72
|
+
Windows and .NET Framework: say so in notes when this computer cannot run it.
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# Dynamics 365 Unified Interface: element catalogue
|
|
2
|
+
|
|
3
|
+
Names and locators of D365 model-driven app controls. Taken from Microsoft's EasyRepro
|
|
4
|
+
(`Microsoft.Dynamics365.UIAutomation.Api.UCI/DTO/AppElementReference.cs`, MIT licence, Copyright (c) Microsoft
|
|
5
|
+
Corporation), with CSS equivalents. The "EasyRepro key" column is the key in `AppElements.Xpath`, for repositories
|
|
6
|
+
that use EasyRepro.
|
|
7
|
+
|
|
8
|
+
Placeholders: `<field>` the field's logical name (`parentcustomerid`), `<table>` the table's logical name
|
|
9
|
+
(`account`), `<subgrid>` the subgrid's control name on the form (`Contacts`), `<n>` a 0-based row index,
|
|
10
|
+
`<text>` visible text. `*=` means "contains". These attributes are D365's own and can change between releases:
|
|
11
|
+
check one on the live page before relying on it.
|
|
12
|
+
|
|
13
|
+
## Application and navigation
|
|
14
|
+
| D365 name | EasyRepro key | Locator |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| App shell (app is loaded) | App_Shell | `#ApplicationShell` |
|
|
17
|
+
| App switcher (app name, top left) | Nav_UCIAppMenuButton | `a[data-id="appBreadCrumb"]` |
|
|
18
|
+
| App tile on the app landing page | Nav_UCIAppTile | `div[data-type="app-title"][title="<app name>"]` |
|
|
19
|
+
| Site map launcher (≡) | Nav_SiteMapLauncherButton | `button[data-lp-id="sitemap-launcher"]` |
|
|
20
|
+
| Site map entry (a table) | Nav_SitemapMenuItems | `li[data-id*="sitemap-entity"]` (e.g. `li[data-id="sitemap-entity-account"]` when present) |
|
|
21
|
+
| Pinned site map entry | Nav_PinnedSitemapEntity | `li[data-id*="sitemap-entity-Pinned"][role="treeitem"]` |
|
|
22
|
+
| Area switcher (bottom of site map) | Nav_SitemapSwitcherButton | `button[data-id*="sitemap-areaSwitcher-expand-btn"]` |
|
|
23
|
+
| Area switcher flyout | Nav_SitemapSwitcherFlyout | `div[data-lp-id*="sitemap-area-switcher-flyout"]` |
|
|
24
|
+
| Quick Create (+, "New") | Nav_QuickCreateButton | `button[data-id*="quickCreateLauncher"]` |
|
|
25
|
+
| Quick Create menu list / items | Nav_QuickCreateMenuList / Items | `ul[id*="MenuSectionItemsquickCreate"]` / `button[role="menuitem"]` |
|
|
26
|
+
| Global search box (Dataverse search) | Search_Text | `input[aria-label="Search box"]` |
|
|
27
|
+
| Global search launcher (older UI) | Nav_SearchButton | `#searchLauncher > button` |
|
|
28
|
+
| Top-bar launcher (settings, help…) / Guided help | Nav_SettingsLauncherBar / Nav_GuidedHelp | `button[data-id="<name>Launcher"]` / `#helpLauncher > button` |
|
|
29
|
+
| Account manager (avatar) / Sign out | Nav_AccountManagerButton / …SignOutButton | `#mectrl_main_trigger` / `#mectrl_body_signOut` |
|
|
30
|
+
|
|
31
|
+
## Grids and views (list pages)
|
|
32
|
+
| D365 name | EasyRepro key | Locator |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| Grid (Power Apps grid control) | Grid_Control | `div[data-lp-id*="MscrmControls.Grid.PCFGridControl"]` |
|
|
35
|
+
| Grid body | Grid_Container | `div[data-id="data-set-body-container"]` |
|
|
36
|
+
| Quick Find ("Search this view") | Grid_QuickFind | `input[id*="quickFind_text"]` |
|
|
37
|
+
| View selector (view name ⌄) | Grid_ViewSelector | `button[id*="ViewSelector"]` |
|
|
38
|
+
| View list | Grid_ViewContainer / …MenuItem | `div[aria-label*="Views"]`, items `li.ms-ContextualMenu-item` |
|
|
39
|
+
| Rows | Grid_Rows | `div[data-id="entity_control-powerapps_onegrid_control_container"] .ag-center-cols-container div[role="row"]` |
|
|
40
|
+
| Row by index | Grid_Row | `.ag-center-cols-container div[row-index="<n>"]` |
|
|
41
|
+
| Cells | Grid_Cells | `div[role="gridcell"]` |
|
|
42
|
+
| Column header (sort, filter) | Grid_SortColumn | XPath `//div[@role='columnheader']//label[@title='<column>']` |
|
|
43
|
+
| Row checkbox / Select All | Grid_RowsContainerCheckbox / Grid_SelectAll | `div[role="checkbox"]` / `button[title*="Select All"]` |
|
|
44
|
+
| Paging | Grid_FirstPage / NextPage / PreviousPage | `button[data-id*="loadFirstPage"]`, `button[data-id*="moveToNextPage"]`, `button[data-id*="moveToPreviousPage"]` |
|
|
45
|
+
| Show chart / chart selector | Grid_ShowChart / Grid_ChartSelector | `button[aria-label*="Show Chart"]` / `span[id*="ChartSelector"]` |
|
|
46
|
+
| Jump bar (A–Z) / All | Grid_JumpBar / Grid_FilterByAll | `#JumpBarItemsList` / `#All_link` |
|
|
47
|
+
| List command bar | Cmd_ContainerGrid | `ul[data-lp-id*="commandbar-HomePageGrid"]` |
|
|
48
|
+
|
|
49
|
+
## Forms
|
|
50
|
+
| D365 name | EasyRepro key | Locator |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| Form root | Entity_FormContainer | `[data-id="editFormRoot"]` |
|
|
53
|
+
| Record title (header) | Entity_HeaderTitle | `[data-id="header_title"]` |
|
|
54
|
+
| Header / header flyout / its ⌄ button | Entity_Header / _Flyout / _FlyoutButton | `div[data-id*="form-header"]` / `div[data-id="headerFieldsFlyout"]` / `button[id*="headerFieldsExpandButton"]` |
|
|
55
|
+
| Form selector (form name ⌄) | Entity_FormSelector | `[data-id="form-selector"]` |
|
|
56
|
+
| Tab list / a tab | Entity_TabList / Entity_Tab | `ul[id*="tablist"]` / `li[title="<tab>"]` (or `getByRole('tab', { name })`) |
|
|
57
|
+
| More tabs | Entity_MoreTabs | `div[data-id="more_button"]` |
|
|
58
|
+
| Field container | Entity_TextFieldContainer | `[data-id*="<field>-FieldSectionItemContainer"]` |
|
|
59
|
+
| Field label | Entity_TextFieldLabel | `label[id*="<field>-field-label"]` |
|
|
60
|
+
| Text / number / currency input | Entity_TextFieldValue | `input[data-id*="<field>.fieldControl"]` |
|
|
61
|
+
| Header field (text / lookup / choice / date) | Entity_Header_* | `div[data-id="header_<field>.fieldControl-text-box-container"]`, `div[data-id="header_<field>.fieldControl-Lookup_<field>"]`, `div[data-id="header_<field>"]`, `div[data-id="header_<field>-FieldSectionItemContainer"]` |
|
|
62
|
+
| Read-only / required marker | Field_ReadOnly / Field_RequiredIcon | `[aria-readonly]` / `div[data-id*="required-icon"]` inside the container |
|
|
63
|
+
| Record set navigator (prev/next record) | Entity_RecordSetNavigator | `button[data-lp-id*="recordset-navigator"]`, list `ul[data-id*="recordSetNavList"]` |
|
|
64
|
+
|
|
65
|
+
## Lookup fields
|
|
66
|
+
| D365 name | EasyRepro key | Locator |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| Lookup control | Entity_TextFieldLookupFieldContainer | `div[data-id="<field>.fieldControl-Lookup_<field>"]` |
|
|
69
|
+
| Lookup search (magnifier) button | Entity_TextFieldLookupSearchButton | `button[data-id*="<field>.fieldControl-LookupResultsDropdown_<field>_search"]` |
|
|
70
|
+
| Results flyout | Entity_LookupResultsDropdown | `[data-id*="<field>.fieldControl-LookupResultsDropdown_<field>_tab"]` |
|
|
71
|
+
| Result item (a record) | Lookup_ResultRows | `li[data-id*="LookupResultsDropdown"][data-id*="resultsContainer"]` |
|
|
72
|
+
| "No records found" | Entity_LookupFieldNoRecordsText | `[data-id="<field>.fieldControl-LookupResultsDropdown_<field>_No_Records_Text"]` |
|
|
73
|
+
| Selected value (a link) | Entity_LookupFieldExistingValue | `[data-id*="<field>.fieldControl-LookupResultsDropdown_<field>_selected_tag"][role="link"]` |
|
|
74
|
+
| Clear selected value (X) | Entity_LookupFieldDeleteExistingValue | `[data-id*="<field>.fieldControl-LookupResultsDropdown_<field>_selected_tag_delete"]` |
|
|
75
|
+
| Related table filter in the flyout | Lookup_RelatedEntityLabel | `li[aria-label*="<table display name>"][data-id*="LookupResultsDropdown"]` |
|
|
76
|
+
| "+ New" in the flyout | Lookup_NewButton | `button[data-id*="addNewBtnContainer"][data-id*="LookupResultsDropdown"]` |
|
|
77
|
+
| "Advanced lookup" | Lookup_AdvancedLookupButton | XPath `//button[.//label[text()='Advanced lookup']]` |
|
|
78
|
+
| Advanced lookup dialog | AdvancedLookup_Container | `div[data-lp-id*="MscrmControls.FieldControls.AdvancedLookupControl"]` |
|
|
79
|
+
| Advanced lookup search / results / Done | AdvancedLookup_SearchInput / _ResultRows / _DoneButton | `input[type="text"][placeholder="Search"]` / `div[ref="eLeftContainer"] div[role="row"]` / `getByRole('button', { name: 'Done' })` |
|
|
80
|
+
|
|
81
|
+
## Choices, Yes/No, dates, multi-select
|
|
82
|
+
| D365 name | EasyRepro key | Locator |
|
|
83
|
+
|---|---|---|
|
|
84
|
+
| Choice (option set) | Entity_OptionSetFieldContainer | `div[data-id="<field>.fieldControl-option-set-container"]` (a select or a combo box inside) |
|
|
85
|
+
| Status reason combo box | Entity_OptionsetStatusCombo | `div[data-id*="<field>.fieldControl-pickliststatus-comboBox"]`, list `ul[id*="<field>.fieldControl-pickliststatus-comboBox_list"]` |
|
|
86
|
+
| Yes/No as radio pair | Entity_BooleanFieldRadioContainer | `div[data-id*="<field>.fieldControl-checkbox-container"][role="radiogroup"]` |
|
|
87
|
+
| Yes/No as checkbox | Entity_BooleanFieldCheckbox | `input[data-id*="<field>.fieldControl-checkbox-toggle"]` |
|
|
88
|
+
| Yes/No as list | Entity_BooleanFieldList | `select[data-id*="<field>.fieldControl-checkbox-select"]` |
|
|
89
|
+
| Yes/No as toggle | Entity_BooleanFieldToggle | `div[data-id*="<field>.fieldControl-toggle-container"]` |
|
|
90
|
+
| Date input | Entity_FieldControlDateTimeInputUCI | `input[data-id*="<field>.fieldControl-date-time-input"]` |
|
|
91
|
+
| Time input | Entity_FieldControlDateTimeTimeInputUCI | `div[data-id*="<field>.fieldControl._timecontrol-datetime-container"] input` |
|
|
92
|
+
| Choices (multi-select) container | MultiSelect_DivContainer | `div[data-id*="<field>-FieldSectionItemContainer"]` |
|
|
93
|
+
| Multi-select search / caret / option | MultiSelect_InputSearch / _FlyoutCaret / _FlyoutOption | `input.msos-input` / `button.msos-caret-button` / XPath `//li[label[@title='<option>'] and contains(@class,'msos-option')]` |
|
|
94
|
+
| Multi-select chosen item / remove | MultiSelect_SelectedRecord_Label / _DeleteButton | `span.msos-selected-display-item-text` / `button[data-id*="delete"]` |
|
|
95
|
+
|
|
96
|
+
## Command bar
|
|
97
|
+
| D365 name | EasyRepro key | Locator |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| Form command bar | Cmd_Container | `ul[data-lp-id*="commandbar-Form"]` |
|
|
100
|
+
| A command | Cmd_Button | `getByRole('menuitem' or 'button', { name: '<text>' })` inside the bar; EasyRepro: `//*[contains(text(),'<text>')]` |
|
|
101
|
+
| Save | Entity_Save | XPath `//button[@role='menuitem' and .//*[text()='Save']]` (or the bar's `aria-label="Save (CTRL+S)"`) |
|
|
102
|
+
| More commands (⋯) / its flyout | Cmd_MoreCommandsMenu | the bar's `button[data-id*="OverflowButton"]`, flyout `#__flyoutRootNode` |
|
|
103
|
+
| Assign / Delete / Mark as Won / Lost | Entity_Assign / _Delete / _CloseOpportunityWin / _Loss | `button[data-id*="Assign"]`, `button[data-id*="Delete"]`, `button[data-id*="MarkAsWon"]`, `button[data-id*="MarkAsLost"]` |
|
|
104
|
+
| Process / Switch Process | Entity_Process / Entity_SwitchProcess | `button[data-id*="MBPF.ConvertTo"]` / `button[data-id*="SwitchProcess"]` |
|
|
105
|
+
|
|
106
|
+
## Subgrids and related grids
|
|
107
|
+
| D365 name | EasyRepro key | Locator |
|
|
108
|
+
|---|---|---|
|
|
109
|
+
| Subgrid contents | Entity_SubGridContents | `#dataSetRoot_<subgrid>` |
|
|
110
|
+
| Subgrid rows | Entity_SubGrid_Row | `div[data-id="<subgrid>-pcf_grid_control_container"] div[data-id="grid-container"] div[data-list-index="<n>"]` |
|
|
111
|
+
| Subgrid search | Entity_SubGridSearchBox | `div[data-id*="data-set-quickFind-container"]` |
|
|
112
|
+
| Subgrid command bar | Entity_SubGridCommandBar | `ul[data-id*="CommandBar"]` inside the subgrid; `ul[data-lp-id*="commandbar-SubGridStandard:<subgrid>"]` |
|
|
113
|
+
| Subgrid "+ New <table>" | Entity_SubGridAddButton | `button[data-id*="<table>.AddNewStandard"]` inside that command bar |
|
|
114
|
+
| Subgrid overflow (⋯) | Entity_SubGridCommandOverflowButton | `button[data-id*="OverflowButton"]` inside the subgrid |
|
|
115
|
+
| Subgrid view picker | Entity_SubGridViewPickerButton | `span[id*="ViewSelector"][id*="button"]` |
|
|
116
|
+
| Editable grid rows / cells | Entity_EditableSubGridListCellRows / …Cells | `div.wj-row[role="row"]` / `div[role="gridcell"]` |
|
|
117
|
+
| Related tab's grid command bar | Related_CommandBarButtonList | `ul[data-lp-id*="commandbar-SubGridAssociated"]` |
|
|
118
|
+
|
|
119
|
+
## Business process flow
|
|
120
|
+
| D365 name | EasyRepro key | Locator |
|
|
121
|
+
|---|---|---|
|
|
122
|
+
| Stage (in the stage bar) | BPF_NextStage_UCI | `li[id*="processHeaderStage"]` (by its text) |
|
|
123
|
+
| Stage flyout | BPF_Flyout_UCI / BPF_FormContext | `div[id*="businessProcessFlowFlyoutHeaderContainer"]` / `div[id*="ProcessStageControl-processHeaderStageFlyoutInnerContainer"]` |
|
|
124
|
+
| Next Stage / Set Active | BPF_NextStageButton_UCI / BPF_SetActiveButton | `button[data-id*="nextButtonContainer"]` / `button[data-id*="setActiveButton"]` |
|
|
125
|
+
| Pin (dock) / close the flyout | BPF_PinStageButton / BPF_CloseStageButton | `button[id*="stageDockModeButton"]` / `button[id*="stageContentClose"]` |
|
|
126
|
+
| A field in a stage | BPF_TextFieldContainer | `div[data-lp-id*="header_process_<field>"]`, container `div[id*="header_process_<field>-FieldSectionItemContainer"]` |
|
|
127
|
+
|
|
128
|
+
## Quick Create
|
|
129
|
+
| D365 name | EasyRepro key | Locator |
|
|
130
|
+
|---|---|---|
|
|
131
|
+
| Quick Create form | QuickCreate_FormContext | `section[data-id*="quickCreateRoot"]` (fields inside use the form patterns) |
|
|
132
|
+
| Save / Save and Close / Cancel | QuickCreate_SaveButton / _SaveAndCloseButton / _CancelButton | `button[id*="quickCreateSaveBtn"]` / `button[id*="quickCreateSaveAndCloseBtn"]` / `button[id*="quickCreateCancelBtn"]` |
|
|
133
|
+
|
|
134
|
+
## Dialogs and notifications
|
|
135
|
+
| D365 name | EasyRepro key | Locator |
|
|
136
|
+
|---|---|---|
|
|
137
|
+
| Any dialog | Dialog_DialogContext | `div[role="dialog"]` |
|
|
138
|
+
| Confirm / Cancel / OK (confirm dialogs) | Dialog_ConfirmButton / _CancelButton / _OkButton | `#confirmButton` / `#cancelButton` / `#okButton` |
|
|
139
|
+
| OK / Cancel (data dialogs: Assign, Close opportunity, Set state) | AssignDialog_OKButton, Dialog_SetStateActionButton… | `button[data-id*="ok_id"]` / `button[data-id*="cancel_id"]` |
|
|
140
|
+
| Set state dialog (Activate/Deactivate) | Dialog_SetStateDialog | `div[data-id="SetStateDialog"]` |
|
|
141
|
+
| Assign: Me / User or team | AssignDialog_ToggleField / _UserTeamLookupResults | `label[data-id*="rdoMe_id.fieldControl-checkbox-inner-first"]` / `ul[data-id*="systemuserview_id.fieldControl-LookupResultsDropdown_systemuserview_id_tab"]` |
|
|
142
|
+
| Duplicate records found | Entity_DuplicateDetectionWindowMarker | `div[data-id*="ManageDuplicates"]`; Ignore and save `button[data-id*="ignore_save"]`; Cancel `button[data-id*="close_dialog"]` |
|
|
143
|
+
| Form notification bar | Entity_FormNotifcationBar | `div[data-id*="notificationWrapper"]`; expand `#notificationExpandIcon`; list `ul[data-id="notificationList"]` |
|
|
144
|
+
| Form message bar (read-only form etc.) | Entity_FormMessageBar | `#notificationMessageAndButtons span` |
|
|
145
|
+
| Shared flyout root (menus, overflow) | Cmd_MoreCommandsMenu | `#__flyoutRootNode` |
|
|
146
|
+
|
|
147
|
+
## Global search results
|
|
148
|
+
| D365 name | EasyRepro key | Locator |
|
|
149
|
+
|---|---|---|
|
|
150
|
+
| Results / a result row | Search_Container / Search_Records | `#searchResultList` / `li[role="row"]` |
|
|
151
|
+
| Result tabs (by table) | Search_RelevanceSearchResultsTab | `section#searchComponent button[role="tab"][name="<table>"]` |
|
|
152
|
+
|
|
153
|
+
## Timeline, dashboards, Copilot
|
|
154
|
+
| D365 name | EasyRepro key | Locator |
|
|
155
|
+
|---|---|---|
|
|
156
|
+
| Timeline activity Save and Close | Timeline_SaveAndClose | `button[data-id*="<table>.SaveAndClose"]` |
|
|
157
|
+
| Dashboard selector / item | Dashboard_Selector / Dashboard_Item_UCI | `span[id*="Dashboard_Selector"]` / `li[data-text*="<name>"]` |
|
|
158
|
+
| Copilot side pane button / input | CustomerServiceCopilot_ControlButtonId / _UserInput | `button[id="sidepane-tab-button-AppSidePane_MscrmControls.CSIntelligence.AICopilotControl"]` / `textarea[data-id="webchat-sendbox-input"]` |
|
|
159
|
+
| Canvas app control inside a model-driven page | PowerApp_Control | `div[data-control-name="<control>"]` (inside its iframe) |
|
|
160
|
+
|
|
161
|
+
## Licence of the source
|
|
162
|
+
|
|
163
|
+
The locators above are taken from EasyRepro (https://github.com/microsoft/EasyRepro):
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
MIT License
|
|
167
|
+
|
|
168
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
169
|
+
|
|
170
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
171
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
172
|
+
in the Software without restriction, including without limitation the rights
|
|
173
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
174
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
175
|
+
furnished to do so, subject to the following conditions:
|
|
176
|
+
|
|
177
|
+
The above copyright notice and this permission notice shall be included in all
|
|
178
|
+
copies or substantial portions of the Software.
|
|
179
|
+
|
|
180
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
181
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
182
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
183
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
184
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
185
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
186
|
+
SOFTWARE
|
|
187
|
+
```
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Dynamics 365: steps for each control
|
|
2
|
+
|
|
3
|
+
Locators are in `elements.md`. "Wait for idle" means `window.UCWorkBlockTracker?.isAppIdle()` returns true, then
|
|
4
|
+
the next element is visible. Examples are Playwright (TypeScript); do the same with the repository's framework.
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
async waitForIdle() {
|
|
8
|
+
await this.page.waitForFunction(() => (window as any).UCWorkBlockTracker?.isAppIdle?.() ?? true)
|
|
9
|
+
}
|
|
10
|
+
const field = (name: string) => this.page.locator(`[data-id="${name}-FieldSectionItemContainer"]`)
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Text, number, currency
|
|
14
|
+
1. Fill `input[data-id*="<field>.fieldControl"]` inside the field's container, then press Tab (D365 commits a value on
|
|
15
|
+
blur; without it Save may not see it).
|
|
16
|
+
2. Currency and number fields reformat on blur (`1000` becomes `$1,000.00`): assert the formatted text.
|
|
17
|
+
|
|
18
|
+
## Lookup
|
|
19
|
+
1. Click the lookup's input inside `div[data-id="<field>.fieldControl-Lookup_<field>"]`, type the search text.
|
|
20
|
+
2. Wait for the results flyout (`…LookupResultsDropdown_<field>_tab`) and for idle; the first results can be the
|
|
21
|
+
recent items list, before the search ends.
|
|
22
|
+
3. Click the result item whose primary name matches exactly, never by position; for several tables (Customer: Account or
|
|
23
|
+
Contact) pick the table first with the related table filter.
|
|
24
|
+
4. Assert the selected tag (`…_selected_tag`, role link) shows the name.
|
|
25
|
+
5. Not in the first results: open "Advanced lookup", search, pick the row, "Done".
|
|
26
|
+
6. To clear: hover the selected tag, click its delete (`…_selected_tag_delete`).
|
|
27
|
+
- EasyRepro: `xrmApp.Entity.SetValue(new LookupItem { Name = "<field>", Value = "<name>", Index = 0 })`;
|
|
28
|
+
`ClearValue(new LookupItem { Name = "<field>" })`.
|
|
29
|
+
|
|
30
|
+
## Choice (option set) and status reason
|
|
31
|
+
1. Within `div[data-id="<field>.fieldControl-option-set-container"]`: a native `select` → `selectOption({ label })`;
|
|
32
|
+
a combo box (Fluent UI) → click it, then the option by role `option` and its name.
|
|
33
|
+
2. Status reason uses the `pickliststatus-comboBox`; its list opens under `#__flyoutRootNode` on newer versions.
|
|
34
|
+
- EasyRepro: `SetValue(new OptionSet { Name = "<field>", Value = "<label>" })`.
|
|
35
|
+
|
|
36
|
+
## Yes/No (two options)
|
|
37
|
+
- The same field can render as radio pair, checkbox, list or toggle, depending on the form: find which control the
|
|
38
|
+
container holds, and set it by its label (Yes/No or the custom labels), not by toggling blindly; assert after.
|
|
39
|
+
- EasyRepro: `SetValue(new BooleanItem { Name = "<field>", Value = true })`.
|
|
40
|
+
|
|
41
|
+
## Date and time
|
|
42
|
+
1. Fill the date input with the user's format (the field's placeholder shows it; it follows the user's personal
|
|
43
|
+
settings, so read it, never assume M/d/yyyy), press Tab. Time: the input in `…_timecontrol-datetime-container`.
|
|
44
|
+
2. Compute dates when the test runs. Date-only fields ignore the time; "user local" fields shift by time zone.
|
|
45
|
+
- EasyRepro: `SetValue("<field>", DateTime.Today.AddDays(3), "M/d/yyyy")` with the user's format.
|
|
46
|
+
|
|
47
|
+
## Choices (multi-select)
|
|
48
|
+
1. Click the container, type in `input.msos-input`, tick each option by its title, close the flyout (Escape).
|
|
49
|
+
2. Assert the chosen items (`span.msos-selected-display-item-text`).
|
|
50
|
+
- EasyRepro: `SetValue(new MultiValueOptionSet { Name = "<field>", Values = new[] { "A", "B" } }, removeExistingValues: true)`.
|
|
51
|
+
|
|
52
|
+
## Save
|
|
53
|
+
1. Ctrl+S or the command bar's Save; wait for idle.
|
|
54
|
+
2. Done when the notification bar has no error and the title has no "- Unsaved"; for a new record, the URL gets
|
|
55
|
+
`&id=<guid>`: read the id from the URL for later steps or cleanup.
|
|
56
|
+
3. An error banner (required fields, business rule): read its text from the notification list; a "Duplicate records
|
|
57
|
+
found" dialog: the test decides (Ignore and save or Cancel), never by default.
|
|
58
|
+
|
|
59
|
+
## Grid: find and open a record
|
|
60
|
+
1. Open the list by URL (`pagetype=entitylist&etn=<table>`), choose the view by the view selector if the test needs one.
|
|
61
|
+
2. Type in Quick Find (`input[id*="quickFind_text"]`), Enter, wait for idle.
|
|
62
|
+
3. Open the row whose primary-name cell has the exact text (a link in the cell); never row 0 without a filter.
|
|
63
|
+
- EasyRepro: `xrmApp.Grid.SwitchView("..."); xrmApp.Grid.Search("..."); xrmApp.Grid.OpenRecord(0)` (after a search
|
|
64
|
+
that returns one row).
|
|
65
|
+
|
|
66
|
+
## Subgrid
|
|
67
|
+
1. Scope everything to `#dataSetRoot_<subgrid>` or its `pcf_grid_control_container`.
|
|
68
|
+
2. "+ New <table>" opens Quick Create or a full form depending on the table's settings: wait for which appeared.
|
|
69
|
+
3. "Add Existing" opens a lookup flyout or dialog for the related table.
|
|
70
|
+
|
|
71
|
+
## Command bar
|
|
72
|
+
- Find the command by its accessible name or `data-id` inside the right bar (form, list, subgrid). If it is not
|
|
73
|
+
visible, open "More commands" (⋯) and look in `#__flyoutRootNode`. Commands show and hide by form state and security
|
|
74
|
+
role: assert it is there, not that it is not, unless that is the test.
|
|
75
|
+
- EasyRepro: `xrmApp.CommandBar.ClickCommand("Deactivate")`, and `ClickCommand("Flow", "Run Flow")` for a submenu.
|
|
76
|
+
|
|
77
|
+
## Business process flow
|
|
78
|
+
1. Click the stage in the stage bar, wait for its flyout; fill its fields (`header_process_<field>`), they save with
|
|
79
|
+
the record.
|
|
80
|
+
2. "Next Stage" moves on only when the stage's required fields are filled; assert the active stage after.
|
|
81
|
+
- EasyRepro: `xrmApp.BusinessProcessFlow.SelectStage("Qualify"); SetValue(...); NextStage("Qualify")`.
|
|
82
|
+
|
|
83
|
+
## Quick Create
|
|
84
|
+
1. Open from the top bar's "+" (Quick Create menu) or a subgrid/lookup "+ New".
|
|
85
|
+
2. Scope fields to `section[data-id*="quickCreateRoot"]`; "Save and Close" (`quickCreateSaveAndCloseBtn`); wait for
|
|
86
|
+
idle and for the panel to close.
|
|
87
|
+
- EasyRepro: `xrmApp.Navigation.QuickCreate("contact"); xrmApp.QuickCreate.SetValue(...); xrmApp.QuickCreate.Save()`.
|
|
88
|
+
|
|
89
|
+
## Dialogs
|
|
90
|
+
- Scope to `div[role="dialog"]`. Confirm dialogs use `#confirmButton`/`#cancelButton`; data dialogs (Assign, Close
|
|
91
|
+
opportunity, Set state) use `button[data-id*="ok_id"]`/`cancel_id`.
|
|
92
|
+
- "Unsaved changes" when leaving a dirty form: choose by the test's intent; never leave it open.
|
|
93
|
+
|
|
94
|
+
## Sign-in
|
|
95
|
+
- Reuse a saved session (Playwright `storageState`, a signed-in browser profile) made once by a setup step; sign in in a
|
|
96
|
+
test only when sign-in is what it checks. Users and passwords come from environment variables or the credential
|
|
97
|
+
store; an MFA secret only as an environment variable for a TOTP code, never in the repository.
|