How to use @seleniumhq/side-utils - 10 common examples

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 / code-export-csharp-nunit / src / command.js View on Github external
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

import { codeExport as exporter } from '@seleniumhq/side-utils'
import { Command } from '@seleniumhq/code-export-csharp-commons'

exporter.register.preprocessors(Command.emitters)

function register(command, emitter) {
  exporter.register.emitter({ command, emitter, emitters: Command.emitters })
}

function emit(command) {
  return exporter.emit.command(command, Command.emitters[command.command], {
    variableLookup: Command.variableLookup,
    emitNewWindowHandling: Command.extras.emitNewWindowHandling,
  })
}

function canEmit(commandName) {
  return !!Command.emitters[commandName]
}
github SeleniumHQ / selenium-ide / packages / code-export-csharp-xunit / src / command.js View on Github external
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

import { codeExport as exporter } from '@seleniumhq/side-utils'
import { Command, location } from '@seleniumhq/code-export-csharp-commons'
const emitters = { ...Command.emitters }

exporter.register.preprocessors(emitters)

function register(command, emitter) {
  exporter.register.emitter({ command, emitter, emitters: emitters })
}

function emit(command) {
  return exporter.emit.command(command, emitters[command.command], {
    variableLookup: Command.variableLookup,
    emitNewWindowHandling: Command.extras.emitNewWindowHandling,
  })
}

function canEmit(commandName) {
  return !!emitters[commandName]
}
github SeleniumHQ / selenium-ide / packages / code-export-python-pytest / src / location.js View on Github external
export function emit(location) {
  return exporter.emit.location(location, emitters)
}
github SeleniumHQ / selenium-ide / packages / code-export-python-pytest / src / command.js View on Github external
verifyValue: emitVerifyValue,
  waitForElementEditable: emitWaitForElementEditable,
  waitForElementPresent: emitWaitForElementPresent,
  waitForElementVisible: emitWaitForElementVisible,
  waitForElementNotEditable: emitWaitForElementNotEditable,
  waitForElementNotPresent: emitWaitForElementNotPresent,
  waitForElementNotVisible: emitWaitForElementNotVisible,
  webdriverAnswerOnVisiblePrompt: emitAnswerOnNextPrompt,
  waitForText: emitWaitForText,
  webdriverChooseCancelOnVisibleConfirmation: emitChooseCancelOnNextConfirmation,
  webdriverChooseCancelOnVisiblePrompt: emitChooseCancelOnNextConfirmation,
  webdriverChooseOkOnVisibleConfirmation: emitChooseOkOnNextConfirmation,
  while: emitControlFlowWhile,
}

exporter.register.preprocessors(emitters)

function register(command, emitter) {
  exporter.register.emitter({ command, emitter, emitters })
}

function emit(command) {
  return exporter.emit.command(command, emitters[command.command], {
    variableLookup,
    emitNewWindowHandling,
  })
}

function canEmit(commandName) {
  return !!emitters[commandName]
}
github SeleniumHQ / selenium-ide / packages / code-export-csharp-xunit / __test__ / src / command.spec.js View on Github external
async function prettify(command, { fullPayload } = {}) {
  const commandBlock = await Command.emit(command)
  const result = exporter.prettify(commandBlock, {
    commandPrefixPadding,
  })
  return fullPayload ? result : result.body
}
github SeleniumHQ / selenium-ide / packages / code-export-ruby-rspec / __test__ / src / command.spec.js View on Github external
async function prettify(command, { fullPayload, startingLevel } = {}) {
  const commandBlock = await Command.emit(command)
  const result = exporter.prettify(commandBlock, {
    commandPrefixPadding,
    startingLevel,
  })
  return fullPayload ? result : result.body
}
github SeleniumHQ / selenium-ide / packages / code-export-python-pytest / __test__ / src / command.spec.js View on Github external
async function prettify(command, { fullPayload } = {}) {
  const commandBlock = await Command.emit(command)
  const result = exporter.prettify(commandBlock, {
    commandPrefixPadding,
  })
  return fullPayload ? result : result.body
}
github SeleniumHQ / selenium-ide / packages / code-export-csharp-nunit / __test__ / src / command.spec.js View on Github external
async function prettify(command, { fullPayload } = {}) {
  const commandBlock = await Command.emit(command)
  const result = exporter.prettify(commandBlock, {
    commandPrefixPadding,
  })
  return fullPayload ? result : result.body
}
github SeleniumHQ / selenium-ide / packages / code-export-java-junit / __test__ / src / command.spec.js View on Github external
async function prettify(command, { fullPayload } = {}) {
  const commandBlock = await Command.emit(command)
  const result = exporter.prettify(commandBlock, {
    commandPrefixPadding,
  })
  return fullPayload ? result : result.body
}
github SeleniumHQ / selenium-ide / packages / code-export-javascript-mocha / __test__ / src / command.spec.js View on Github external
async function prettify(command, { fullPayload } = {}) {
  const commandBlock = await Command.emit(command)
  const result = exporter.prettify(commandBlock, {
    commandPrefixPadding,
  })
  return fullPayload ? result : result.body
}