creevey 0.9.0-beta.14 → 0.9.0-beta.16

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.
@@ -24,7 +24,7 @@ process.on('unhandledRejection', shutdownOnException);
24
24
  if (cluster.isWorker) process.on('SIGINT', noop);
25
25
  if (cluster.isPrimary) process.on('SIGINT', shutdown);
26
26
  const argv = minimist(process.argv.slice(2), {
27
- string: ['browser', 'config', 'reporter', 'reportDir', 'screenDir'],
27
+ string: ['browser', 'config', 'reporter', 'reportDir', 'screenDir', 'storybookUrl'],
28
28
  boolean: ['debug', 'ui', 'saveReport', 'tests'],
29
29
  default: {
30
30
  port: 3000,
@@ -56,6 +56,7 @@ export async function readConfig(options) {
56
56
  if (options.failFast != undefined) userConfig.failFast = Boolean(options.failFast);
57
57
  if (options.reportDir) userConfig.reportDir = path.resolve(options.reportDir);
58
58
  if (options.screenDir) userConfig.screenDir = path.resolve(options.screenDir);
59
+ if (options.storybookUrl) userConfig.storybookUrl = options.storybookUrl;
59
60
 
60
61
  // NOTE: Hack to pass typescript checking
61
62
  const config = userConfig;
@@ -72,10 +72,11 @@ export default async function (config, options, resolveApi) {
72
72
  port: options.port
73
73
  });
74
74
  if (options.saveReport) {
75
- runner.on('stop', async () => {
76
- var _runner5;
77
- await copyStatics(config.reportDir);
78
- await writeFileAsync(path.join(config.reportDir, 'data.js'), reportDataModule((_runner5 = runner) === null || _runner5 === void 0 ? void 0 : _runner5.status.tests));
75
+ runner.on('stop', () => {
76
+ void copyStatics(config.reportDir).then(() => {
77
+ var _runner5;
78
+ return writeFileAsync(path.join(config.reportDir, 'data.js'), reportDataModule((_runner5 = runner) === null || _runner5 === void 0 ? void 0 : _runner5.status.tests));
79
+ });
79
80
  });
80
81
  }
81
82
  if (options.ui) {
@@ -85,7 +85,7 @@ export default class Pool extends EventEmitter {
85
85
  return this.aliveWorkers.filter(worker => !worker.isRunning);
86
86
  }
87
87
  async forkWorker(retry = 0) {
88
- cluster.setupMaster({
88
+ cluster.setupPrimary({
89
89
  args: ['--browser', this.browser, ...process.argv.slice(2)]
90
90
  });
91
91
  const worker = cluster.fork();
@@ -89,6 +89,7 @@ export default function server(reportDir, port, ui) {
89
89
  subscribeOn('shutdown', () => {
90
90
  server.close();
91
91
  wss.close();
92
+ wss.clients.forEach(ws => ws.close());
92
93
  });
93
94
  void creeveyApi.then(api => {
94
95
  api.subscribe(wss);
@@ -38,6 +38,7 @@ function getSessionData(grid, sessionId = '') {
38
38
  }));
39
39
  }
40
40
  function getAddresses() {
41
+ // TODO Check if docker is used
41
42
  return [DOCKER_INTERNAL].concat(...Object.values(networkInterfaces()).filter(isDefined).map(network => network.filter(info => info.family == 'IPv4').map(info => info.address)));
42
43
  }
43
44
  async function resolveStorybookUrl(storybookUrl, checkUrl) {
@@ -404,7 +405,7 @@ export async function getBrowser(config, options) {
404
405
  // TODO Define some capabilities explicitly and define typings
405
406
  const capabilities = new Capabilities({
406
407
  ...userCapabilities,
407
- pageLoadStrategy: PageLoadStrategy.NONE
408
+ pageLoadStrategy: PageLoadStrategy.EAGER
408
409
  });
409
410
  subscribeOn('shutdown', () => {
410
411
  var _browser;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Theme } from '@storybook/theming';
3
- interface BooleanProps {
3
+ interface CheckboxProps {
4
4
  checked?: boolean;
5
5
  onValueChange: (value: boolean) => void;
6
6
  disabled?: boolean;
@@ -12,7 +12,7 @@ export declare const CheckboxContainer: import("@storybook/theming").StyledCompo
12
12
  theme?: Theme | undefined;
13
13
  as?: React.ElementType<any> | undefined;
14
14
  }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
15
- export declare class Checkbox extends React.Component<BooleanProps, CheckboxState> {
15
+ export declare class Checkbox extends React.Component<CheckboxProps, CheckboxState> {
16
16
  state: CheckboxState;
17
17
  handleIndeterminateChange: (value: boolean) => void;
18
18
  setIndeterminate: () => void;
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import { CreeveySuite } from '../../types';
3
3
  import { CreeveyViewFilter } from '../shared/helpers';
4
+ export declare type SuitePath = string[];
5
+ export declare type FocusableItem = 'search' | SuitePath;
4
6
  export interface KeyboardEventsContextType {
5
- sidebarFocusedItem: string[];
7
+ sidebarFocusedItem: FocusableItem;
6
8
  setSidebarFocusedItem: (path: string[]) => void;
7
9
  }
8
10
  export declare const KeyboardEventsContext: React.Context<KeyboardEventsContextType>;
@@ -241,6 +241,7 @@ export interface Options {
241
241
  reporter?: string;
242
242
  screenDir?: string;
243
243
  reportDir?: string;
244
+ storybookUrl?: string;
244
245
  saveReport: boolean;
245
246
  failFast?: boolean;
246
247
  }
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "addon",
14
14
  "test"
15
15
  ],
16
- "version": "0.9.0-beta.14",
16
+ "version": "0.9.0-beta.16",
17
17
  "bin": "./lib/cjs/cli.js",
18
18
  "exports": {
19
19
  ".": {
@@ -159,7 +159,7 @@
159
159
  "@types/micromatch": "^4.0.1",
160
160
  "@types/minimist": "^1.2.1",
161
161
  "@types/mocha": "^9.1.1",
162
- "@types/node": "^16.11.43",
162
+ "@types/node": "^20.14.15",
163
163
  "@types/pixelmatch": "^5.2.2",
164
164
  "@types/pngjs": "^6.0.0",
165
165
  "@types/qs": "^6.9.6",
@@ -225,7 +225,7 @@
225
225
  "displayName": "Creevey"
226
226
  },
227
227
  "volta": {
228
- "node": "20.12.2",
229
- "yarn": "4.1.1"
228
+ "node": "20.16.0",
229
+ "yarn": "4.4.0"
230
230
  }
231
231
  }