Skip to content

Commit 27fc082

Browse files
committed
EDU-9495: Added code snippets and prompts for the AI-Assisted Diagnostics and Testing for Acumatica Customizations workshop/help guide
1 parent 8a49541 commit 27fc082

11 files changed

Lines changed: 319 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using AIAssistedDiagnostics.ModernUI.Tests.Tests;
3+
using Core.Login;
4+
using Core.TestExecution;
5+
6+
namespace GeneratedWrappers.SOLUTIONNAME
7+
{
8+
internal class StartTests
9+
{
10+
public void Execute()
11+
{
12+
PxLogin.LoginToDestinationSite();
13+
14+
using (TestExecution.CreateTestStepGroup("RS301000 smoke test"))
15+
{
16+
Console.WriteLine("Starting RS301000 smoke test...");
17+
18+
var rs301000Tests = new RS301000_LaborQuantityTests();
19+
rs301000Tests.RepairWorkOrdersScreen_CanOpenPreparedWorkOrder();
20+
}
21+
22+
23+
// TODO: Run the test that verifies that the labor quantity is restored after setting it below the configured value.
24+
///////////// The added code
25+
using (TestExecution.CreateTestStepGroup("RS301000 labor quantity validation test"))
26+
{
27+
Console.WriteLine("Starting RS301000 labor quantity validation test...");
28+
29+
var rs301000Tests = new RS301000_LaborQuantityTests();
30+
rs301000Tests.LaborQuantity_WhenBelowConfigured_RestoresConfiguredQuantity();
31+
32+
}
33+
//////////// The end of the added code
34+
}
35+
}
36+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System;
2+
using AIAssistedDiagnostics.ModernUI.Tests.Tests;
3+
using Core.Login;
4+
using Core.TestExecution;
5+
6+
namespace GeneratedWrappers.SOLUTIONNAME
7+
{
8+
internal class StartTests
9+
{
10+
public void Execute()
11+
{
12+
PxLogin.LoginToDestinationSite();
13+
14+
using (TestExecution.CreateTestStepGroup("RS301000 smoke test"))
15+
{
16+
Console.WriteLine("Starting RS301000 smoke test...");
17+
18+
var rs301000Tests = new RS301000_LaborQuantityTests();
19+
rs301000Tests.RepairWorkOrdersScreen_CanOpenPreparedWorkOrder();
20+
}
21+
22+
23+
// Run the test that verifies that the labor quantity is restored after setting it below the configured value.
24+
///////////// The modified code
25+
// using (TestExecution.CreateTestStepGroup("RS301000 labor quantity validation test"))
26+
// {
27+
// Console.WriteLine("Starting RS301000 labor quantity validation test...");
28+
29+
// var rs301000Tests = new RS301000_LaborQuantityTests();
30+
31+
// rs301000Tests.LaborQuantity_WhenBelowConfigured_RestoresConfiguredQuantity();
32+
33+
// }
34+
//////////// The end of the modified code
35+
}
36+
}
37+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using AIAssistedDiagnostics.ModernUI.Tests.Tests;
3+
using Core.Login;
4+
using Core.TestExecution;
5+
6+
namespace GeneratedWrappers.SOLUTIONNAME
7+
{
8+
internal class StartTests
9+
{
10+
public void Execute()
11+
{
12+
PxLogin.LoginToDestinationSite();
13+
14+
using (TestExecution.CreateTestStepGroup("RS301000 smoke test"))
15+
{
16+
Console.WriteLine("Starting RS301000 smoke test...");
17+
18+
var rs301000Tests = new RS301000_LaborQuantityTests();
19+
rs301000Tests.RepairWorkOrdersScreen_CanOpenPreparedWorkOrder();
20+
}
21+
22+
23+
// Run the test that verifies that the labor quantity is restored after setting it below the configured value.
24+
///////////// The modified code
25+
using (TestExecution.CreateTestStepGroup("RS301000 labor quantity validation test"))
26+
{
27+
Console.WriteLine("Starting RS301000 labor quantity validation test...");
28+
29+
var rs301000Tests = new RS301000_LaborQuantityTests();
30+
rs301000Tests.LaborQuantity_WhenBelowConfigured_RestoresConfiguredQuantity();
31+
32+
}
33+
//////////// The end of the modified code
34+
}
35+
}
36+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Inspect the generated Modern UI Test SDK wrapper for RS301000.
2+
3+
Do not modify files.
4+
5+
Use these files as context:
6+
- Wrappers\Generated\RS\RS301000.cs
7+
- RepairWorkOrdersScreen.cs
8+
- TestData.cs
9+
10+
Please identify:
11+
1. The generated screen class and namespace.
12+
2. The member used for the Order Nbr. field.
13+
3. The member used for the Labor grid.
14+
4. The member used for the Labor Quantity field.
15+
5. The methods used to save and refresh the screen or grid.
16+
6. The helper methods in RepairWorkOrdersScreen that wrap these generated members.
17+
7. Any wrapper members that are missing or not confirmed.
18+
8. Any member names that Copilot should not invent.
19+
20+
Use exact member names from the generated wrapper.
21+
If a member does not clearly exist, say that it is missing instead of inventing one.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Draft a UI test for the Repair Work Orders labor quantity
2+
validation scenario.
3+
4+
Target screen:
5+
RS301000 Repair Work Orders
6+
7+
Scenario:
8+
Open existing repair work order 000001 whose labor line has a configured/default quantity of 1.
9+
Change the labor quantity to 0.
10+
Trigger validation by using the project’s established save/update pattern.
11+
Verify that the UI restores the labor quantity to 1.
12+
If the wrapper exposes field warning information,
13+
also verify that the QuantityTooSmall warning is shown.
14+
15+
Use the open files as context:
16+
- The generated RS301000 wrapper class.
17+
- The RepairWorkOrdersScreen helper class.
18+
- The TestData helper class.
19+
- The existing Test SDK test base class or sample test, if available.
20+
21+
Requirements:
22+
1. Use generated wrapper members where available.
23+
2. Prefer the RepairWorkOrdersScreen helper methods where possible.
24+
3. Do not use direct DOM selectors unless the wrappers do not expose the needed element.
25+
4. Use deterministic test data from TestData.
26+
5. Open work order 000001.
27+
6. Change the labor quantity from 1 to 0.
28+
7. Trigger validation.
29+
8. Assert that the final labor quantity is 1.
30+
9. Assert the QuantityTooSmall warning only if the wrapper exposes a reliable way to inspect it.
31+
10. Use Arrange, Act, Assert comments.
32+
11. Avoid hardcoded credentials, tenant secrets, local paths, or environment-specific URLs.
33+
12. Add TODO comments where wrapper names or test data must be verified.
34+
13. Name the test method as LaborQuantity_WhenBelowConfigured_RestoresConfiguredQuantity
35+
36+
Constraints:
37+
- Do not invent wrapper members.
38+
- Do not rewrite existing helpers unless the helper has a clear TODO.
39+
- Do not modify configuration files.
40+
- Do not create broad setup logic that distracts from the test scenario.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Explain the generated test.
2+
3+
Do not modify files.
4+
5+
Please cover:
6+
1. Which repair work order data the test depends on.
7+
2. How the test opens the screen.
8+
3. How it opens work order 000001.
9+
4. How it changes the labor quantity from 1 to 0.
10+
5. How it triggers validation.
11+
6. How it verifies that the quantity is restored to 1.
12+
7. Whether the test can verify the QuantityTooSmall warning.
13+
8. Which wrapper members or test data values still need SME verification.
14+
9. Which prepared Test SDK output or log artifact should be used if the live test cannot be run.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Review this Test SDK test failure.
2+
3+
Context:
4+
- The test uses generated Modern UI Test SDK wrappers.
5+
- The target screen is Repair Work Orders (RS301000).
6+
- The test is intended to validate the UI behavior for RSSVWorkOrderLabor.Quantity.
7+
- The related Unit Test Framework test now passes.
8+
- Expected UI behavior: after entering quantity 0 for a labor line whose
9+
configured/default quantity is 1, validation restores the quantity to 1.
10+
If supported by wrappers, the QuantityTooSmall warning should also be visible.
11+
12+
Test goal:
13+
Verify that the UI workflow reflects the repaired labor quantity validation behavior.
14+
15+
Relevant test code:
16+
[Reference the test method or paste the method if needed.]
17+
18+
Relevant wrapper members:
19+
- WorkOrders_fsColumnAOrder.OrderNbr
20+
- Labor_gridLabor.Row.Quantity
21+
- Save()
22+
- Labor_gridLabor.Refresh()
23+
24+
Failure output:
25+
[Paste the cleaned failure message, log excerpt, or screenshot description.]
26+
27+
Please classify the likely cause:
28+
1. Wrapper/member mismatch
29+
2. Test data issue
30+
3. Timing/wait issue
31+
4. Validation not triggered by the test
32+
5. Application behavior issue
33+
6. Environment/configuration issue
34+
35+
For each likely cause, suggest the next diagnostic step.
36+
37+
Do not modify files.
38+
Do not assume the application is defective unless the evidence supports it.
39+
Do not invent wrapper members or unsupported APIs.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Classify this Acumatica unit test failure.
2+
3+
Failure output:
4+
- Failed assertion: Assert.Equal()
5+
- Expected value: 3
6+
- Actual value: 1
7+
- Stack Trace: RSSVWorkOrderEntryTests.TestRepairWorkOrdersForm() line 152
8+
9+
Use the open test and implementation files as context.
10+
11+
Please classify the failure as one of the following:
12+
1. Failed assertion
13+
2. Runtime exception
14+
3. Missing dependency/service registration
15+
4. Setup DAC or test data issue
16+
5. Implementation defect
17+
18+
Then explain:
19+
- What evidence supports the classification
20+
- Which file or method to inspect first
21+
- What not to change yet
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Inspect the failing TestRepairWorkOrdersForm unit test.
2+
3+
Files to review:
4+
- PhoneRepairShop_Code.Tests/RSSVWorkOrderEntryTests.cs
5+
- PhoneRepairShop_Code/RSSVWorkOrderEntry.cs
6+
- PhoneRepairShop_Code/Helper/Messages.cs
7+
8+
The expected rule is:
9+
When RSSVWorkOrderLabor.Quantity is lower than the configured labor quantity,
10+
the system should attach the QuantityTooSmall warning and restore the quantity to the
11+
configured value.
12+
13+
Observed failure:
14+
The test sets woLabor.Quantity to 1. The QuantityTooSmall warning is expected, and woLabor.
15+
Quantity should be restored to 3.
16+
The test fails at the quantity assertion.
17+
18+
Failing assertion:
19+
Assert.Equal(3, woLabor.Quantity)
20+
21+
Actual value:
22+
1
23+
24+
Do not edit files yet.
25+
26+
Please:
27+
1. Explain what the failing assertion means.
28+
2. Identify the most likely root cause.
29+
3. Point to the method or event handler to inspect first.
30+
4. Explain why the warning can still appear while the quantity is not restored.
31+
5. Propose the smallest safe fix.
32+
6. List assumptions I should verify before editing code.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
The original fix did not make the TestRepairWorkOrdersForm test pass.
2+
3+
Original failure:
4+
Expected woLabor.Quantity to be 3 after setting it to 1, but it remained 1.
5+
6+
New failure:
7+
[Paste the new failure output.]
8+
9+
Do not edit files yet.
10+
11+
Please compare the new failure with the original failure and identify
12+
whether the fix was incomplete or whether a different assertion is now failing.

0 commit comments

Comments
 (0)