How to use @flood/element-api - 8 common examples

To help you get started, we’ve selected a few @flood/element-api 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 flood-io / element / packages / cli / src / cmd / plan.ts View on Github external
const main = async (args: Arguments) => {
	const { EvaluatedScript, nullRuntimeEnvironment } = require('@flood/element-api')
	const script = await EvaluatedScript.mustCompileFile(args.file, nullRuntimeEnvironment)

	if (args.json) return printJSON(script)

	const { settings, steps } = script

	console.log(
		boxen(
			chalk`test script
{blue ${settings.name || ''}}
{blue ${settings.description || ''}}`,
			{ padding: 1, margin: 1, align: 'center' },
		),
	)

	console.log(chalk`{blue Settings}:`)
	console.log(inspect(settings, { colors: true }))
github flood-io / element / packages / cli / src / cmd / run.ts View on Github external
function initRunEnv(root: string, testDataRoot: string) {
	const workRoot = new WorkRoot(root, {
		'test-data': testDataRoot,
	})

	return {
		workRoot,
		stepEnv(): FloodProcessEnv {
			return {
				BROWSER_ID: 0,
				FLOOD_GRID_REGION: 'local',
				FLOOD_GRID_SQEUENCE_ID: 0,
				FLOOD_GRID_SEQUENCE_ID: 0,
				FLOOD_GRID_INDEX: 0,
				FLOOD_GRID_NODE_SEQUENCE_ID: 0,
				FLOOD_NODE_INDEX: 0,
				FLOOD_SEQUENCE_ID: 0,
				FLOOD_PROJECT_ID: 0,
github flood-io / element / packages / cli / src / utils / ConsoleReporter.ts View on Github external
testLifecycle(stage: TestEvent, label: string): void {
		switch (stage) {
			case TestEvent.AfterStepAction:
				this.logger.info(`---> ${label}()`)
				break
			case TestEvent.BeforeStep:
				this.logger.info('')
				this.logger.info(`===> Step '${label}'`)
				break
			case TestEvent.AfterStep:
				this.logger.info(`---> Step '${label}' finished`)
				break
			case TestEvent.StepSkipped:
				this.logger.info(`---- Step '${label}' skipped`)
				break
			case TestEvent.StepFailed:
				this.logger.error(`xxxx Step '${label}' failed`)
				break
		}
	}
github flood-io / element / packages / cli / src / utils / ConsoleReporter.ts View on Github external
testLifecycle(stage: TestEvent, label: string): void {
		switch (stage) {
			case TestEvent.AfterStepAction:
				this.logger.info(`---> ${label}()`)
				break
			case TestEvent.BeforeStep:
				this.logger.info('')
				this.logger.info(`===> Step '${label}'`)
				break
			case TestEvent.AfterStep:
				this.logger.info(`---> Step '${label}' finished`)
				break
			case TestEvent.StepSkipped:
				this.logger.info(`---- Step '${label}' skipped`)
				break
			case TestEvent.StepFailed:
				this.logger.error(`xxxx Step '${label}' failed`)
				break
		}
github flood-io / element / packages / cli / src / utils / ConsoleReporter.ts View on Github external
testLifecycle(stage: TestEvent, label: string): void {
		switch (stage) {
			case TestEvent.AfterStepAction:
				this.logger.info(`---> ${label}()`)
				break
			case TestEvent.BeforeStep:
				this.logger.info('')
				this.logger.info(`===> Step '${label}'`)
				break
			case TestEvent.AfterStep:
				this.logger.info(`---> Step '${label}' finished`)
				break
			case TestEvent.StepSkipped:
				this.logger.info(`---- Step '${label}' skipped`)
				break
			case TestEvent.StepFailed:
				this.logger.error(`xxxx Step '${label}' failed`)
				break
		}
	}
github flood-io / element / packages / cli / src / utils / ConsoleReporter.ts View on Github external
testLifecycle(stage: TestEvent, label: string): void {
		switch (stage) {
			case TestEvent.AfterStepAction:
				this.logger.info(`---> ${label}()`)
				break
			case TestEvent.BeforeStep:
				this.logger.info('')
				this.logger.info(`===> Step '${label}'`)
				break
			case TestEvent.AfterStep:
				this.logger.info(`---> Step '${label}' finished`)
				break
			case TestEvent.StepSkipped:
				this.logger.info(`---- Step '${label}' skipped`)
				break
			case TestEvent.StepFailed:
				this.logger.error(`xxxx Step '${label}' failed`)
				break
		}
	}
github flood-io / element / packages / cli / src / utils / ConsoleReporter.ts View on Github external
testLifecycle(stage: TestEvent, label: string): void {
		switch (stage) {
			case TestEvent.AfterStepAction:
				this.logger.info(`---> ${label}()`)
				break
			case TestEvent.BeforeStep:
				this.logger.info('')
				this.logger.info(`===> Step '${label}'`)
				break
			case TestEvent.AfterStep:
				this.logger.info(`---> Step '${label}' finished`)
				break
			case TestEvent.StepSkipped:
				this.logger.info(`---- Step '${label}' skipped`)
				break
			case TestEvent.StepFailed:
				this.logger.error(`xxxx Step '${label}' failed`)
				break
		}
	}