How to use the codeceptjs.output function in codeceptjs

To help you get started, we’ve selected a few codeceptjs 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 LiskHQ / lisk-core / test / stress / 1_diversified.js View on Github external
const output = require('codeceptjs').output;
const utils = require('../../utils');

const I = actor();
const count = Math.ceil(utils.TRS_POOL_LIMIT / 13); // T:2, SPP: 1, D 2, V: 2, UV: 2, M: 2, Dapp: 2 = 13 types of transactions
let all_trxs = {};

const accounts = utils.createAccounts(count);
const accounts_with_spp = utils.createAccounts(count);

const getAllTransactions = () => {
	const transactions = Object.keys(all_trxs).map(transaction_type => {
		const trxs = all_trxs[transaction_type];
		if (!transaction_type.match('_signatures')) {
			return trxs;
		}
		return [];
github LiskHQ / lisk-core / qa / support / lisk_util.js View on Github external
const chai = require('chai');
const elements = require('lisk-elements');
const output = require('codeceptjs').output;
const API = require('./api.js');
const {
	config,
	GENESIS_ACCOUNT,
	ASGARD_FIXTURE,
	seedNode,
	networkIdentifier,
} = require('../fixtures');
const { TO_BEDDOWS, BLOCK_TIME, from } = require('../utils');

const users = {};
chai.config.truncateThreshold = 0;

/* eslint camelcase: ["error", {allow: ["codecept_helper"]}] */
const Helper = codecept_helper;
github LiskHQ / lisk-core / qa / support / validate_helper.js View on Github external
const output = require('codeceptjs').output;
const chai = require('chai');
const apiSchema = require('../api_schema');
const { TO_LISK, TO_BEDDOWS, from, sortBy, flattern } = require('../utils');
const LiskUtil = require('./lisk_util');

/* eslint camelcase: ["error", {allow: ["codecept_helper"]}] */
const Helper = codecept_helper;
const liskUtil = new LiskUtil();

chai.use(require('chai-json-schema'));
chai.use(require('chai-sorted'));
chai.use(require('chai-bignumber')());

const expect = chai.expect;
const otherFields = [
	'username',
github LiskHQ / lisk-core / qa / step_definitions / accounts / create_account.js View on Github external
const output = require('codeceptjs').output;
const {
	transaction: { utils },
} = require('lisk-elements');
const { TO_BEDDOWS, from } = require('../../utils');

const I = actor();
let account;

When('I create a lisk account', async () => {
	try {
		account = await I.createAccount();
		const { passphrase, publicKey, address } = account;

		expect(passphrase).to.be.a('string');
		expect(passphrase.split(' ')).to.have.lengthOf(12);
		expect(publicKey).to.be.a('string');
github LiskHQ / lisk-core / qa / utils / index.js View on Github external
const dns = require('dns');
const output = require('codeceptjs').output;
const from = require('./from');
const liskTransactions = require('./lisk_transactions');
const { ASGARD_FIXTURE, GENESIS_ACCOUNT, config } = require('../fixtures');

const BLOCK_TIME = 10000;

const TRS_PER_BLOCK = 25;

const TRS_POOL_LIMIT = 1000;

const TRS_TYPE = {
	TRANSFER: 0,
	SECOND_PASSPHRASE: 1,
	DELEGATE_REGISTRATION: 2,
	VOTE: 3,
	MULTI_SIGNATURE: 4,
github LiskHQ / lisk-core / qa / step_definitions / transactions / 2_register_delegate.js View on Github external
const output = require('codeceptjs').output;
const { getFixtureUser } = require('../../utils');

const I = actor();
When('{string} register as a delegate', async userName => {
	try {
		const { username, address, passphrase } = getFixtureUser(
			'username',
			userName
		);

		await I.haveAccountRegisteredAsDelegate({
			username,
			address,
			passphrase,
		});
	} catch (error) {
github LiskHQ / lisk-core / qa / step_definitions / transactions / 0_transfer.js View on Github external
const output = require('codeceptjs').output;
const { getFixtureUser, TO_BEDDOWS } = require('../../utils');

const I = actor();

Then(
	'{string} should be able to send {int}LSK tokens to {string}',
	async (user1, amount, user2) => {
		try {
			const sender = getFixtureUser('username', user1);
			const recipient = getFixtureUser('username', user2);

			const transfer = await I.transfer({
				recipientId: recipient.address,
				amount: TO_BEDDOWS(amount),
				passphrase: sender.passphrase,
			});
github LiskHQ / lisk-core / qa / step_definitions / node / constants.js View on Github external
const output = require('codeceptjs').output;
const { constants } = require('lisk-elements').transaction;

const I = actor();

let results = [];

When('I request for node constants', async () => {
	try {
		const api = await I.call();

		results = await Promise.all(
			api.peers.map(address => api.getNodeConstants(address))
		);
	} catch (error) {
		output.error(error);
		throw error;
github LiskHQ / lisk-core / qa / step_definitions / background / world.js View on Github external
const output = require('codeceptjs').output;
const {
	TO_BEDDOWS,
	getFixtureUser,
	from,
	TRS_PER_BLOCK,
} = require('../../utils');

const I = actor();

Given('I have list of clients', async () => {
	try {
		const api = await I.call();
		const inValidAddresses = api.peers.filter(
			address => typeof address !== 'string'
		);
github LiskHQ / lisk-core / qa / support / api.js View on Github external
const output = require('codeceptjs').output;
const elements = require('lisk-elements');

class API {
	constructor(config) {
		const { peers, httpPort } = config;

		this.peers = peers;
		this.httpPort = httpPort;
		this.clients = this.createApiClients();
	}

	createApiClients() {
		return this.peers.map(ip => {
			const url = `http://${ip}:${this.httpPort}`;
			const client = new elements.APIClient([url]);
			return {

codeceptjs

Supercharged End 2 End Testing Framework for NodeJS

MIT
Latest version published 1 month ago

Package Health Score

92 / 100
Full package analysis