Sha256: 25adb3e650b715fe96212f44890a5edbdd4a75dc03b4d907946cc91aa4940b66

Contents?: true

Size: 1.17 KB

Versions: 26

Compression:

Stored size: 1.17 KB

Contents

import { W as WebdriverBrowserProvider, P as PlaywrightBrowserProvider } from './webdriver-Cv9wga63.js';

class PreviewBrowserProvider {
  name = "preview";
  supportsParallelism = false;
  ctx;
  open = false;
  getSupportedBrowsers() {
    return [];
  }
  isOpen() {
    return this.open;
  }
  getCommandsContext() {
    return {};
  }
  async initialize(ctx) {
    this.ctx = ctx;
    this.open = false;
    if (ctx.config.browser.headless) {
      throw new Error(
        `You've enabled headless mode for "preview" provider but it doesn't support it. Use "playwright" or "webdriverio" instead: https://vitest.dev/guide/browser/#configuration`
      );
    }
  }
  async openPage(_contextId, url) {
    this.open = true;
    if (!this.ctx.browser) {
      throw new Error("Browser is not initialized");
    }
    const options = this.ctx.browser.vite.config.server;
    const _open = options.open;
    options.open = url;
    this.ctx.browser.vite.openBrowser();
    options.open = _open;
  }
  async close() {
  }
}

const webdriverio = WebdriverBrowserProvider;
const playwright = PlaywrightBrowserProvider;
const preview = PreviewBrowserProvider;

export { playwright, preview, webdriverio };

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
clapton-0.0.26 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.19 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.18 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.17 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.16 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.15 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.14 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.13 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.12 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.11 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.10 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.9 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.8 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js
clapton-0.0.7 lib/clapton/javascripts/node_modules/@vitest/browser/dist/providers.js