From 2a05eefb339c488dfd08d0e47db9afa4f4c0a986 Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Mon, 26 Feb 2024 23:31:58 -0600 Subject: [PATCH] fix: correct unwanted sorting and formatting of imports. --- packages/playwright/src/program.ts | 27 ++++++++++--------- packages/playwright/src/worker/testTracing.ts | 5 ++-- packages/playwright/types/test.d.ts | 2 +- tests/page/pageTestApi.ts | 2 +- .../playwright.artifacts.spec.ts | 2 +- .../playwright-test/playwright.trace.spec.ts | 4 +-- utils/generate_types/overrides-test.d.ts | 2 +- 7 files changed, 23 insertions(+), 21 deletions(-) diff --git a/packages/playwright/src/program.ts b/packages/playwright/src/program.ts index c204932da2..fc67d5353e 100644 --- a/packages/playwright/src/program.ts +++ b/packages/playwright/src/program.ts @@ -16,24 +16,25 @@ /* eslint-disable no-console */ +import type { Command } from 'playwright-core/lib/utilsBundle'; import fs from 'fs'; import path from 'path'; -import { program } from 'playwright-core/lib/cli/program'; -import { gracefullyProcessExitDoNotHang, startProfiling, stopProfiling } from 'playwright-core/lib/utils'; -import type { Command } from 'playwright-core/lib/utilsBundle'; -import type { ReporterDescription, TraceMode } from '../types/test'; -import type { FullResult, TestError } from '../types/testReporter'; -import { builtInReporters, defaultReporter, defaultTimeout } from './common/config'; -import { loadConfigFromFileRestartIfNeeded, loadEmptyConfigForMergeReports } from './common/configLoader'; -import type { ConfigCLIOverrides } from './common/ipc'; -import { prepareErrorStack } from './reporters/base'; +import { Runner } from './runner/runner'; +import { stopProfiling, startProfiling, gracefullyProcessExitDoNotHang } from 'playwright-core/lib/utils'; +import { serializeError } from './util'; import { showHTMLReport } from './reporters/html'; import { createMergedReport } from './reporters/merge'; -import { Runner } from './runner/runner'; -import { runTestServer } from './runner/testServer'; -import { cacheDir } from './transform/compilationCache'; -import { serializeError } from './util'; +import { loadConfigFromFileRestartIfNeeded, loadEmptyConfigForMergeReports } from './common/configLoader'; +import type { ConfigCLIOverrides } from './common/ipc'; +import type { FullResult, TestError } from '../types/testReporter'; +import type { TraceMode } from '../types/test'; +import { builtInReporters, defaultReporter, defaultTimeout } from './common/config'; +import { program } from 'playwright-core/lib/cli/program'; export { program } from 'playwright-core/lib/cli/program'; +import type { ReporterDescription } from '../types/test'; +import { prepareErrorStack } from './reporters/base'; +import { cacheDir } from './transform/compilationCache'; +import { runTestServer } from './runner/testServer'; function addTestCommand(program: Command) { const command = program.command('test [test-filter...]'); diff --git a/packages/playwright/src/worker/testTracing.ts b/packages/playwright/src/worker/testTracing.ts index c9ad6839b7..82c84000e7 100644 --- a/packages/playwright/src/worker/testTracing.ts +++ b/packages/playwright/src/worker/testTracing.ts @@ -19,10 +19,11 @@ import type * as trace from '@trace/trace'; import type EventEmitter from 'events'; import fs from 'fs'; import path from 'path'; -import { ManualPromise, calculateSha1, createGuid, monotonicTime } from 'playwright-core/lib/utils'; +import { ManualPromise, calculateSha1, monotonicTime, createGuid } from 'playwright-core/lib/utils'; import { yauzl, yazl } from 'playwright-core/lib/zipBundle'; -import type { PlaywrightWorkerOptions, TestInfo, TestInfoError, TraceMode } from '../../types/test'; +import type { TestInfo, TestInfoError } from '../../types/test'; import { filteredStackTrace } from '../util'; +import type { TraceMode, PlaywrightWorkerOptions } from '../../types/test'; import type { TestInfoImpl } from './testInfo'; export type Attachment = TestInfo['attachments'][0]; diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index 4791b9d42f..11ceb7153a 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import type { APIRequestContext, APIResponse, Browser, BrowserContext, BrowserContextOptions, Geolocation, HTTPCredentials, LaunchOptions, Locator, Page, PageScreenshotOptions, ViewportSize } from 'playwright-core'; +import type { APIRequestContext, Browser, BrowserContext, BrowserContextOptions, Page, LaunchOptions, ViewportSize, Geolocation, HTTPCredentials, Locator, APIResponse, PageScreenshotOptions } from 'playwright-core'; export * from 'playwright-core'; export type ReporterDescription = diff --git a/tests/page/pageTestApi.ts b/tests/page/pageTestApi.ts index 15eb8fffca..a7b124a84b 100644 --- a/tests/page/pageTestApi.ts +++ b/tests/page/pageTestApi.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import type { PageScreenshotOptions, ScreenshotMode, VideoMode } from '@playwright/test'; import type { Page, ViewportSize } from 'playwright-core'; +import type { PageScreenshotOptions, ScreenshotMode, VideoMode } from '@playwright/test'; export { expect } from '@playwright/test'; // Page test does not guarantee an isolated context, just a new page (because Android). diff --git a/tests/playwright-test/playwright.artifacts.spec.ts b/tests/playwright-test/playwright.artifacts.spec.ts index 709c027a9a..8a6db7fd2e 100644 --- a/tests/playwright-test/playwright.artifacts.spec.ts +++ b/tests/playwright-test/playwright.artifacts.spec.ts @@ -14,9 +14,9 @@ * limitations under the License. */ +import { test, expect } from './playwright-test-fixtures'; import fs from 'fs'; import path from 'path'; -import { expect, test } from './playwright-test-fixtures'; function listFiles(dir: string): string[] { const result: string[] = []; diff --git a/tests/playwright-test/playwright.trace.spec.ts b/tests/playwright-test/playwright.trace.spec.ts index 1c74e39599..41ce802500 100644 --- a/tests/playwright-test/playwright.trace.spec.ts +++ b/tests/playwright-test/playwright.trace.spec.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import fs from 'fs'; +import { test, expect } from './playwright-test-fixtures'; import { parseTrace, parseTraceRaw } from '../config/utils'; -import { expect, test } from './playwright-test-fixtures'; +import fs from 'fs'; test.describe.configure({ mode: 'parallel' }); diff --git a/utils/generate_types/overrides-test.d.ts b/utils/generate_types/overrides-test.d.ts index 8cd43a6750..eed775d21f 100644 --- a/utils/generate_types/overrides-test.d.ts +++ b/utils/generate_types/overrides-test.d.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { APIRequestContext, APIResponse, Browser, BrowserContext, BrowserContextOptions, Geolocation, HTTPCredentials, LaunchOptions, Locator, Page, PageScreenshotOptions, ViewportSize } from 'playwright-core'; +import type { APIRequestContext, Browser, BrowserContext, BrowserContextOptions, Page, LaunchOptions, ViewportSize, Geolocation, HTTPCredentials, Locator, APIResponse, PageScreenshotOptions } from 'playwright-core'; export * from 'playwright-core'; export type ReporterDescription =