mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[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:
parent
cdc373719a
commit
ded5f9a2ca
15 changed files with 181 additions and 32 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 },
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue