GithubHelp home page GithubHelp logo

poanetwork / e2e-test-token-wizard Goto Github PK

View Code? Open in Web Editor NEW
2.0 5.0 4.0 52.75 MB

A tool for end-to-end test the Token wizard. Based Selenium Webdriver.

License: GNU General Public License v3.0

JavaScript 100.00%

e2e-test-token-wizard's Introduction

Scrypt for creating new crowdsale https://wizard.poa.network/

v 1.0.35 Added testing scenarios: ./scenarios v 1.0.38 Added executable files v 1.0.40 "ouptputPath" in config.json

Getting Started

Installation

 https://github.com/poanetwork/e2e-test-token-wizard
  npm install create-poa-crowdsale

Usage

  const CreatePOACrowdsale=require('create-poa-crowdsale');

  const createPOACrowdsale=CreatePOACrowdsale.createPOACrowdsale;

  var myCrowdsale=createPOACrowdsale( "config.json");

where:

  • config.json is .json file in working directory (see example below) with configuration parameters.

Package includes executable files

  • index-linux for Linux
  • index-macos for macOS
  • index-windows for Windows

run with command ./<file_name>

local directory should contain config.json, scenario.json, MetaMask.crx

Prerequisites

  • Google-chrome browser should be installed

Scrypt performs:

Example config.json:

   {
     "startURL" : "https://wizard.poa.network/",
     "outputPath":"./results",
     "installMetaMask":true,
     "scenario":"T1RnWn.json"
   }

Example scenario.json:

{
    "account": "0xF16AB2EA0a7F7B28C267cbA3Ed211Ea5c6e27411",
    "privateKey": "03c06a9fab22fe0add145e337c5a8251e140f74468d72eab17ec7419ab812cd0",
    "networkID":4,


    "name": "MySuperCoin",
    "ticker": "MSC",
    "decimals": 0,
    "reservedTokens":[
       {
        "address" :"0x6f53002497203d167771eb0852b4c1caDA7a585f",
        "dimension": "percentage",
        "value": 20
       },
       {
         "address" :"0x42f0143F2E9Ab64CA3811bbA08E40D798C18E7f4",
         "dimension": "tokens",
         "value": 10
       }],
    "walletAddress":"0xF16AB2EA0a7F7B28C267cbA3Ed211Ea5c6e27411",
    "gasprice": 100,
    "mincap": 1,
    "whitelisting":false,
    "tiers":[
       {
       "name":"###1",
        "allowModify": true,
        "startDate": "02/07/2018",
        "startTime": "4:40pm",
        "endDate":"02/07/2018",
        "endTime":"8:00pm",
        "rate":100,
        "supply": 200,
        "whitelist":[
          {
          "address":"0x6f53002497203d167771eb0852b4c1caDA7a585f",
          "min":6,
          "max":100
          },
          {
           "address":"0x42f0143F2E9Ab64CA3811bbA08E40D798C18E7f4",
           "min":8,
           "max":55
          }]
       },
       {
        "name":"###2",
        "allowModify": true,
        "startDate": "08/08/2019",
        "startTime": "2:34am",
        "endDate":"08/10/2019",
        "endTime":"11:34pm",
        "rate":40,
        "supply": 2300,
        "whitelist":[
        {
         "address":"0x6f53002497203d167771eb0852b4c1caDA7a585f",
         "min":6,
         "max":100
        },
        {
         "address":"0x42f0143F2E9Ab64CA3811bbA08E40D798C18E7f4",
         "min":8,
         "max":55
        }]
       }]

}

where networkID=

0,1,2 - Main Ethereum network;
3 - Ropsten;
4 - Rinkeby;
42 - Kovan;
77 - Sokol;
99 - Poa core;
8545 - localhost 8545

e2e-test-token-wizard's People

Contributors

dennis00010011b avatar igorbarinov avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

e2e-test-token-wizard's Issues

(Fix) Usage description is outdated

I've tried to use utility with usage description in README https://github.com/poanetwork/e2e-test-token-wizard#usage:

/Users/viktor/Documents/POANetwork/Test/node_modules/create-poa-crowdsale/pages/Page.js
/Users/viktor/Documents/POANetwork/Test/node_modules/create-poa-crowdsale/pages/WizardStep3.js
/Users/viktor/Documents/POANetwork/Test/node_modules/create-poa-crowdsale/tests/BaseTest.js
/Users/viktor/Documents/POANetwork/Test/node_modules/create-poa-crowdsale/pages/TierPage.js
/Users/viktor/Documents/POANetwork/Test/node_modules/create-poa-crowdsale/entity/Currency.js
/Users/viktor/Documents/POANetwork/Test/node_modules/create-poa-crowdsale/pages/CrowdsalePage.js
/Users/viktor/Documents/POANetwork/Test/node_modules/create-poa-crowdsale/pages/InvestPage.js
module.js:540
    throw err;
    ^

Error: Cannot find module './tests/Test2.js'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/viktor/Documents/POANetwork/Test/node_modules/create-poa-crowdsale/index.js:5:13)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)

(Feature) add networkID to config

Let's create a network provider URL in the config to simplify switching between networks. Or, maybe, it is a better idea to store networkID in the config and choose provider depending on networkID. The list of network IDs can be taken from here. Also, we need to get networkID from config for URLs like this:

this.URL='https://wizard.poa.network/invest?addr=0xA925660b2EFbcd1d2230d926c816a3a298A3aA77&networkID=4';

(Fix) remove unused packages from package.json

Are these packages used in utility:

  "dependencies": {
    "body-parser": "~1.18.2",
    ...
    "cookie-parser": "~1.4.3",
    "debug": "~2.6.9",
    "express": "~4.15.5",
    "jade": "~1.11.0",
    "morgan": "~1.9.0",
    ...
    "serve-favicon": "~2.4.5",
    ...
  }

?
If no, let's remove them.

(Feature) add path to output directory to config file

Problem: there are multiple folders are created in the root path.

screen shot 2018-02-15 at 14 29 21

Solution: create one folder for output files and add an ability to manage path from the config file. In this folder ./results... folders will be added and ./artifacts folder.

Also, I am curious what is the difference between screenshots in ./artifacts folder and in ./results... folders. Do we need ./artifacts folder at all?

(Bug) stuck at step 2 with simple scenario

[email protected]

Scenario:

{ "account": "0xF16AB2EA0a7F7B28C267cbA3Ed211Ea5c6e27411",
  "privateKey": "03c06a9fab22fe0add145e337c5a8251e140f74468d72eab17ec7419ab812cd0",
  "networkID":4,

  "name": "T1RnWn_0005.json",
  "ticker": "test",
  "decimals": 3,
  "reservedTokens":[
  ],
  "walletAddress":"0xF16AB2EA0a7F7B28C267cbA3Ed211Ea5c6e27411",
  "gasprice": 40,
  "mincap": 1,
  "whitelisting":false,
  "tiers":[
    {
      "name":"###1",
      "allowModify": true,
      "startDate": "02/16/2018",
      "startTime": "03:15pm",
      "endDate":"02/16/2018",
      "endTime":"03:30pm",
      "rate":100,
      "supply": 200,
      "whitelist":[]
    }]
}

Log: error_15_02.log

bug

(Feature) add different crowdsale configs for basic scenarios

Problem: utility uses one crowdsale.json config with the configuration of crowdsale for now
Solution: to create multiple configs covered all basic scenarios and choose crowdsale scenario in config.json

Some basic scenarios:

  • single-tier, no reserved tokens, no whitelist
  • single tier with reserved tokens, no whitelist
  • single tier with reserved tokens and whitelist
  • multiple tiers, no reserved tokens, no whitelist
  • multiple tiers with reserved tokens, no whitelist
  • multiple tiers with reserved tokens and whitelist

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.