Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: rename common files to start with lower case

Pavel Feldman5822de844a39
diff --git a/src/chromium/Launcher.ts b/src/chromium/Launcher.ts
index 879045a041..b2b4ad4e42 100644
--- a/src/chromium/Launcher.ts
+++ b/src/chromium/Launcher.ts
@@ -24,11 +24,11 @@ import * as URL from 'url';
import { Browser } from './Browser';
import { BrowserFetcher, BrowserFetcherOptions } from '../browserFetcher';
import { Connection } from './Connection';
-import { TimeoutError } from '../Errors';
+import { TimeoutError } from '../errors';
import { assert, debugError, helper } from '../helper';
import * as types from '../types';
import { PipeTransport } from './PipeTransport';
-import { WebSocketTransport } from './WebSocketTransport';
+import { WebSocketTransport } from '../webSocketTransport';
import { ConnectionTransport } from '../types';
import * as util from 'util';
import { launchProcess, waitForLine } from '../processLauncher';
diff --git a/src/chromium/Playwright.ts b/src/chromium/Playwright.ts
index 6cf5608f42..ce98c34c0e 100644
--- a/src/chromium/Playwright.ts
+++ b/src/chromium/Playwright.ts
@@ -18,8 +18,8 @@
import { Browser } from './Browser';
import { BrowserFetcher, BrowserFetcherOptions, BrowserFetcherRevisionInfo, OnProgressCallback } from '../browserFetcher';
import { ConnectionTransport } from '../types';
-import { DeviceDescriptors, DeviceDescriptor } from '../DeviceDescriptors';
-import * as Errors from '../Errors';
+import { DeviceDescriptors, DeviceDescriptor } from '../deviceDescriptors';
+import * as Errors from '../errors';
import { Launcher, LauncherBrowserOptions, LauncherChromeArgOptions, LauncherLaunchOptions, createBrowserFetcher } from './Launcher';
type Devices = { [name: string]: DeviceDescriptor } & DeviceDescriptor[];
diff --git a/src/chromium/api.ts b/src/chromium/api.ts
index e50a936c02..9cead6fc5f 100644
--- a/src/chromium/api.ts
+++ b/src/chromium/api.ts
@@ -4,7 +4,7 @@
export { ConsoleMessage } from '../console';
export { Dialog } from '../dialog';
export { ElementHandle } from '../dom';
-export { TimeoutError } from '../Errors';
+export { TimeoutError } from '../errors';
export { Frame } from '../frames';
export { Keyboard, Mouse } from '../input';
export { ExecutionContext, JSHandle } from '../javascript';
diff --git a/src/firefox/Launcher.ts b/src/firefox/Launcher.ts
index 64be042f12..7088154aba 100644
--- a/src/firefox/Launcher.ts
+++ b/src/firefox/Launcher.ts
@@ -23,7 +23,7 @@ import {BrowserFetcher, BrowserFetcherOptions} from '../browserFetcher';
import * as fs from 'fs';
import * as util from 'util';
import {debugError, assert} from '../helper';
-import {TimeoutError} from '../Errors';
+import {TimeoutError} from '../errors';
import {WebSocketTransport} from './WebSocketTransport';
import { launchProcess, waitForLine } from '../processLauncher';
diff --git a/src/firefox/Playwright.ts b/src/firefox/Playwright.ts
index 89af36b022..8c64c387f0 100644
--- a/src/firefox/Playwright.ts
+++ b/src/firefox/Playwright.ts
@@ -17,8 +17,8 @@
import { Browser } from './Browser';
import { BrowserFetcher, BrowserFetcherOptions, OnProgressCallback, BrowserFetcherRevisionInfo } from '../browserFetcher';
import { ConnectionTransport } from '../types';
-import { DeviceDescriptors, DeviceDescriptor } from '../DeviceDescriptors';
-import * as Errors from '../Errors';
+import { DeviceDescriptors, DeviceDescriptor } from '../deviceDescriptors';
+import * as Errors from '../errors';
import { Launcher, createBrowserFetcher } from './Launcher';
type Devices = { [name: string]: DeviceDescriptor } & DeviceDescriptor[];
diff --git a/src/firefox/api.ts b/src/firefox/api.ts
index 466d1fcb38..8791edcb1a 100644
--- a/src/firefox/api.ts
+++ b/src/firefox/api.ts
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
-export { TimeoutError } from '../Errors';
+export { TimeoutError } from '../errors';
export { Keyboard, Mouse } from '../input';
export { Browser } from './Browser';
export { BrowserContext } from '../browserContext';
diff --git a/src/frames.ts b/src/frames.ts
index 07c4b8657e..2e71e34096 100644
--- a/src/frames.ts
+++ b/src/frames.ts
@@ -22,7 +22,7 @@ import * as dom from './dom';
import * as network from './network';
import { helper, assert, RegisteredListener } from './helper';
import { ClickOptions, MultiClickOptions, PointerActionOptions, SelectOption } from './input';
-import { TimeoutError } from './Errors';
+import { TimeoutError } from './errors';
import { Events } from './events';
import { Page } from './page';
import { ConsoleMessage } from './console';
diff --git a/src/helper.ts b/src/helper.ts
index de659b0d58..21052db77b 100644
--- a/src/helper.ts
+++ b/src/helper.ts
@@ -16,7 +16,7 @@
*/
import * as debug from 'debug';
-import { TimeoutError } from './Errors';
+import { TimeoutError } from './errors';
export const debugError = debug(`playwright:error`);
diff --git a/src/input.ts b/src/input.ts
index a104c2faab..0c3b0f846c 100644
--- a/src/input.ts
+++ b/src/input.ts
@@ -5,7 +5,7 @@ import * as fs from 'fs';
import * as path from 'path';
import { assert, helper } from './helper';
import * as types from './types';
-import * as keyboardLayout from './USKeyboardLayout';
+import * as keyboardLayout from './usKeyboardLayout';
const readFileAsync = helper.promisify(fs.readFile);
diff --git a/src/page.ts b/src/page.ts
index d59cb0634c..b2aa6539ed 100644
--- a/src/page.ts
+++ b/src/page.ts
@@ -23,7 +23,7 @@ import * as input from './input';
import * as js from './javascript';
import * as network from './network';
import { Screenshotter } from './screenshotter';
-import { TimeoutSettings } from './TimeoutSettings';
+import { TimeoutSettings } from './timeoutSettings';
import * as types from './types';
import { Events } from './events';
import { BrowserContext, BrowserInterface } from './browserContext';
diff --git a/src/processLauncher.ts b/src/processLauncher.ts
index 02d75dd8fc..bdba530882 100644
--- a/src/processLauncher.ts
+++ b/src/processLauncher.ts
@@ -20,7 +20,7 @@ import * as stream from 'stream';
import * as removeFolder from 'rimraf';
import { helper } from './helper';
import * as readline from 'readline';
-import { TimeoutError } from './Errors';
+import { TimeoutError } from './errors';
const removeFolderAsync = helper.promisify(removeFolder);
diff --git a/src/chromium/WebSocketTransport.ts b/src/webSocketTransport.ts
similarity index 97%
rename from src/chromium/WebSocketTransport.ts
rename to src/webSocketTransport.ts
index 57306ed475..478b08eae6 100644
--- a/src/chromium/WebSocketTransport.ts
+++ b/src/webSocketTransport.ts
@@ -16,7 +16,7 @@
*/
import * as WebSocket from 'ws';
-import { ConnectionTransport } from '../types';
+import { ConnectionTransport } from './types';
export class WebSocketTransport implements ConnectionTransport {
private _ws: WebSocket;
diff --git a/src/webkit/Input.ts b/src/webkit/Input.ts
index b1522fe1c6..d14a546ec6 100644
--- a/src/webkit/Input.ts
+++ b/src/webkit/Input.ts
@@ -17,7 +17,7 @@
import * as input from '../input';
import { helper } from '../helper';
-import { macEditingCommands } from '../USKeyboardLayout';
+import { macEditingCommands } from '../usKeyboardLayout';
import { TargetSession } from './Connection';
function toModifiersMask(modifiers: Set<input.Modifier>): number {
diff --git a/src/webkit/Playwright.ts b/src/webkit/Playwright.ts
index 4a37cb2693..5057635cba 100644
--- a/src/webkit/Playwright.ts
+++ b/src/webkit/Playwright.ts
@@ -16,8 +16,8 @@
*/
import { Browser } from './Browser';
import { BrowserFetcher, BrowserFetcherOptions, OnProgressCallback, BrowserFetcherRevisionInfo } from '../browserFetcher';
-import { DeviceDescriptors } from '../DeviceDescriptors';
-import * as Errors from '../Errors';
+import { DeviceDescriptors } from '../deviceDescriptors';
+import * as Errors from '../errors';
import { Launcher, LauncherLaunchOptions, createBrowserFetcher } from './Launcher';
export class Playwright {
diff --git a/src/webkit/api.ts b/src/webkit/api.ts
index 42df78a5a3..ae27636b9b 100644
--- a/src/webkit/api.ts
+++ b/src/webkit/api.ts
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
-export { TimeoutError } from '../Errors';
+export { TimeoutError } from '../errors';
export { Browser } from './Browser';
export { BrowserContext } from '../browserContext';
export { BrowserFetcher } from '../browserFetcher';
diff --git a/test/launcher.spec.js b/test/launcher.spec.js
index 346dcb08b4..7ef8c05820 100644
--- a/test/launcher.spec.js
+++ b/test/launcher.spec.js
@@ -116,11 +116,11 @@ module.exports.addTests = function({testRunner, expect, defaultBrowserOptions, p
describe('Top-level requires', function() {
it('should require top-level Errors', async() => {
- const Errors = require(path.join(utils.projectRoot(), '/Errors'));
+ const Errors = require(path.join(utils.projectRoot(), '/errors'));
expect(Errors.TimeoutError).toBe(playwright.errors.TimeoutError);
});
it('should require top-level DeviceDescriptors', async() => {
- const Devices = require(path.join(utils.projectRoot(), '/DeviceDescriptors'));
+ const Devices = require(path.join(utils.projectRoot(), '/deviceDescriptors'));
expect(Devices['iPhone 6']).toBe(playwright.devices['iPhone 6']);
});
});