Hello, I used this formula and it looks ok in most cases, but there are cases where a test is failed and also exists as To Do in a new test execution. In that case it is shown as failed in the “overall execution status” in the issue navigator, but it is shown as To Do in the above EazyBI formula.
To fix that I’ve added the following condition (AND [Xray Test Run Status].CurrentMember.name <> ‘TODO’)), and I’ve added a new calculated member for To Do:
[Measures].[Xray Test Count by Last Execution Status in Test Plan] is defined as:
CASE WHEN
[Xray Test Run Status].CurrentMember.Level.Name = "Status"
THEN --count tests by last execution status
Cache(NonZero(Count(
Filter(
--iterate throug all Tests
Descendants([Xray Test].CurrentMember, [Xray Test].[Test]),
[Measures].[Xray Tests with executions] > 0 AND
Order(
--iterate through execution statuses for a selected Test
Filter([Xray Test Run Status].[Status].Members,
[Measures].[Xray Tests with executions] > 0
-- ADDITIONAL CONDITION to exclude planned executions
AND [Xray Test Run Status].CurrentMember.name <> 'TODO'),
--order statuses by execution date descending
DateParse(
Generate(
Tail(
--iterate through all dates when a Test was executed
Filter([Time].[Day].Members,
[Measures].[Xray Tests with executions] > 0
)).Item(0),
Format([Time].CurrentHierarchyMember.StartDate, 'yyyy-mm-dd'),
",")),
BDESC
--name of the last execution matches status in columns
).item(0) IS [Xray Test Run Status].CurrentMember)
)))
ELSE --total count of tests with executions
([Measures].[Xray Tests with executions],
[Xray Test Run Status].DefaultMember)
END
[Measures].[Execution Status Pass] =
(
[Measures].[Xray Test Count by Last Execution Status in Test Plan],
[Xray Test Run Status].[PASS]
)
[Measures].[Execution Status Fail] =
(
[Measures].[Xray Test Count by Last Execution Status in Test Plan],
[Xray Test Run Status].[FAIL]
)
To Do is defined as follows:
[Measures].[Xray Tests created] -
[Measures].[Execution Status Pass] -
[Measures].[Execution Status Fail]
UPDATE: The formulas are updated to use the new dimension name “Xray Test Run Status”. Dimension “Xray Test Execution Status” was renamed to “Xray Test Run Status” in version 6.5.