How to use the @seleniumhq/side-utils.userAgent.browserName function in @seleniumhq/side-utils

To help you get started, we’ve selected a few @seleniumhq/side-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SeleniumHQ / selenium-ide / packages / selenium-ide / src / neo / code-export / index.js View on Github external
export async function exportCodeToFile(
  selectedLanguages,
  { test, suite },
  { enableOriginTracing, beforeEachOptions }
) {
  const project = UiState.project.toJS()
  const { url, tests } = project
  for (const language of selectedLanguages) {
    let emittedCode
    let options = {
      url,
      tests,
      project,
      enableOriginTracing,
      beforeEachOptions: {
        browserName: userAgent.browserName,
        ...beforeEachOptions,
      },
    }
    options.test = test ? test : undefined
    options.suite = suite
      ? projectProcessor.normalizeTestsInSuite({ suite, tests })
      : undefined
    if (vendorLanguages.hasOwnProperty(language)) {
      const result = await PluginManager.emitMessage({
        action: 'export',
        entity: 'vendor',
        language,
        options,
      })
      emittedCode = result[0].response
    } else if (test) {