How to use the selianize function in selianize

To help you get started, we’ve selected a few selianize 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-side-runner / src / index.js View on Github external
: [],
          modulePaths: parseModulePath(path.join(__dirname, '../node_modules')),
          setupFilesAfterEnv: [
            require.resolve('jest-environment-selenium/dist/setup.js'),
          ],
          testEnvironment: 'jest-environment-selenium',
          testEnvironmentOptions: configuration,
        },
        dependencies: project.dependencies || {},
      },
      null,
      2
    )
  )

  return Selianize(project, { silenceErrors: true }, project.snapshot).then(
    code => {
      const tests = code.tests
        .reduce((tests, test) => {
          return (tests += test.code)
        }, 'const utils = require("./utils.js");const tests = {};')
        .concat('module.exports = tests;')
      writeJSFile(path.join(projectPath, 'commons'), tests, '.js')
      writeJSFile(path.join(projectPath, 'utils'), getUtilsFile(), '.js')
      code.suites.forEach(suite => {
        if (!suite.tests) {
          // not parallel
          const cleanup = suite.persistSession
            ? ''
            : 'beforeEach(() => {vars = {};});afterEach(async () => (cleanup()));'
          writeJSFile(
            path.join(projectPath, sanitizeFileName(suite.name)),
github SeleniumHQ / selenium-ide / packages / selenium-ide / src / neo / IO / filesystem.js View on Github external
return Manager.validatePluginExport(project).then(() => {
    return Selianize(project, { silenceErrors: true, skipStdLibEmitting: true }).catch(err => {
      const markdown = ParseError(err && err.message || err);
      ModalState.showAlert({
        title: "Error saving project",
        description: markdown,
        confirmLabel: "Download log",
        cancelLabel: "Close"
      }, (choseDownload) => {
        if (choseDownload) {
          browser.downloads.download({
            filename: project.name + "-logs.md",
            url: createBlob("text/markdown", markdown),
            saveAs: true,
            conflictAction: "overwrite"
          });
        }
      });
github SeleniumHQ / selenium-ide / packages / selenium-ide-extension / src / neo / IO / filesystem.js View on Github external
return Manager.validatePluginExport(project).then(() => {
    return Selianize(project, {
      silenceErrors: true,
      skipStdLibEmitting: true,
    }).catch(err => {
      const markdown = ParseError((err && err.message) || err)
      ModalState.showAlert({
        title: 'Error saving project',
        description: markdown,
        confirmLabel: 'download log',
        cancelLabel: 'close',
      }).then(choseDownload => {
        if (choseDownload) {
          browser.downloads.download({
            filename: project.name + '-logs.md',
            url: createBlob('text/markdown', markdown),
            saveAs: true,
            conflictAction: 'overwrite',