diff --git a/.eslintrc.js b/.eslintrc.js index 389f6c4c14..affa3e617e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -164,6 +164,7 @@ module.exports = { '@typescript-eslint/no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_', vars: 'all' }], '@typescript-eslint/triple-slash-reference': ['error', { path: 'always', types: 'prefer-import', lib: 'always' }], + 'import/no-cycle': ['warn'], 'import/no-default-export': 'error', 'import/no-duplicates': 'error', 'import/no-extraneous-dependencies': 'error', diff --git a/packages/core/src/domain/session/oldCookiesMigration.spec.ts b/packages/core/src/domain/session/oldCookiesMigration.spec.ts index 5885e3ae42..faf61babf2 100644 --- a/packages/core/src/domain/session/oldCookiesMigration.spec.ts +++ b/packages/core/src/domain/session/oldCookiesMigration.spec.ts @@ -6,7 +6,7 @@ import { OLD_SESSION_COOKIE_NAME, tryOldCookiesMigration, } from './oldCookiesMigration' -import { SESSION_EXPIRATION_DELAY } from './sessionStore' +import { SESSION_EXPIRATION_DELAY } from './sessionConstants' import { SESSION_COOKIE_NAME } from './sessionCookieStore' describe('old cookies migration', () => { diff --git a/packages/core/src/domain/session/sessionConstants.ts b/packages/core/src/domain/session/sessionConstants.ts new file mode 100644 index 0000000000..440b1ebc97 --- /dev/null +++ b/packages/core/src/domain/session/sessionConstants.ts @@ -0,0 +1,4 @@ +import { ONE_HOUR, ONE_MINUTE } from '../../tools/utils' + +export const SESSION_TIME_OUT_DELAY = 4 * ONE_HOUR +export const SESSION_EXPIRATION_DELAY = 15 * ONE_MINUTE diff --git a/packages/core/src/domain/session/sessionCookieStore.ts b/packages/core/src/domain/session/sessionCookieStore.ts index fd3565c98f..920a1c480a 100644 --- a/packages/core/src/domain/session/sessionCookieStore.ts +++ b/packages/core/src/domain/session/sessionCookieStore.ts @@ -3,8 +3,8 @@ import { getCookie, setCookie } from '../../browser/cookie' import { isChromium } from '../../tools/browserDetection' import * as utils from '../../tools/utils' import { monitor } from '../internalMonitoring' +import { SESSION_EXPIRATION_DELAY } from './sessionConstants' import type { SessionState } from './sessionStore' -import { SESSION_EXPIRATION_DELAY } from './sessionStore' const SESSION_ENTRY_REGEXP = /^([a-z]+)=([a-z0-9-]+)$/ const SESSION_ENTRY_SEPARATOR = '&' diff --git a/packages/core/src/domain/session/sessionManager.spec.ts b/packages/core/src/domain/session/sessionManager.spec.ts index 526749ee58..b63b01848d 100644 --- a/packages/core/src/domain/session/sessionManager.spec.ts +++ b/packages/core/src/domain/session/sessionManager.spec.ts @@ -7,8 +7,8 @@ import type { RelativeTime } from '../../tools/timeUtils' import { isIE } from '../../tools/browserDetection' import type { SessionManager } from './sessionManager' import { startSessionManager, stopSessionManager, VISIBILITY_CHECK_DELAY } from './sessionManager' -import { SESSION_TIME_OUT_DELAY, SESSION_EXPIRATION_DELAY } from './sessionStore' import { SESSION_COOKIE_NAME } from './sessionCookieStore' +import { SESSION_EXPIRATION_DELAY, SESSION_TIME_OUT_DELAY } from './sessionConstants' const enum FakeTrackingType { NOT_TRACKED = 'not-tracked', diff --git a/packages/core/src/domain/session/sessionManager.ts b/packages/core/src/domain/session/sessionManager.ts index a2795d7be5..22c4e2ebfa 100644 --- a/packages/core/src/domain/session/sessionManager.ts +++ b/packages/core/src/domain/session/sessionManager.ts @@ -7,7 +7,8 @@ import { ContextHistory } from '../../tools/contextHistory' import type { RelativeTime } from '../../tools/timeUtils' import { relativeNow, clocksOrigin } from '../../tools/timeUtils' import { tryOldCookiesMigration } from './oldCookiesMigration' -import { startSessionStore, SESSION_TIME_OUT_DELAY } from './sessionStore' +import { startSessionStore } from './sessionStore' +import { SESSION_TIME_OUT_DELAY } from './sessionConstants' export interface SessionManager { findActiveSession: (startTime?: RelativeTime) => SessionContext | undefined diff --git a/packages/core/src/domain/session/sessionStore.spec.ts b/packages/core/src/domain/session/sessionStore.spec.ts index aa8850d98e..b4c8b4e068 100644 --- a/packages/core/src/domain/session/sessionStore.spec.ts +++ b/packages/core/src/domain/session/sessionStore.spec.ts @@ -3,8 +3,9 @@ import { mockClock } from '../../../test/specHelper' import type { CookieOptions } from '../../browser/cookie' import { getCookie, setCookie, COOKIE_ACCESS_DELAY } from '../../browser/cookie' import type { SessionStore } from './sessionStore' -import { startSessionStore, SESSION_EXPIRATION_DELAY, SESSION_TIME_OUT_DELAY } from './sessionStore' +import { startSessionStore } from './sessionStore' import { SESSION_COOKIE_NAME } from './sessionCookieStore' +import { SESSION_EXPIRATION_DELAY, SESSION_TIME_OUT_DELAY } from './sessionConstants' const enum FakeTrackingType { TRACKED = 'tracked', diff --git a/packages/core/src/domain/session/sessionStore.ts b/packages/core/src/domain/session/sessionStore.ts index 7c358ce413..4b476c6679 100644 --- a/packages/core/src/domain/session/sessionStore.ts +++ b/packages/core/src/domain/session/sessionStore.ts @@ -3,6 +3,7 @@ import { COOKIE_ACCESS_DELAY } from '../../browser/cookie' import { Observable } from '../../tools/observable' import * as utils from '../../tools/utils' import { monitor } from '../internalMonitoring' +import { SESSION_TIME_OUT_DELAY } from './sessionConstants' import { retrieveSession, withCookieLockAccess } from './sessionCookieStore' export interface SessionStore { @@ -23,9 +24,6 @@ export interface SessionState { [key: string]: string | undefined } -export const SESSION_EXPIRATION_DELAY = 15 * utils.ONE_MINUTE -export const SESSION_TIME_OUT_DELAY = 4 * utils.ONE_HOUR - /** * Different session concepts: * - tracked, the session has an id and is updated along the user navigation diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 672b3074d1..9dae29b0e9 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -37,7 +37,7 @@ export { } from './domain/session/sessionManager' export { SESSION_TIME_OUT_DELAY, // Exposed for tests -} from './domain/session/sessionStore' +} from './domain/session/sessionConstants' export { HttpRequest, Batch, diff --git a/packages/core/src/tools/createEventRateLimiter.ts b/packages/core/src/tools/createEventRateLimiter.ts index 7e08ea01e5..306c2e399c 100644 --- a/packages/core/src/tools/createEventRateLimiter.ts +++ b/packages/core/src/tools/createEventRateLimiter.ts @@ -1,5 +1,7 @@ -import type { RawError } from '..' -import { clocksNow, ErrorSource, ONE_MINUTE } from '..' +import type { RawError } from './error' +import { ErrorSource } from './error' +import { clocksNow } from './timeUtils' +import { ONE_MINUTE } from './utils' export type EventRateLimiter = ReturnType diff --git a/packages/core/src/transport/startBatchWithReplica.ts b/packages/core/src/transport/startBatchWithReplica.ts index 382a9eae85..585612f578 100644 --- a/packages/core/src/transport/startBatchWithReplica.ts +++ b/packages/core/src/transport/startBatchWithReplica.ts @@ -1,6 +1,7 @@ import type { Configuration, EndpointBuilder } from '../domain/configuration' import type { Context } from '../tools/context' -import { Batch, HttpRequest } from './index' +import { Batch } from './batch' +import { HttpRequest } from './httpRequest' export function startBatchWithReplica( configuration: Configuration, diff --git a/packages/rum/src/domain/record/privacy.ts b/packages/rum/src/domain/record/privacy.ts index 3d63eeb6a6..dc22e430ee 100644 --- a/packages/rum/src/domain/record/privacy.ts +++ b/packages/rum/src/domain/record/privacy.ts @@ -15,8 +15,6 @@ import { export const MAX_ATTRIBUTE_VALUE_CHAR_LENGTH = 100_000 -import { shouldIgnoreElement } from './serialize' - const TEXT_MASKING_CHAR = 'x' /** @@ -215,3 +213,76 @@ export function getTextContent( } return textContent } + +/** + * TODO: Preserve CSS element order, and record the presence of the tag, just don't render + * We don't need this logic on the recorder side. + * For security related meta's, customer can mask themmanually given they + * are easy to identify in the HEAD tag. + */ +export function shouldIgnoreElement(element: Element): boolean { + if (element.nodeName === 'SCRIPT') { + return true + } + + if (element.nodeName === 'LINK') { + const relAttribute = getLowerCaseAttribute('rel') + return ( + // Scripts + (relAttribute === 'preload' && getLowerCaseAttribute('as') === 'script') || + // Favicons + relAttribute === 'shortcut icon' || + relAttribute === 'icon' + ) + } + + if (element.nodeName === 'META') { + const nameAttribute = getLowerCaseAttribute('name') + const relAttribute = getLowerCaseAttribute('rel') + const propertyAttribute = getLowerCaseAttribute('property') + return ( + // Favicons + /^msapplication-tile(image|color)$/.test(nameAttribute) || + nameAttribute === 'application-name' || + relAttribute === 'icon' || + relAttribute === 'apple-touch-icon' || + relAttribute === 'shortcut icon' || + // Description + nameAttribute === 'keywords' || + nameAttribute === 'description' || + // Social + /^(og|twitter|fb):/.test(propertyAttribute) || + /^(og|twitter):/.test(nameAttribute) || + nameAttribute === 'pinterest' || + // Robots + nameAttribute === 'robots' || + nameAttribute === 'googlebot' || + nameAttribute === 'bingbot' || + // Http headers. Ex: X-UA-Compatible, Content-Type, Content-Language, cache-control, + // X-Translated-By + element.hasAttribute('http-equiv') || + // Authorship + nameAttribute === 'author' || + nameAttribute === 'generator' || + nameAttribute === 'framework' || + nameAttribute === 'publisher' || + nameAttribute === 'progid' || + /^article:/.test(propertyAttribute) || + /^product:/.test(propertyAttribute) || + // Verification + nameAttribute === 'google-site-verification' || + nameAttribute === 'yandex-verification' || + nameAttribute === 'csrf-token' || + nameAttribute === 'p:domain_verify' || + nameAttribute === 'verify-v1' || + nameAttribute === 'verification' || + nameAttribute === 'shopify-checkout-api-token' + ) + } + + function getLowerCaseAttribute(name: string) { + return (element.getAttribute(name) || '').toLowerCase() + } + + return false +} diff --git a/packages/rum/src/domain/record/serialize.ts b/packages/rum/src/domain/record/serialize.ts index e89f25253a..707d99bd0b 100644 --- a/packages/rum/src/domain/record/serialize.ts +++ b/packages/rum/src/domain/record/serialize.ts @@ -173,79 +173,6 @@ export function serializeElementNode(element: Element, options: SerializeOptions } } -/** - * TODO: Preserve CSS element order, and record the presence of the tag, just don't render - * We don't need this logic on the recorder side. - * For security related meta's, customer can mask themmanually given they - * are easy to identify in the HEAD tag. - */ -export function shouldIgnoreElement(element: Element): boolean { - if (element.nodeName === 'SCRIPT') { - return true - } - - if (element.nodeName === 'LINK') { - const relAttribute = getLowerCaseAttribute('rel') - return ( - // Scripts - (relAttribute === 'preload' && getLowerCaseAttribute('as') === 'script') || - // Favicons - relAttribute === 'shortcut icon' || - relAttribute === 'icon' - ) - } - - if (element.nodeName === 'META') { - const nameAttribute = getLowerCaseAttribute('name') - const relAttribute = getLowerCaseAttribute('rel') - const propertyAttribute = getLowerCaseAttribute('property') - return ( - // Favicons - /^msapplication-tile(image|color)$/.test(nameAttribute) || - nameAttribute === 'application-name' || - relAttribute === 'icon' || - relAttribute === 'apple-touch-icon' || - relAttribute === 'shortcut icon' || - // Description - nameAttribute === 'keywords' || - nameAttribute === 'description' || - // Social - /^(og|twitter|fb):/.test(propertyAttribute) || - /^(og|twitter):/.test(nameAttribute) || - nameAttribute === 'pinterest' || - // Robots - nameAttribute === 'robots' || - nameAttribute === 'googlebot' || - nameAttribute === 'bingbot' || - // Http headers. Ex: X-UA-Compatible, Content-Type, Content-Language, cache-control, - // X-Translated-By - element.hasAttribute('http-equiv') || - // Authorship - nameAttribute === 'author' || - nameAttribute === 'generator' || - nameAttribute === 'framework' || - nameAttribute === 'publisher' || - nameAttribute === 'progid' || - /^article:/.test(propertyAttribute) || - /^product:/.test(propertyAttribute) || - // Verification - nameAttribute === 'google-site-verification' || - nameAttribute === 'yandex-verification' || - nameAttribute === 'csrf-token' || - nameAttribute === 'p:domain_verify' || - nameAttribute === 'verify-v1' || - nameAttribute === 'verification' || - nameAttribute === 'shopify-checkout-api-token' - ) - } - - function getLowerCaseAttribute(name: string) { - return (element.getAttribute(name) || '').toLowerCase() - } - - return false -} - /** * Text Nodes are dependant on Element nodes * Privacy levels are set on elements so we check the parentElement of a text node diff --git a/performances/src/profilers/startCpuProfiling.ts b/performances/src/profilers/startCpuProfiling.ts index 9d8389ccfc..a07cca1643 100644 --- a/performances/src/profilers/startCpuProfiling.ts +++ b/performances/src/profilers/startCpuProfiling.ts @@ -1,6 +1,6 @@ import type { CDPSession } from 'puppeteer' import type { ProfilingOptions } from '../types' -import { isSdkBundleUrl } from './startProfiling' +import { isSdkBundleUrl } from '../utils' export async function startCPUProfiling(options: ProfilingOptions, client: CDPSession) { await client.send('Profiler.enable') diff --git a/performances/src/profilers/startMemoryProfiling.ts b/performances/src/profilers/startMemoryProfiling.ts index b7a356de3d..db8a38be60 100644 --- a/performances/src/profilers/startMemoryProfiling.ts +++ b/performances/src/profilers/startMemoryProfiling.ts @@ -1,6 +1,6 @@ import type { CDPSession } from 'puppeteer' +import { isSdkBundleUrl } from '../utils' import type { ProfilingOptions } from '../types' -import { isSdkBundleUrl } from './startProfiling' export async function startMemoryProfiling(options: ProfilingOptions, client: CDPSession) { await client.send('HeapProfiler.enable') diff --git a/performances/src/profilers/startNetworkProfiling.ts b/performances/src/profilers/startNetworkProfiling.ts index ca3dedfebe..48499c51dc 100644 --- a/performances/src/profilers/startNetworkProfiling.ts +++ b/performances/src/profilers/startNetworkProfiling.ts @@ -1,6 +1,6 @@ import type { CDPSession, Protocol } from 'puppeteer' import type { ProfilingOptions } from '../types' -import { isSdkBundleUrl } from './startProfiling' +import { isSdkBundleUrl } from '../utils' export async function startNetworkProfiling(options: ProfilingOptions, client: CDPSession) { await client.send('Network.enable') diff --git a/performances/src/profilers/startProfiling.ts b/performances/src/profilers/startProfiling.ts index 85774d7538..9f0138713d 100644 --- a/performances/src/profilers/startProfiling.ts +++ b/performances/src/profilers/startProfiling.ts @@ -19,7 +19,3 @@ export async function startProfiling(options: ProfilingOptions, page: Page) { }), } } - -export function isSdkBundleUrl(options: ProfilingOptions, url: string) { - return url === options.bundleUrl -} diff --git a/performances/src/utils.ts b/performances/src/utils.ts new file mode 100644 index 0000000000..0454b76576 --- /dev/null +++ b/performances/src/utils.ts @@ -0,0 +1,5 @@ +import type { ProfilingOptions } from './types' + +export function isSdkBundleUrl(options: ProfilingOptions, url: string) { + return url === options.bundleUrl +} diff --git a/test/e2e/lib/framework/createTest.ts b/test/e2e/lib/framework/createTest.ts index 65ef093a93..107742d1d5 100644 --- a/test/e2e/lib/framework/createTest.ts +++ b/test/e2e/lib/framework/createTest.ts @@ -1,9 +1,9 @@ import type { LogsInitConfiguration } from '@datadog/browser-logs' import type { RumInitConfiguration } from '@datadog/browser-rum-core' import { deleteAllCookies, getBrowserName, withBrowserLogs } from '../helpers/browser' -import { flushEvents } from '../helpers/flushEvents' import { validateRumFormat } from '../helpers/validation' import { EventRegistry } from './eventsRegistry' +import { flushEvents } from './flushEvents' import type { Servers } from './httpServers' import { getTestServers, waitForServersIdle } from './httpServers' import { log } from './logger' diff --git a/test/e2e/lib/helpers/flushEvents.ts b/test/e2e/lib/framework/flushEvents.ts similarity index 91% rename from test/e2e/lib/helpers/flushEvents.ts rename to test/e2e/lib/framework/flushEvents.ts index e50ddd6ba4..508f94c873 100644 --- a/test/e2e/lib/helpers/flushEvents.ts +++ b/test/e2e/lib/framework/flushEvents.ts @@ -1,5 +1,5 @@ -import { getTestServers, waitForServersIdle } from '../framework' -import { browserExecuteAsync } from './browser' +import { browserExecuteAsync } from '../helpers/browser' +import { getTestServers, waitForServersIdle } from './httpServers' export async function flushEvents() { // wait to process actions + event loop before switching page diff --git a/test/e2e/lib/framework/index.ts b/test/e2e/lib/framework/index.ts index d661f5a5a1..e0ff7e8379 100644 --- a/test/e2e/lib/framework/index.ts +++ b/test/e2e/lib/framework/index.ts @@ -2,3 +2,4 @@ export { createTest } from './createTest' export { bundleSetup, html } from './pageSetups' export { EventRegistry } from './eventsRegistry' export { getTestServers, waitForServersIdle } from './httpServers' +export { flushEvents } from './flushEvents' diff --git a/test/e2e/scenario/eventBridge.scenario.ts b/test/e2e/scenario/eventBridge.scenario.ts index d88cf3364d..7729231062 100644 --- a/test/e2e/scenario/eventBridge.scenario.ts +++ b/test/e2e/scenario/eventBridge.scenario.ts @@ -1,6 +1,5 @@ import { browserExecute, flushBrowserLogs } from '../lib/helpers/browser' -import { createTest, html } from '../lib/framework' -import { flushEvents } from '../lib/helpers/flushEvents' +import { createTest, flushEvents, html } from '../lib/framework' describe('bridge present', () => { createTest('send action') diff --git a/test/e2e/scenario/internalMonitoring.scenario.ts b/test/e2e/scenario/internalMonitoring.scenario.ts index 50132b0648..37fff08eb3 100644 --- a/test/e2e/scenario/internalMonitoring.scenario.ts +++ b/test/e2e/scenario/internalMonitoring.scenario.ts @@ -1,7 +1,6 @@ import type { TelemetryErrorEvent } from '@datadog/browser-core/src/domain/internalMonitoring/telemetryEvent.types' -import { bundleSetup, createTest } from '../lib/framework' +import { bundleSetup, createTest, flushEvents } from '../lib/framework' import { browserExecute } from '../lib/helpers/browser' -import { flushEvents } from '../lib/helpers/flushEvents' describe('internal monitoring', () => { createTest('send errors for logs') diff --git a/test/e2e/scenario/logs.scenario.ts b/test/e2e/scenario/logs.scenario.ts index e71f64a77a..9a4d64629c 100644 --- a/test/e2e/scenario/logs.scenario.ts +++ b/test/e2e/scenario/logs.scenario.ts @@ -1,8 +1,7 @@ import { DEFAULT_REQUEST_ERROR_RESPONSE_LENGTH_LIMIT } from '@datadog/browser-logs/cjs/domain/configuration' -import { createTest } from '../lib/framework' +import { createTest, flushEvents } from '../lib/framework' import { UNREACHABLE_URL } from '../lib/helpers/constants' import { browserExecute, browserExecuteAsync, flushBrowserLogs, withBrowserLogs } from '../lib/helpers/browser' -import { flushEvents } from '../lib/helpers/flushEvents' describe('logs', () => { createTest('send logs') diff --git a/test/e2e/scenario/recorder/recorder.scenario.ts b/test/e2e/scenario/recorder/recorder.scenario.ts index 20b73c913f..84f9067edb 100644 --- a/test/e2e/scenario/recorder/recorder.scenario.ts +++ b/test/e2e/scenario/recorder/recorder.scenario.ts @@ -18,9 +18,8 @@ import { } from '@datadog/browser-rum/test/utils' import { renewSession } from '../../lib/helpers/session' import type { EventRegistry } from '../../lib/framework' -import { createTest, bundleSetup, html } from '../../lib/framework' +import { flushEvents, createTest, bundleSetup, html } from '../../lib/framework' import { browserExecute } from '../../lib/helpers/browser' -import { flushEvents } from '../../lib/helpers/flushEvents' const INTEGER_RE = /^\d+$/ const TIMESTAMP_RE = /^\d{13}$/ diff --git a/test/e2e/scenario/recorder/viewports.scenario.ts b/test/e2e/scenario/recorder/viewports.scenario.ts index fb5a7d0ee5..e96194789c 100644 --- a/test/e2e/scenario/recorder/viewports.scenario.ts +++ b/test/e2e/scenario/recorder/viewports.scenario.ts @@ -4,9 +4,8 @@ import type { RumInitConfiguration } from '@datadog/browser-rum-core' import { findAllIncrementalSnapshots, findAllVisualViewports } from '@datadog/browser-rum/test/utils' import type { EventRegistry } from '../../lib/framework' -import { createTest, bundleSetup, html } from '../../lib/framework' +import { flushEvents, createTest, bundleSetup, html } from '../../lib/framework' import { browserExecute, getBrowserName, getPlatformName } from '../../lib/helpers/browser' -import { flushEvents } from '../../lib/helpers/flushEvents' const NAVBAR_HEIGHT_CHANGE_UPPER_BOUND = 30 const VIEWPORT_META_TAGS = ` diff --git a/test/e2e/scenario/rum/actions.scenario.ts b/test/e2e/scenario/rum/actions.scenario.ts index c4f17ff7e7..cd8341f872 100644 --- a/test/e2e/scenario/rum/actions.scenario.ts +++ b/test/e2e/scenario/rum/actions.scenario.ts @@ -1,6 +1,5 @@ import { withBrowserLogs } from '../../lib/helpers/browser' -import { createTest, html, waitForServersIdle } from '../../lib/framework' -import { flushEvents } from '../../lib/helpers/flushEvents' +import { createTest, flushEvents, html, waitForServersIdle } from '../../lib/framework' describe('action collection', () => { createTest('track a click action') diff --git a/test/e2e/scenario/rum/errors.scenario.ts b/test/e2e/scenario/rum/errors.scenario.ts index 2f6ca5465c..52dd03c1d1 100644 --- a/test/e2e/scenario/rum/errors.scenario.ts +++ b/test/e2e/scenario/rum/errors.scenario.ts @@ -1,7 +1,6 @@ import type { RumErrorEvent } from '@datadog/browser-rum-core' -import { createTest, html } from '../../lib/framework' +import { createTest, flushEvents, html } from '../../lib/framework' import { withBrowserLogs } from '../../lib/helpers/browser' -import { flushEvents } from '../../lib/helpers/flushEvents' // Note: using `browserExecute` to throw exceptions may result in "Script error." being reported, // because WDIO is evaluating the script in a different context than the page. diff --git a/test/e2e/scenario/rum/init.scenario.ts b/test/e2e/scenario/rum/init.scenario.ts index 350e4f5746..6121fe30a9 100644 --- a/test/e2e/scenario/rum/init.scenario.ts +++ b/test/e2e/scenario/rum/init.scenario.ts @@ -1,6 +1,5 @@ import type { EventRegistry } from '../../lib/framework' -import { createTest } from '../../lib/framework' -import { flushEvents } from '../../lib/helpers/flushEvents' +import { flushEvents, createTest } from '../../lib/framework' describe('API calls and events around init', () => { createTest('should be associated to corresponding views when views are automatically tracked') diff --git a/test/e2e/scenario/rum/resources.scenario.ts b/test/e2e/scenario/rum/resources.scenario.ts index 996b3485fc..0bd92dd3fd 100644 --- a/test/e2e/scenario/rum/resources.scenario.ts +++ b/test/e2e/scenario/rum/resources.scenario.ts @@ -1,8 +1,7 @@ import type { RumResourceEvent } from '@datadog/browser-rum' import type { EventRegistry } from '../../lib/framework' -import { bundleSetup, createTest, html } from '../../lib/framework' +import { flushEvents, bundleSetup, createTest, html } from '../../lib/framework' import { browserExecuteAsync, sendXhr } from '../../lib/helpers/browser' -import { flushEvents } from '../../lib/helpers/flushEvents' const REQUEST_DURATION = 200 diff --git a/test/e2e/scenario/rum/tracing.scenario.ts b/test/e2e/scenario/rum/tracing.scenario.ts index 04907bcb2e..af0943847b 100644 --- a/test/e2e/scenario/rum/tracing.scenario.ts +++ b/test/e2e/scenario/rum/tracing.scenario.ts @@ -1,7 +1,6 @@ import type { EventRegistry } from '../../lib/framework' -import { createTest } from '../../lib/framework' +import { flushEvents, createTest } from '../../lib/framework' import { browserExecuteAsync, sendXhr } from '../../lib/helpers/browser' -import { flushEvents } from '../../lib/helpers/flushEvents' describe('tracing', () => { createTest('trace xhr') diff --git a/test/e2e/scenario/rum/views.scenario.ts b/test/e2e/scenario/rum/views.scenario.ts index 6d6e2dd612..91cdab244f 100644 --- a/test/e2e/scenario/rum/views.scenario.ts +++ b/test/e2e/scenario/rum/views.scenario.ts @@ -1,5 +1,4 @@ -import { flushEvents } from '../../lib/helpers/flushEvents' -import { createTest, html } from '../../lib/framework' +import { createTest, flushEvents, html } from '../../lib/framework' import { browserExecute, getBrowserName, sendXhr } from '../../lib/helpers/browser' import { expireSession, renewSession } from '../../lib/helpers/session'