2021-10-15 14:22:49 -08:00
|
|
|
/**
|
|
|
|
* Copyright (c) Microsoft Corporation.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2023-03-06 18:49:14 -08:00
|
|
|
import type { Language } from '../../playwright-core/src/utils/isomorphic/locatorGenerators';
|
2022-09-20 18:41:51 -07:00
|
|
|
import type { ResourceSnapshot } from '@trace/snapshot';
|
|
|
|
import type * as trace from '@trace/trace';
|
2021-10-15 14:22:49 -08:00
|
|
|
|
|
|
|
export type ContextEntry = {
|
2023-05-05 15:12:18 -07:00
|
|
|
isPrimary: boolean;
|
2022-02-07 17:05:42 -08:00
|
|
|
traceUrl: string;
|
2021-10-15 14:22:49 -08:00
|
|
|
startTime: number;
|
|
|
|
endTime: number;
|
|
|
|
browserName: string;
|
2023-09-11 23:06:56 +02:00
|
|
|
channel?: string;
|
2021-11-09 22:13:51 -08:00
|
|
|
platform?: string;
|
|
|
|
wallTime?: number;
|
2022-10-18 22:23:40 -04:00
|
|
|
sdkLanguage?: Language;
|
2023-02-17 11:19:53 -08:00
|
|
|
testIdAttributeName?: string;
|
2021-11-01 20:23:35 -08:00
|
|
|
title?: string;
|
2021-10-15 14:22:49 -08:00
|
|
|
options: trace.BrowserContextEventOptions;
|
|
|
|
pages: PageEntry[];
|
|
|
|
resources: ResourceSnapshot[];
|
|
|
|
actions: trace.ActionTraceEvent[];
|
2023-02-27 15:29:20 -08:00
|
|
|
events: trace.EventTraceEvent[];
|
2023-07-10 18:36:28 -07:00
|
|
|
stdio: trace.StdioTraceEvent[];
|
2023-08-19 16:13:42 -07:00
|
|
|
initializers: { [key: string]: trace.ConsoleMessageTraceEvent['initializer'] };
|
2021-11-15 23:37:39 -08:00
|
|
|
hasSource: boolean;
|
2021-10-15 14:22:49 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
export type PageEntry = {
|
|
|
|
screencastFrames: {
|
|
|
|
sha1: string,
|
|
|
|
timestamp: number,
|
|
|
|
width: number,
|
|
|
|
height: number,
|
|
|
|
}[];
|
|
|
|
};
|
|
|
|
export function createEmptyContext(): ContextEntry {
|
|
|
|
return {
|
2023-05-05 15:12:18 -07:00
|
|
|
isPrimary: false,
|
2022-02-07 17:05:42 -08:00
|
|
|
traceUrl: '',
|
2021-10-18 08:30:23 -08:00
|
|
|
startTime: Number.MAX_SAFE_INTEGER,
|
|
|
|
endTime: 0,
|
2021-10-15 14:22:49 -08:00
|
|
|
browserName: '',
|
|
|
|
options: {
|
|
|
|
deviceScaleFactor: 1,
|
|
|
|
isMobile: false,
|
|
|
|
viewport: { width: 1280, height: 800 },
|
|
|
|
},
|
|
|
|
pages: [],
|
|
|
|
resources: [],
|
|
|
|
actions: [],
|
|
|
|
events: [],
|
2023-07-10 18:36:28 -07:00
|
|
|
stdio: [],
|
2023-02-27 15:29:20 -08:00
|
|
|
initializers: {},
|
2021-11-15 23:37:39 -08:00
|
|
|
hasSource: false
|
2021-10-15 14:22:49 -08:00
|
|
|
};
|
|
|
|
}
|