[Synthetics] Failed tests by step panel (#149322)

## Summary

Failed tests by step panel

Fixes https://github.com/elastic/kibana/issues/145368

<img width="1523" alt="image"
src="https://user-images.githubusercontent.com/3505601/214053308-458c023e-aaab-4db6-8aa4-a18ce150ce19.png">
This commit is contained in:
Shahzad 2023-01-24 19:22:46 +01:00 committed by GitHub
parent cdc373719a
commit ded5f9a2ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 181 additions and 32 deletions

View file

@ -8,11 +8,14 @@
import { expect, Page } from '@elastic/synthetics';
export async function waitForLoadingToFinish({ page }: { page: Page }) {
while (true) {
let retries = 50;
while (retries) {
retries--;
if ((await page.$(byTestId('kbnLoadingMessage'))) === null) break;
await page.waitForTimeout(2 * 1000);
}
while (true) {
retries = 50;
while (retries) {
if ((await page.$(byTestId('globalLoadingIndicator'))) === null) break;
await page.waitForTimeout(2 * 1000);
}

View file

@ -48,7 +48,7 @@ export function useClientMetricsQuery() {
const backendValue = backEnd.values[pkey] ?? 0;
return {
pageViews: { value: (esQueryResponse.hits.total as any as number) ?? 0 },
pageViews: { value: esQueryResponse.hits.total.value ?? 0 },
totalPageLoadDuration: { value: totalPageLoadDurationValueMs },
backEnd: { value: backendValue },
frontEnd: { value: totalPageLoadDurationValueMs - backendValue },

View file

@ -63,9 +63,9 @@ export function useJsErrorsQuery(pagination: {
return {
totalErrorPages: totalErrorPages?.value ?? 0,
totalErrors: esQueryResponse.hits.total ?? 0,
totalErrors: esQueryResponse.hits.total.value ?? 0,
totalErrorGroups: totalErrorGroups?.value ?? 0,
items: errors?.buckets.map(({ sample, key, impactedPages }: any) => {
items: errors?.buckets.map(({ sample, key, impactedPages }) => {
return {
count: impactedPages.pageCount.value,
errorGroupId: key,

View file

@ -22,8 +22,7 @@ export function formatHasRumResult<T>(
if (!esResult) return esResult;
return {
indices,
// @ts-ignore total.value is undefined by the returned type, total is a `number`
hasData: esResult.hits.total > 0,
hasData: esResult.hits.total.value > 0,
serviceName:
esResult.aggregations?.services?.mostTraffic?.buckets?.[0]?.key,
};