creevey 0.10.0-beta.25 → 0.10.0-beta.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/web/assets/{index-Bmw2S3ik.js → index-Bk1_hhr8.js} +83 -83
- package/dist/client/web/index.html +1 -1
- package/dist/creevey.js +3 -3
- package/dist/creevey.js.map +1 -1
- package/dist/server/config.js +18 -2
- package/dist/server/config.js.map +1 -1
- package/dist/server/connection.d.ts +2 -3
- package/dist/server/connection.js +6 -13
- package/dist/server/connection.js.map +1 -1
- package/dist/server/index.js +28 -12
- package/dist/server/index.js.map +1 -1
- package/dist/server/master/pool.d.ts +1 -0
- package/dist/server/master/pool.js +4 -2
- package/dist/server/master/pool.js.map +1 -1
- package/dist/server/master/queue.d.ts +1 -1
- package/dist/server/master/queue.js +13 -6
- package/dist/server/master/queue.js.map +1 -1
- package/dist/server/playwright/internal.js +6 -15
- package/dist/server/playwright/internal.js.map +1 -1
- package/dist/server/selenium/internal.js +6 -15
- package/dist/server/selenium/internal.js.map +1 -1
- package/dist/server/selenium/selenoid.js +8 -4
- package/dist/server/selenium/selenoid.js.map +1 -1
- package/dist/server/utils.js +5 -2
- package/dist/server/utils.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.js.map +1 -1
- package/package.json +3 -1
- package/src/creevey.ts +3 -3
- package/src/server/config.ts +19 -1
- package/src/server/connection.ts +7 -13
- package/src/server/index.ts +32 -16
- package/src/server/master/pool.ts +6 -2
- package/src/server/master/queue.ts +20 -7
- package/src/server/playwright/internal.ts +5 -18
- package/src/server/selenium/internal.ts +5 -18
- package/src/server/selenium/selenoid.ts +7 -4
- package/src/server/utils.ts +3 -2
- package/src/types.ts +2 -0
@@ -430,7 +430,6 @@ export class InternalBrowser {
|
|
430
430
|
gridUrl,
|
431
431
|
viewport,
|
432
432
|
storybookUrl: address,
|
433
|
-
resolveStorybookUrl: config.resolveStorybookUrl,
|
434
433
|
});
|
435
434
|
|
436
435
|
return done ? internalBrowser : null;
|
@@ -453,13 +452,11 @@ export class InternalBrowser {
|
|
453
452
|
gridUrl,
|
454
453
|
viewport,
|
455
454
|
storybookUrl,
|
456
|
-
resolveStorybookUrl,
|
457
455
|
}: {
|
458
456
|
browserName: string;
|
459
457
|
gridUrl: string;
|
460
458
|
viewport?: { width: number; height: number };
|
461
459
|
storybookUrl: string;
|
462
|
-
resolveStorybookUrl?: () => Promise<string>;
|
463
460
|
}): Promise<boolean> {
|
464
461
|
const sessionId = (await this.#browser.getSession()).getId();
|
465
462
|
let browserHost = '';
|
@@ -483,7 +480,7 @@ export class InternalBrowser {
|
|
483
480
|
return await runSequence(
|
484
481
|
[
|
485
482
|
() => this.#browser.manage().setTimeouts({ pageLoad: 60000, script: 60000 }),
|
486
|
-
() => this.openStorybookPage(storybookUrl
|
483
|
+
() => this.openStorybookPage(storybookUrl),
|
487
484
|
() => this.waitForStorybook(),
|
488
485
|
() => this.updateStorybookGlobals(),
|
489
486
|
() => this.resolveCreeveyHost(),
|
@@ -500,25 +497,15 @@ export class InternalBrowser {
|
|
500
497
|
);
|
501
498
|
}
|
502
499
|
|
503
|
-
private async openStorybookPage(storybookUrl: string
|
500
|
+
private async openStorybookPage(storybookUrl: string): Promise<void> {
|
504
501
|
if (!LOCALHOST_REGEXP.test(storybookUrl)) {
|
505
502
|
return this.#browser.get(appendIframePath(storybookUrl));
|
506
503
|
}
|
507
504
|
|
508
505
|
try {
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
const resolvedUrl = await resolver();
|
513
|
-
|
514
|
-
logger().debug(`Resolver storybook url ${resolvedUrl}`);
|
515
|
-
|
516
|
-
await this.#browser.get(appendIframePath(resolvedUrl));
|
517
|
-
} else {
|
518
|
-
// TODO Pageload timeout 10s
|
519
|
-
// NOTE: getUrlChecker already calls `browser.get` so we don't need another one
|
520
|
-
await resolveStorybookUrl(appendIframePath(storybookUrl), (url) => this.checkUrl(url));
|
521
|
-
}
|
506
|
+
// TODO Pageload timeout 10s
|
507
|
+
// NOTE: getUrlChecker already calls `browser.get` so we don't need another one
|
508
|
+
await resolveStorybookUrl(appendIframePath(storybookUrl), (url) => this.checkUrl(url));
|
522
509
|
} catch (error) {
|
523
510
|
logger().error('Failed to resolve storybook URL', error instanceof Error ? error.message : '');
|
524
511
|
throw error;
|
@@ -2,7 +2,8 @@ import path from 'path';
|
|
2
2
|
import assert from 'assert';
|
3
3
|
import { lstatSync, existsSync } from 'fs';
|
4
4
|
import { mkdir, writeFile, copyFile } from 'fs/promises';
|
5
|
-
import
|
5
|
+
import { exec, chmod } from 'shelljs';
|
6
|
+
import kill from 'tree-kill';
|
6
7
|
import { Config, BrowserConfigObject } from '../../types.js';
|
7
8
|
import { downloadBinary, getCreeveyCache } from '../utils.js';
|
8
9
|
import { pullImages, runImage } from '../docker.js';
|
@@ -91,12 +92,12 @@ export async function startSelenoidStandalone(config: Config, debug: boolean): P
|
|
91
92
|
|
92
93
|
// TODO Download browser webdrivers
|
93
94
|
try {
|
94
|
-
if (process.platform != 'win32')
|
95
|
+
if (process.platform != 'win32') chmod('+x', binaryPath);
|
95
96
|
} catch {
|
96
97
|
/* noop */
|
97
98
|
}
|
98
99
|
|
99
|
-
const selenoidProcess =
|
100
|
+
const selenoidProcess = exec(`${binaryPath} -conf ./browsers.json -disable-docker`, {
|
100
101
|
async: true,
|
101
102
|
cwd: selenoidConfigDir,
|
102
103
|
});
|
@@ -106,7 +107,9 @@ export async function startSelenoidStandalone(config: Config, debug: boolean): P
|
|
106
107
|
selenoidProcess.stderr?.pipe(process.stderr);
|
107
108
|
}
|
108
109
|
|
109
|
-
subscribeOn('shutdown', () =>
|
110
|
+
subscribeOn('shutdown', () => {
|
111
|
+
if (selenoidProcess.pid) kill(selenoidProcess.pid);
|
112
|
+
});
|
110
113
|
}
|
111
114
|
|
112
115
|
export async function startSelenoidContainer(config: Config, debug: boolean): Promise<string> {
|
package/src/server/utils.ts
CHANGED
@@ -3,6 +3,7 @@ import https from 'https';
|
|
3
3
|
import http from 'http';
|
4
4
|
import cluster from 'cluster';
|
5
5
|
import { dirname } from 'path';
|
6
|
+
import kill from 'tree-kill';
|
6
7
|
import { fileURLToPath, pathToFileURL } from 'url';
|
7
8
|
import { register as esmRegister } from 'tsx/esm/api';
|
8
9
|
import { register as cjsRegister } from 'tsx/cjs/api';
|
@@ -97,7 +98,7 @@ export async function shutdownWorkers(): Promise<void> {
|
|
97
98
|
(worker) =>
|
98
99
|
new Promise<void>((resolve) => {
|
99
100
|
const timeout = setTimeout(() => {
|
100
|
-
worker.kill();
|
101
|
+
if (worker.process.pid) kill(worker.process.pid);
|
101
102
|
}, 10000);
|
102
103
|
worker.on('exit', () => {
|
103
104
|
clearTimeout(timeout);
|
@@ -113,7 +114,7 @@ export async function shutdownWorkers(): Promise<void> {
|
|
113
114
|
export function gracefullyKill(worker: Worker): void {
|
114
115
|
worker.isShuttingDown = true;
|
115
116
|
const timeout = setTimeout(() => {
|
116
|
-
worker.kill();
|
117
|
+
if (worker.process.pid) kill(worker.process.pid);
|
117
118
|
}, 10000);
|
118
119
|
worker.on('exit', () => {
|
119
120
|
clearTimeout(timeout);
|
package/src/types.ts
CHANGED
@@ -365,7 +365,9 @@ export interface Options {
|
|
365
365
|
screenDir?: string;
|
366
366
|
reportDir?: string;
|
367
367
|
gridUrl?: string;
|
368
|
+
storybookStart?: boolean | string;
|
368
369
|
storybookUrl?: string;
|
370
|
+
storybookPort?: string;
|
369
371
|
storybookAutorunCmd?: string;
|
370
372
|
saveReport: boolean;
|
371
373
|
failFast?: boolean;
|