How to use rcHelper method in wpt

Best JavaScript code snippet using wpt

quasarRepayment.js

Source:quasarRepayment.js Github

copy

Full Screen

1/*2Copyright 2019 OmiseGO Pte Ltd3Licensed under the Apache License, Version 2.0 (the "License");4you may not use this file except in compliance with the License.5You may obtain a copy of the License at6 http://www.apache.org/licenses/LICENSE-2.07Unless required by applicable law or agreed to in writing, software8distributed under the License is distributed on an "AS IS" BASIS,9WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.10See the License for the specific language governing permissions and11limitations under the License. */12const Web3 = require('web3');13const { RootChain, ChildChain } = require('@omisego/omg-js');14const Quasar = require('@omisego/omg-quasar-js');15const { transaction } = require('@omisego/omg-js-util');16const chai = require('chai');17const numberToBN = require('number-to-bn');18const promiseRetry = require('promise-retry');19const path = require('path');20const config = require('../test-config');21const rcHelper = require('../helpers/rootChainHelper');22const faucet = require('../helpers/faucet');23const ccHelper = require('../helpers/childChainHelper');24const QuasarHelper = require('../helpers/quasarHelpers');25const { assert } = chai;26const faucetName = path.basename(__filename);27const POLL_INTERVAL = 3000;28describe('Quasar Repayment test', () => {29 const web3 = new Web3(new Web3.providers.HttpProvider(config.eth_node));30 const rootChain = new RootChain({31 web3,32 plasmaContractAddress: config.plasmaframework_contract_address,33 });34 const childChain = new ChildChain({35 watcherUrl: config.watcher_url,36 watcherProxyUrl: config.watcher_proxy_url,37 plasmaContractAddress: config.plasmaframework_contract_address,38 });39 const quasarHelper = new QuasarHelper(web3, config.quasar_contract_address);40 const quasarSupplierAccount = rcHelper.createAccount(web3);41 const quasar = new Quasar({42 web3,43 quasarContractAddress: config.quasar_contract_address,44 });45 before(async () => {46 await faucet.init({47 rootChain, childChain, web3, config, faucetName,48 });49 this.quasarBond = await quasar.bondValue();50 });51 describe('When the Quasar Owner standard exits', () => {52 const INTIIAL_ALICE_AMOUNT = web3.utils.toWei('.001', 'ether');53 const INTIIAL_ALICE_RC_AMOUNT = web3.utils.toWei('.5', 'ether');54 const INTIIAL_SUPPLIER_RC_AMOUNT = web3.utils.toWei('.1', 'ether');55 let aliceAccount;56 let quasarOwnerAddress;57 before(async () => {58 aliceAccount = rcHelper.createAccount(web3);59 quasarOwnerAddress = await quasar.quasarOwner();60 await Promise.all([61 // Give some ETH to Alice on the child chain62 faucet.fundChildchain(63 aliceAccount.address,64 INTIIAL_ALICE_AMOUNT,65 transaction.ETH_CURRENCY,66 ),67 // Give some ETH to Alice on the root chain68 faucet.fundRootchainEth(aliceAccount.address, INTIIAL_ALICE_RC_AMOUNT),69 ]);70 // Give some ETH to quasarSupplier on the root chain71 await faucet.fundRootchainEth(quasarSupplierAccount.address, INTIIAL_SUPPLIER_RC_AMOUNT);72 // Wait for finality73 await Promise.all([74 ccHelper.waitForBalanceEq(75 childChain,76 aliceAccount.address,77 INTIIAL_ALICE_AMOUNT,78 ),79 rcHelper.waitForEthBalanceEq(80 web3,81 quasarSupplierAccount.address,82 INTIIAL_SUPPLIER_RC_AMOUNT,83 ),84 rcHelper.waitForEthBalanceEq(85 web3,86 aliceAccount.address,87 INTIIAL_ALICE_RC_AMOUNT,88 ),89 ]);90 // Make some transfers to pass the safe block limit91 const safeBlockMargin = await quasar.safeBlockMargin();92 for (let i = 0; i < safeBlockMargin; i++) {93 await faucet.fundChildchain(quasarSupplierAccount.address, 10, transaction.ETH_CURRENCY);94 await rcHelper.sleep(16000);95 }96 // Give Alice some ETH for fees97 const fees = (await childChain.getFees())['1'];98 const { amount: feeEthAmountWei } = fees.find((f) => f.currency === transaction.ETH_CURRENCY);99 await faucet.fundChildchain(aliceAccount.address, feeEthAmountWei, transaction.ETH_CURRENCY);100 await ccHelper.waitForBalanceEq(101 childChain,102 aliceAccount.address,103 numberToBN(INTIIAL_ALICE_AMOUNT).add(numberToBN(feeEthAmountWei)),104 );105 // Provide liquidity to the quasar106 await quasar.addEthCapacity({107 value: INTIIAL_ALICE_AMOUNT,108 txOptions: {109 from: quasarSupplierAccount.address,110 privateKey: quasarSupplierAccount.privateKey,111 },112 });113 // Alice gets a ticket from the Quasar to fast exit a utxo114 const [utxo] = await childChain.getUtxos(aliceAccount.address);115 const { txbytes, proof } = await childChain.getExitData(utxo);116 const utxoPos = transaction.encodeUtxoPos(utxo);117 await quasar.obtainTicket({118 utxoPos,119 rlpOutputCreationTx: txbytes,120 outputCreationTxInclusionProof: proof,121 txOptions: {122 from: aliceAccount.address,123 privateKey: aliceAccount.privateKey,124 },125 });126 // Alice sends output to quasar owner127 const quasarTx = await ccHelper.send(128 childChain,129 aliceAccount.address,130 quasarOwnerAddress,131 INTIIAL_ALICE_AMOUNT,132 transaction.ETH_CURRENCY,133 aliceAccount.privateKey,134 rootChain.plasmaContractAddress,135 );136 let utxoPosQuasarOwner;137 let utxoQuasarOwner;138 assert.isTrue(await promiseRetry(async (retry) => {139 const allUtxos = await childChain.getUtxos(quasarOwnerAddress);140 const utxosFiltered = allUtxos141 .filter((utxo) => utxo.creating_txhash === quasarTx.result.txhash);142 if (utxosFiltered.length !== 0) {143 utxoPosQuasarOwner = utxosFiltered[0].utxo_pos;144 utxoQuasarOwner = utxosFiltered[0];145 return true;146 }147 retry();148 }, {149 minTimeout: POLL_INTERVAL,150 factor: 1,151 retries: 5,152 }));153 this.aliceEthBalanceBeforeClaim = await web3.eth.getBalance(aliceAccount.address);154 // Alice claims with the Quasar155 const { txbytes: rlpTxToQuasarOwner, proof: txToQuasarOwnerInclusionProof } = await childChain.getExitData(utxoQuasarOwner);156 const claimTxAfter = await quasar.claim({157 utxoPos,158 utxoPosQuasarOwner,159 rlpTxToQuasarOwner,160 txToQuasarOwnerInclusionProof,161 txOptions: {162 from: aliceAccount.address,163 privateKey: aliceAccount.privateKey,164 },165 });166 if (claimTxAfter) {167 console.log(`Alice claimed Liquid funds from Quasar: txhash = ${claimTxAfter.transactionHash}`);168 this.aliceSpentOnGas = await rcHelper.spentOnGas(web3, claimTxAfter);169 await rcHelper.awaitTx(web3, claimTxAfter.transactionHash);170 }171 });172 after(async () => {173 try {174 await faucet.returnFunds(aliceAccount);175 await faucet.returnFunds(quasarSupplierAccount);176 } catch (err) {177 console.warn(`Error trying to return funds to the faucet: ${err}`);178 }179 });180 it('should return back liquid funds', async () => {181 // Get Alice's ETH balance182 let aliceEthBalanceAfterClaim = await web3.eth.getBalance(aliceAccount.address);183 const ethFee = await quasar.getQuasarFee();184 const expected = web3.utils185 .toBN(this.aliceEthBalanceBeforeClaim)186 .add(web3.utils.toBN(INTIIAL_ALICE_AMOUNT))187 .sub(web3.utils.toBN(ethFee))188 .add(web3.utils.toBN(this.quasarBond))189 .sub(web3.utils.toBN(this.aliceSpentOnGas));190 assert.equal(aliceEthBalanceAfterClaim.toString(), expected.toString());191 const quasarCapacityBefore = await quasarHelper.quasarOwedCapacity(transaction.ETH_CURRENCY);192 console.log('Waiting to Repay...');193 await rcHelper.sleep(config.exit_period);194 const quasarCapacityAfter = await quasarHelper.quasarOwedCapacity(transaction.ETH_CURRENCY);195 const expectedQuasarCapacity = quasarCapacityBefore.owedAmount - INTIIAL_ALICE_AMOUNT;196 assert.equal(quasarCapacityAfter.owedAmount, expectedQuasarCapacity);197 });198 });...

Full Screen

Full Screen

quasarExitTest.js

Source:quasarExitTest.js Github

copy

Full Screen

1/*2Copyright 2019 OmiseGO Pte Ltd3Licensed under the Apache License, Version 2.0 (the "License");4you may not use this file except in compliance with the License.5You may obtain a copy of the License at6 http://www.apache.org/licenses/LICENSE-2.07Unless required by applicable law or agreed to in writing, software8distributed under the License is distributed on an "AS IS" BASIS,9WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.10See the License for the specific language governing permissions and11limitations under the License. */12const Web3 = require('web3');13const ChildChain = require('@omisego/omg-js-childchain');14const RootChain = require('@omisego/omg-js-rootchain');15const { transaction } = require('@omisego/omg-js-util');16const chai = require('chai');17const numberToBN = require('number-to-bn');18const promiseRetry = require('promise-retry');19const path = require('path');20const config = require('../test-config');21const rcHelper = require('../helpers/rootChainHelper');22const faucet = require('../helpers/faucet');23const ccHelper = require('../helpers/childChainHelper');24const Quasar = require('@omisego/omg-quasar-js');25const { assert } = chai;26const faucetName = path.basename(__filename);27const POLL_INTERVAL = 3000;28describe('Quasar Fast Exit test', () => {29 const web3 = new Web3(new Web3.providers.HttpProvider(config.eth_node));30 const rootChain = new RootChain({31 web3,32 plasmaContractAddress: config.plasmaframework_contract_address,33 });34 const childChain = new ChildChain({35 watcherUrl: config.watcher_url,36 watcherProxyUrl: config.watcher_proxy_url,37 plasmaContractAddress: config.plasmaframework_contract_address,38 });39 const quasarSupplierAccount = rcHelper.createAccount(web3);40 const quasar = new Quasar({41 web3, 42 quasarContractAddress: config.quasar_contract_address,43 });44 before(async () => {45 await faucet.init({46 rootChain, childChain, web3, config, faucetName,47 });48 this.quasarBond = await quasar.bondValue();49 });50 describe('When a Fast Exit is started', () => {51 const INTIIAL_ALICE_AMOUNT = web3.utils.toWei('.001', 'ether');52 const INTIIAL_ALICE_RC_AMOUNT = web3.utils.toWei('.5', 'ether');53 const INTIIAL_SUPPLIER_RC_AMOUNT = web3.utils.toWei('.1', 'ether');54 let aliceAccount;55 let quasarOwnerAddress;56 before(async () => {57 aliceAccount = rcHelper.createAccount(web3);58 quasarOwnerAddress = await quasar.quasarOwner();59 await Promise.all([60 // Give some ETH to Alice on the child chain61 faucet.fundChildchain(62 aliceAccount.address,63 INTIIAL_ALICE_AMOUNT,64 transaction.ETH_CURRENCY,65 ),66 // Give some ETH to Alice on the root chain67 faucet.fundRootchainEth(aliceAccount.address, INTIIAL_ALICE_RC_AMOUNT),68 ]);69 // Give some ETH to quasarSupplier on the root chain70 await faucet.fundRootchainEth(quasarSupplierAccount.address, INTIIAL_SUPPLIER_RC_AMOUNT);71 // Wait for finality72 await Promise.all([73 ccHelper.waitForBalanceEq(74 childChain,75 aliceAccount.address,76 INTIIAL_ALICE_AMOUNT,77 ),78 rcHelper.waitForEthBalanceEq(79 web3,80 quasarSupplierAccount.address,81 INTIIAL_SUPPLIER_RC_AMOUNT,82 ),83 rcHelper.waitForEthBalanceEq(84 web3,85 aliceAccount.address,86 INTIIAL_ALICE_RC_AMOUNT,87 ),88 ]);89 // Make some transfers to pass the safe block limit90 const safeBlockMargin = await quasar.safeBlockMargin();91 for (let i = 0; i < safeBlockMargin; i++) {92 await faucet.fundChildchain(quasarSupplierAccount.address, 10, transaction.ETH_CURRENCY);93 await rcHelper.sleep(16000);94 }95 // Give Alice some ETH for fees96 const fees = (await childChain.getFees())['1'];97 const { amount: feeEthAmountWei } = fees.find((f) => f.currency === transaction.ETH_CURRENCY);98 await faucet.fundChildchain(aliceAccount.address, feeEthAmountWei, transaction.ETH_CURRENCY);99 await ccHelper.waitForBalanceEq(100 childChain,101 aliceAccount.address,102 numberToBN(INTIIAL_ALICE_AMOUNT).add(numberToBN(feeEthAmountWei)),103 );104 });105 after(async () => {106 try {107 await faucet.returnFunds(aliceAccount);108 await faucet.returnFunds(quasarSupplierAccount);109 } catch (err) {110 console.warn(`Error trying to return funds to the faucet: ${err}`);111 }112 });113 it('should return back liquid funds', async () => {114 // Provide liquidity to the quasar115 await quasar.addEthCapacity({116 value: INTIIAL_ALICE_AMOUNT,117 txOptions: {118 from: quasarSupplierAccount.address,119 privateKey: quasarSupplierAccount.privateKey,120 }121 });122 // Alice gets a ticket from the Quasar to fast exit a utxo123 const [utxo] = await childChain.getUtxos(aliceAccount.address);124 const { txbytes, proof } = await childChain.getExitData(utxo);125 const utxoPos = transaction.encodeUtxoPos(utxo);126 await quasar.obtainTicket({127 utxoPos,128 rlpOutputCreationTx: txbytes,129 outputCreationTxInclusionProof: proof,130 txOptions: {131 from: aliceAccount.address,132 privateKey: aliceAccount.privateKey,133 }134 });135 // Alice sends output to quasar owner136 const quasarTx = await ccHelper.send(137 childChain,138 aliceAccount.address,139 quasarOwnerAddress,140 INTIIAL_ALICE_AMOUNT,141 transaction.ETH_CURRENCY,142 aliceAccount.privateKey,143 rootChain.plasmaContractAddress,144 );145 let utxoPosQuasarOwner;146 let utxoQuasarOwner;147 assert.isTrue(await promiseRetry(async (retry) => {148 const allUtxos = await childChain.getUtxos(quasarOwnerAddress);149 const utxosFiltered = allUtxos150 .filter((utxo) => utxo.creating_txhash === quasarTx.result.txhash);151 if(utxosFiltered.length !== 0) {152 utxoPosQuasarOwner = utxosFiltered[0].utxo_pos;153 utxoQuasarOwner = utxosFiltered[0];154 return true;155 }156 retry();157 }, {158 minTimeout: POLL_INTERVAL,159 factor: 1,160 retries: 5,161 }));162 163 let aliceEthBalanceBeforeClaim = await web3.eth.getBalance(aliceAccount.address);164 // Alice claims with the Quasar165 const { txbytes: rlpTxToQuasarOwner, proof: txToQuasarOwnerInclusionProof } = await childChain.getExitData(utxoQuasarOwner);166 const claimTxAfter = await quasar.claim({167 utxoPos,168 utxoPosQuasarOwner,169 rlpTxToQuasarOwner,170 txToQuasarOwnerInclusionProof,171 txOptions: {172 from: aliceAccount.address,173 privateKey: aliceAccount.privateKey,174 }175 });176 let aliceSpentOnGas;177 if (claimTxAfter) {178 console.log(`Alice claimed Liquid funds from Quasar: txhash = ${claimTxAfter.transactionHash}`)179 aliceSpentOnGas = await rcHelper.spentOnGas(web3, claimTxAfter);180 await rcHelper.awaitTx(web3, claimTxAfter.transactionHash)181 }182 // Get Alice's ETH balance183 let aliceEthBalanceAfterClaim = await web3.eth.getBalance(aliceAccount.address);184 const ethFee = await quasar.getQuasarFee();185 const expected = web3.utils186 .toBN(aliceEthBalanceBeforeClaim)187 .add(web3.utils.toBN(INTIIAL_ALICE_AMOUNT))188 .sub(web3.utils.toBN(ethFee))189 .add(web3.utils.toBN(this.quasarBond))190 .sub(web3.utils.toBN(aliceSpentOnGas))191 assert.equal(aliceEthBalanceAfterClaim.toString(), expected.toString())192 });193 });...

Full Screen

Full Screen

quasarPoolTest.js

Source:quasarPoolTest.js Github

copy

Full Screen

1/*2Copyright 2019 OmiseGO Pte Ltd3Licensed under the Apache License, Version 2.0 (the "License");4you may not use this file except in compliance with the License.5You may obtain a copy of the License at6 http://www.apache.org/licenses/LICENSE-2.07Unless required by applicable law or agreed to in writing, software8distributed under the License is distributed on an "AS IS" BASIS,9WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.10See the License for the specific language governing permissions and11limitations under the License. */12const Web3 = require('web3');13const ChildChain = require('@omisego/omg-js-childchain');14const RootChain = require('@omisego/omg-js-rootchain');15const chai = require('chai');16const path = require('path');17const config = require('../test-config');18const rcHelper = require('../helpers/rootChainHelper');19const faucet = require('../helpers/faucet');20const Quasar = require('@omisego/omg-quasar-js');21const { assert } = chai;22const faucetName = path.basename(__filename);23describe('Quasar Pool test', () => {24 const web3 = new Web3(new Web3.providers.HttpProvider(config.eth_node));25 const rootChain = new RootChain({26 web3,27 plasmaContractAddress: config.plasmaframework_contract_address,28 });29 const childChain = new ChildChain({30 watcherUrl: config.watcher_url,31 watcherProxyUrl: config.watcher_proxy_url,32 plasmaContractAddress: config.plasmaframework_contract_address,33 });34 const quasar = new Quasar({35 web3, 36 quasarContractAddress: config.quasar_contract_address,37 });38 before(async () => {39 await faucet.init({40 rootChain, childChain, web3, config, faucetName,41 });42 });43 describe('When the pool is supplied ETH', () => {44 const ALICE_SUPPLY_AMOUNT = web3.utils.toWei('.5', 'ether');45 let aliceAccount;46 before(async () => {47 aliceAccount = rcHelper.createAccount(web3);48 await Promise.all([49 // Give some ETH to Alice on the root chain50 faucet.fundRootchainEth(aliceAccount.address, ALICE_SUPPLY_AMOUNT),51 ]);52 // Wait for finality53 await Promise.all([54 rcHelper.waitForEthBalanceEq(55 web3,56 aliceAccount.address,57 ALICE_SUPPLY_AMOUNT,58 ),59 ]);60 });61 after(async () => {62 try {63 await faucet.returnFunds(aliceAccount);64 } catch (err) {65 console.warn(`Error trying to return funds to the faucet: ${err}`);66 }67 });68 it('should add to pool supply', async () => {69 const aliceQEthBalanceBeforeSupply = await quasar.getQTokenBalance({ supplierAddress: aliceAccount.address});70 // Provide liquidity to the quasar71 await quasar.addEthCapacity({72 value: ALICE_SUPPLY_AMOUNT / 2,73 txOptions: {74 from: aliceAccount.address,75 privateKey: aliceAccount.privateKey,76 }77 });78 this.aliceQEthBalanceAfterSupply = await quasar.getQTokenBalance({ supplierAddress: aliceAccount.address});79 assert.isTrue(this.aliceQEthBalanceAfterSupply > aliceQEthBalanceBeforeSupply);80 });81 describe('When the fund is withdrawn', () => {82 before(async () => {83 const ETH = '0x0000000000000000000000000000000000000000';84 await quasar.withdrawFunds({85 token: ETH,86 amount: this.aliceQEthBalanceAfterSupply,87 txOptions: {88 from: aliceAccount.address,89 privateKey: aliceAccount.privateKey,90 }91 })92 });93 it('should withdraw from supply', async () => {94 const aliceQEthBalanceAfterWithdraw = await quasar.getQTokenBalance({ supplierAddress: aliceAccount.address});95 assert.equal(aliceQEthBalanceAfterWithdraw, 0);96 });97 });98 });99 describe('When the pool is supplied ERC20', function () {100 const INTIIAL_ALICE_AMOUNT_ETH = web3.utils.toWei('.1', 'ether')101 const ALICE_AMOUNT_ERC20 = 3102 const TEST_AMOUNT = 2103 let aliceAccount104 before(async function () {105 aliceAccount = rcHelper.createAccount(web3)106 await faucet.fundRootchainEth(aliceAccount.address, INTIIAL_ALICE_AMOUNT_ETH)107 await faucet.fundRootchainERC20(aliceAccount.address, ALICE_AMOUNT_ERC20)108 await Promise.all([109 rcHelper.waitForEthBalanceEq(web3, aliceAccount.address, INTIIAL_ALICE_AMOUNT_ETH),110 rcHelper.waitForERC20BalanceEq(web3, aliceAccount.address, config.erc20_contract_address, ALICE_AMOUNT_ERC20)111 ])112 })113 after(async function () {114 try {115 await faucet.returnFunds(aliceAccount)116 } catch (err) {117 console.warn(`Error trying to return funds to the faucet: ${err}`)118 }119 })120 it('should deposit ERC20 tokens to the Plasma contract', async function () {121 // The new account should have no initial balance122 const initialBalance = await childChain.getBalance(aliceAccount.address)123 assert.equal(initialBalance.length, 0)124 // Account must approve the Quasar contract125 await quasar.approveToken({126 erc20Address: config.erc20_contract_address,127 amount: TEST_AMOUNT,128 txOptions: {129 from: aliceAccount.address,130 privateKey: aliceAccount.privateKey131 }132 })133 const aliceQTokenBalanceBeforeSupply = await quasar.getQTokenBalance({134 erc20Address: config.erc20_contract_address,135 supplierAddress: aliceAccount.address,136 });137 // Provide liquidity to the quasar138 await quasar.addTokenCapacity({139 token: config.erc20_contract_address,140 amount: TEST_AMOUNT,141 txOptions: {142 from: aliceAccount.address,143 privateKey: aliceAccount.privateKey,144 }145 });146 const aliceQTokenBalanceAfterSupply = await quasar.getQTokenBalance({147 erc20Address: config.erc20_contract_address,148 supplierAddress: aliceAccount.address,149 });150 assert.isTrue(aliceQTokenBalanceAfterSupply > aliceQTokenBalanceBeforeSupply);151 });152 describe('When the erc20 fund is withdrawn', () => {153 before(async () => {154 const aliceQTokenBalanceAfterSupply = await quasar.getQTokenBalance({155 erc20Address: config.erc20_contract_address,156 supplierAddress: aliceAccount.address,157 });158 await quasar.withdrawFunds({159 token: config.erc20_contract_address,160 amount: aliceQTokenBalanceAfterSupply,161 txOptions: {162 from: aliceAccount.address,163 privateKey: aliceAccount.privateKey,164 }165 })166 });167 it('should withdraw from supply', async () => {168 const aliceQTokenBalanceAfterWithdraw = await quasar.getQTokenBalance({169 erc20Address: config.erc20_contract_address,170 supplierAddress: aliceAccount.address,171 });172 assert.equal(aliceQTokenBalanceAfterWithdraw, 0);173 });174 });175 });...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wptHelper = require('./wptHelper.js');3var wptConfig = require('./wptConfig.js');4var wptTest = new wpt('www.webpagetest.org');5var wptHelperTest = new wptHelper(wptTest);6var wptConfigTest = new wptConfig();7var wptConfigTest = new wptConfig();8var testOptions = wptConfigTest.getOptions(testUrl);9wptHelperTest.runTest(testOptions, function(err, data) {10 if (err) {11 console.log(err);12 } else {13 console.log(data);14 }15});16var wptHelper = function(wptTest) {17 this.wptTest = wptTest;18};19wptHelper.prototype.runTest = function(testOptions, callback) {20 this.wptTest.runTest(testOptions, callback);21};22module.exports = wptHelper;23var wptConfig = function() {24};25wptConfig.prototype.getOptions = function(url) {26 var options = {27 };28 return options;29};30module.exports = wptConfig;31{32 "dependencies": {33 }34}

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptoolkit = require('wptoolkit');2var rcHelper = wptoolkit.rcHelper;3var rc = rcHelper.getRC();4console.log(rc);5### rcHelper.getRC()6### rcHelper.getRCPath()7### rcHelper.getRCPathFromDir(dirName)8### rcHelper.getRCFromDir(dirName)9### rcHelper.getRCFromPath(rcPath)10### rcHelper.getRCFromRoot()11### rcHelper.getRCPathFromRoot()12### rcHelper.setRC(rcObj)13### rcHelper.setRCInDir(rcObj, dirName)14### rcHelper.setRCInPath(rcObj, rcPath)15### rcHelper.setRCInRoot(rcObj)16### rcHelper.setRCValue(key, value)17### rcHelper.setRCValueInDir(key, value, dirName)18### rcHelper.setRCValueInPath(key, value, rcPath)

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var rcHelper = require('./rcHelper.js');3var fs = require('fs');4var args = process.argv.slice(2);5var title = args[0];6var file = args[1];7var rcHelper = require('./rcHelper.js');8var args = process.argv.slice(2);9var title = args[0];10var file = args[1];11var rcHelper = require('./rcHelper.js');12var args = process.argv.slice(2);13var title = args[0];14var file = args[1];15var rcHelper = require('./rcHelper.js');16var args = process.argv.slice(2);17var title = args[0];18var file = args[1];19var rcHelper = require('./rcHelper.js');20var args = process.argv.slice(2);21var title = args[0];22var file = args[1];

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var rcHelper = require('./rcHelper.js');3var fs = require('fs');4var test = function() {5 var rc = rcHelper.getRC();6 var page = wptools.page(rc.page);7 page.get(function(err, info) {8 if (err) {9 console.log('error', err);10 } else {11 console.log('info', info);12 }13 });14};15test();

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var rcHelper = require('./rcHelper.js');3var fs = require('fs');4var test = function() {5 var rc = rcHelper.getRC();6 var page = wptools.page(rc.page);7 page.get(function(err, info) {8 if (err) {9 console.log('error', err);10 } else {11 console.log('info', info);12 }13 });14};15test();

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptoolkit = require('wptoolkit');2var rcHelper = wptoolkit.rcHelper;3var rc = rcHelper.getRC();4console.log(rc);5### rcHelper.getRC()6### rcHelper.getRCPath()7### rcHelper.getRCPathFromDir(dirName)8### rcHelper.getRCFromDir(dirName)9### rcHelper.getRCFromPath(rcPath)10### rcHelper.getRCFromRoot()11### rcHelper.getRCPathFromRoot()12### rcHelper.setRC(rcObj)13### rcHelper.setRCInDir(rcObj, dirName)14### rcHelper.setRCInPath(rcObj, rcPath)

Full Screen

Using AI Code Generation

copy

Full Screen

1var rc = require('rcHelper');2var wpt = require('wpt');3wpt = new wpt('API_KEY');4var url = process.argv[2];5console.log('url is: ' + url);6rc.runRcTest(url, function(err, data) {7 if (err) {8 console.log('error: ' + err);9 return;10 }11 console.log('data: ' + data);12});13### rcHelper.setRCInRoot(rcObj)14### rcHelper.setRCValue(key, value)15### rcHelper.setRCValueInDir(key, value, dirName)16### rcHelper.setRCValueInPath(key, value, rcPath)

Full Screen

Using AI Code Generation

copy

Full Screen

1var rc = require('rcHelper');2var wpt = require('wpt');3wpt = new wpt('API_KEY');4var url = process.argv[2];5console.log('url is: ' + url);6rc.runRcTest(url, function(err, data) {7 if (err) {8 console.log('error: ' + err);9 return;10 }11 console.log('data: ' + data);12});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful