Giter VIP home page Giter VIP logo

test-automation-examples's Introduction

Test-Automation-Examples

Collections of examples used in my test automation classes for Dynamics 365 Business Central and Dynamics NAV

Example 1: Blocking Deletion of Warehouse Shipment Lines

For scope description see #1

Flowchart - Blocking Deletion of Warehouse Shipment Lines

Example 2: Extended Text on Assembly Documents

For scope description see #3

Flowchart - Extended Text on Assembly Orders - Part 1

Example 3: Automatically Set Posting Period on GL Setup and User Setup

For scope description see #4

Flowchart - Automatically Set Posting Period on GL Setup and User Setup

Azure DevOps pipelines have been setup for this project.

test-automation-examples's People

Contributors

fluxxusnl avatar lvanvugt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

test-automation-examples's Issues

Solve failing tests on Extended Text on Assembly Documents

All tests fail in build pipeline due to missing demo data in sandbox environment.

Shared fixture needs to extended so it takes care of missing date.

Error message 1

Posted Assembly Order Nos. must have a value in Assembly Setup: Primary Key=. It cannot be zero or empty.

Solution 1

Make sure Assembly Setup is created with Posted Assembly Order Nos. populated with no. series code.

Error message 2

There is no Unit of Measure within the filter.\Filters: Code: <>''

Solution 2

Make sure a unit of measure is created.

Error message 3

Blanket Assembly Order Nos. must have a value in Assembly Setup: Primary Key=. It cannot be zero or empty.

Solution 3

Make sure Assembly Setup is created with Blanket Assembly Order Nos. populated with no. series code.

Error message 4

Assembly Quote Nos. must have a value in Assembly Setup: Primary Key=. It cannot be zero or empty.

Solution 4

Make sure Assembly Setup is created with Assembly Quote Nos. populated with no. series code.

Note

In on-prem data is present, and tests need also to run successfully here.

Solve failing tests on Blocking Deletion of Warehouse Shipment Lines

9 out 11 test fail in build pipeline due to missing demo data in sandbox environment.

Shared fixture needs to extended so it takes care of missing date.

Error message

Order Nos. must have a value in Sales & Receivables Setup: Primary Key=. It cannot be zero or empty.

Solution

Make sure Sales & Receivables Setup is created with Order Nos. populated with no. series code.

Note

In on-prem data is present, and tests need also to run successfully here.

Adding ADO pipelines

Experimenting with ALOps to add pipelines for this repo. This issue will be used as placeholder for all relevant info and link commits to it.

Block Deletion example: shouldn't [SCENARIO #0011] THEN-part be extended?

Issue

Currently the THEN-part of [SCENARIO #0011] of the Block Deletion of Warehouse Shipment Lines example only contains:

// [THEN] Empty error occurred

Shouldn't this be extended to also validate that the shipment line indeed has not been deleted?

Note

If the THEN-part is going to be extended to the above suggestion you will have to exercise a Commit after the last [GIVEN] as otherwise the error triggered in the [WHEN] will rollback any of the data created before it.

First example: Blocking Deletion of Warehouse Shipment Lines

Blocking Deletion of Warehouse Shipment Lines

Scope
It should be possible to disallow the deletion of automatically created warehouse shipment lines by a (warehouse) employee. However, if authorized, the employee should be able to do this anyway.

  • feature enabling is managed on Warehouse Setup by means of new boolean field Unblock Deletion of Shpt. Line
    • when field is turned on any warehouse shipment line can be deleted
    • when field is turned off (default) normal warehouse shipment lines can be deleted; automatically created warehouse shipment lines can only be deleted by an authorized warehouse employee
  • authorization of employee is managed by new boolean field Allowed to Delete Shpt. Line on Warehouse Employee (note that this is per location)
  • automatically created warehouse shipment lines are classified by new boolean field System-Created Entry on Warehouse Shipment Line

Out of scope

  • automatic creation of warehouse shipment lines

Flowchart - Blocking Deletion of Warehouse Shipment Lines

Build warning Extended-Text-On-Assembly-Documents implicit conversion Option to Enum

The build Extended-Text-On-Assembly-Documents gives following warning (and more likewise):

##[warning]c:\Run\DevOps\VSCode\Extended Text on Assembly Documents\test\src\codeunit\ExtendedTextAOItemLine.Codeunit.al(282,113): warning AL0603: An implicit conversion is being performed from a value of type 'Integer' to a value of type 'Enum "Assembly Document Line Type"'. This conversion can lead to unexpected runtime issues. This warning will become an error in a future release.

Refactor "Blocking Deletion of Warehouse Shipment Lines" example to unit tests

WIth the ATDD (including Test Plan (TP)) approach we tests the full scenarios that include all kind of data setup prerequisites. This is time consuming, both in designing, building and executing. As Vjeko showed in various sessions on Days of Knowledge and BC TechDays, we could make it all more efficient by wrinting testable code allowing to test purely the business logic. In this way we can buid better code - in units - and (unit) test more efficient .

@CNAPilaro and I are investigating how the ATDD/TP approach can be combined with Vjeko's approach. The result might get presented at Direction EMEA 2023, and the code will be stroed in the branch DirectionsEMA2023.

Third Example: Automatically Set Posting Period on GL Setup and User Setup

Automatically Set Posting Period on GL Setup and User Setup
On of the consequences of closing accounting period(s) is that, on both G/L Setup nd USer Setup the fields "Allow Posting From" and "Allow Posting To", need to be updated the current or next period. This is a manual action.

Scope
With this third test automation example we are adding a small feature to Business Central to allow for an automatic update of these fields by running a batch job. The flowchart below points out the main user scenarios that needs to be implemented and verified.

Flowchart - Automatically Set Posting Period on GL Setup and User Setup

Thanx to Peter Conijn, one of my great colleagues at The Learning Network, for implementing the major part of the code based on my design.

Second Example: Extended Text on Assembly Documents

Extended Text on Assembly Documents

The standard Extended Text feature in Business Central allows the user to add items, resources, g/l accounts and standard texts to purchase, sales and services documents. This Archerpoint blog post nicely describes the essence of this feature.

Scope
With this second test automation example we are extending this feature to assembly documents. The flowchart below points out the main user scenarios that needs to be implemented and verified.

Flowchart - Extended Text on Assembly Documents - Part 1

Flowchart - Extended Text on Assembly Documents - Part 2

Notes

  • Assembly documents only allow item, resource and text lines; no g/l lines
  • 72 base scenarios have been defined and implemented, focussing on adding individual item, resource and text lines to an assembly document; so far, no tests have been defined for documents with multiple item, resource and/or text lines

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.