aboutsummaryrefslogtreecommitdiff
path: root/tests/spec/tests.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/spec/tests.js')
-rw-r--r--tests/spec/tests.js216
1 files changed, 206 insertions, 10 deletions
diff --git a/tests/spec/tests.js b/tests/spec/tests.js
index a22d749..2add419 100644
--- a/tests/spec/tests.js
+++ b/tests/spec/tests.js
@@ -73,16 +73,23 @@ else if (browser == "chrome") {
73 73
74// Helper functions 74// Helper functions
75 75
76function testNetwork(done, params) { 76function testNetwork(done, params, comparePub = false) {
77 var phrase = params.phrase || 'abandon abandon ability'; 77 var phrase = params.phrase || 'abandon abandon ability';
78 driver.findElement(By.css('.phrase')) 78 driver.findElement(By.css('.phrase'))
79 .sendKeys(phrase); 79 .sendKeys(phrase);
80 selectNetwork(params.selectText); 80 selectNetwork(params.selectText);
81 driver.sleep(generateDelay).then(function() { 81 driver.sleep(generateDelay).then(function() {
82 getFirstAddress(function(address) { 82 if (!comparePub) {
83 expect(address).toBe(params.firstAddress); 83 getFirstAddress(function(address) {
84 done(); 84 expect(address).toBe(params.firstAddress);
85 }); 85 done();
86 });
87 } else {
88 getFirstPublicKey(function(pubkey) {
89 expect(pubkey).toBe(params.firstPubKey);
90 done();
91 });
92 }
86 }); 93 });
87} 94}
88 95
@@ -98,6 +105,10 @@ function getFirstAddress(handler) {
98 getFirstRowValue(handler, ".address"); 105 getFirstRowValue(handler, ".address");
99} 106}
100 107
108function getFirstPublicKey(handler) {
109 getFirstRowValue(handler, ".pubkey");
110}
111
101function getFirstPath(handler) { 112function getFirstPath(handler) {
102 getFirstRowValue(handler, ".index"); 113 getFirstRowValue(handler, ".index");
103} 114}
@@ -408,6 +419,13 @@ it('Allows selection of litecoin', function(done) {
408 }; 419 };
409 testNetwork(done, params); 420 testNetwork(done, params);
410}); 421});
422it('Allows selection of litecoin testnet', function(done) {
423 var params = {
424 selectText: "LTCt - Litecoin Testnet",
425 firstAddress: "mucaU5iiDaJDb69BHLeDv8JFfGiyg2nJKi",
426 };
427 testNetwork(done, params);
428});
411it('Allows selection of ripple', function(done) { 429it('Allows selection of ripple', function(done) {
412 var params = { 430 var params = {
413 selectText: "XRP - Ripple", 431 selectText: "XRP - Ripple",
@@ -416,6 +434,14 @@ it('Allows selection of ripple', function(done) {
416 }; 434 };
417 testNetwork(done, params); 435 testNetwork(done, params);
418}); 436});
437it('Allows selection of casinocoin', function(done) {
438 var params = {
439 selectText: "CSC - CasinoCoin",
440 firstAddress: "c3P5EUb27Pzk9dcGt4s7zQDQj4sC6Y81mT",
441 phrase: "ill clump only blind unit burden thing track silver cloth review awake useful craft whale all satisfy else trophy sunset walk vanish hope valve",
442 };
443 testNetwork(done, params);
444});
419it('Allows selection of dogecoin', function(done) { 445it('Allows selection of dogecoin', function(done) {
420 var params = { 446 var params = {
421 selectText: "DOGE - Dogecoin", 447 selectText: "DOGE - Dogecoin",
@@ -423,6 +449,13 @@ it('Allows selection of dogecoin', function(done) {
423 }; 449 };
424 testNetwork(done, params); 450 testNetwork(done, params);
425}); 451});
452it('Allows selection of dogecoin testnet', function(done) {
453 var params = {
454 selectText: "DOGEt - Dogecoin Testnet",
455 firstAddress: "niHnSJKHdwDyDxRMLBJrtNqpvHEsAFWe6B",
456 };
457 testNetwork(done, params);
458});
426it('Allows selection of denarius', function(done) { 459it('Allows selection of denarius', function(done) {
427 var params = { 460 var params = {
428 selectText: "DNR - Denarius", 461 selectText: "DNR - Denarius",
@@ -475,7 +508,7 @@ it('Allows selection of clam', function(done) {
475it('Allows selection of crown', function(done) { 508it('Allows selection of crown', function(done) {
476 var params = { 509 var params = {
477 selectText: "CRW - Crown (Legacy)", 510 selectText: "CRW - Crown (Legacy)",
478 firstAddress: "18pWSwSUAQdiwMHUfFZB1fM2xue9X1FqE5", 511 firstAddress: "18pWSwSUAQdiwMHUfFZB1fM2xue9X1FqE5",
479 }; 512 };
480 testNetwork(done, params); 513 testNetwork(done, params);
481}); 514});
@@ -535,6 +568,13 @@ it('Allows selection of lkrcoin', function(done) {
535 }; 568 };
536 testNetwork(done, params); 569 testNetwork(done, params);
537}); 570});
571it('Allows selection of bolivarcoin', function(done) {
572 var params = {
573 selectText: "BOLI - Bolivarcoin",
574 firstAddress: "bbKzCAUR7hZ3nqfffy7VgrSz8LmAP3S5mK",
575 };
576 testNetwork(done, params);
577});
538it('Allows selection of peercoin', function(done) { 578it('Allows selection of peercoin', function(done) {
539 var params = { 579 var params = {
540 selectText: "PPC - Peercoin", 580 selectText: "PPC - Peercoin",
@@ -608,6 +648,20 @@ it('Allows selection of maza', function(done) {
608 }; 648 };
609 testNetwork(done, params); 649 testNetwork(done, params);
610}); 650});
651it('Allows selection of FIX', function(done) {
652 var params = {
653 selectText: "FIX - FIX",
654 firstAddress: "FS5MEU8fs5dUvsaSCSusV8RQtC8j2h3JEh",
655 };
656 testNetwork(done, params);
657});
658it('Allows selection of FIX testnet', function(done) {
659 var params = {
660 selectText: "FIX - FIX Testnet",
661 firstAddress: "XpnU1HHdNG5YxvG9Rez4wjmidchxqnZaNa",
662 };
663 testNetwork(done, params);
664});
611it('Allows selection of fujicoin', function(done) { 665it('Allows selection of fujicoin', function(done) {
612 var params = { 666 var params = {
613 selectText: "FJC - Fujicoin", 667 selectText: "FJC - Fujicoin",
@@ -678,6 +732,13 @@ it('Allows selection of Asiacoin', function(done) {
678 }; 732 };
679 testNetwork(done, params); 733 testNetwork(done, params);
680}); 734});
735it('Allows selection of Aryacoin', function(done) {
736 var params = {
737 selectText: "ARYA - Aryacoin",
738 firstAddress: "Abr6gX25KaU9BpwD34UfsL3A4n89NvYYSf",
739 };
740 testNetwork(done, params);
741});
681it('Allows selection of Auroracoin', function(done) { 742it('Allows selection of Auroracoin', function(done) {
682 var params = { 743 var params = {
683 selectText: "AUR - Auroracoin", 744 selectText: "AUR - Auroracoin",
@@ -720,6 +781,13 @@ it('Allows selection of Bitcoin Private', function(done) {
720 }; 781 };
721 testNetwork(done, params); 782 testNetwork(done, params);
722}); 783});
784it('Allows selection of Bitcoin SV', function(done) {
785 var params = {
786 selectText: "BSV - BitcoinSV",
787 firstAddress: "1N4mgtE5yxifch9jWs7Sds6oVqxdy2t576",
788 };
789 testNetwork(done, params);
790});
723it('Allows selection of Bitcoinz', function(done) { 791it('Allows selection of Bitcoinz', function(done) {
724 var params = { 792 var params = {
725 selectText: "BTCZ - Bitcoinz", 793 selectText: "BTCZ - Bitcoinz",
@@ -783,6 +851,13 @@ it('Allows selection of Compcoin', function(done) {
783 }; 851 };
784 testNetwork(done, params); 852 testNetwork(done, params);
785}); 853});
854it('Allows selection of CPUchain', function(done) {
855 var params = {
856 selectText: "CPU - CPUchain",
857 firstAddress: "CWSpLpW7jS4mBHJnkz3mmL5s3yQMg93zK8",
858 };
859 testNetwork(done, params);
860});
786it('Allows selection of Crave', function(done) { 861it('Allows selection of Crave', function(done) {
787 var params = { 862 var params = {
788 selectText: "CRAVE - Crave", 863 selectText: "CRAVE - Crave",
@@ -846,6 +921,13 @@ it('Allows selection of Einsteinium', function(done) {
846 }; 921 };
847 testNetwork(done, params); 922 testNetwork(done, params);
848}); 923});
924it('Allows selection of EOSIO', function(done) {
925 var params = {
926 selectText: "EOS - EOSIO",
927 firstPubKey: "EOS692VJTBK3Rmw93onNnpnZ8ZtmE9PdxjDStArvbyzoe11QUTNoy",
928 };
929 testNetwork(done, params, true);
930});
849it('Allows selection of Europecoin', function(done) { 931it('Allows selection of Europecoin', function(done) {
850 var params = { 932 var params = {
851 selectText: "ERC - Europecoin", 933 selectText: "ERC - Europecoin",
@@ -1070,6 +1152,13 @@ it('Allows selection of Omnicore', function(done) {
1070 }; 1152 };
1071 testNetwork(done, params); 1153 testNetwork(done, params);
1072}); 1154});
1155it('Allows selection of DeepOnion', function(done) {
1156 var params = {
1157 selectText: "ONION - DeepOnion",
1158 firstAddress: "DYREY7XCFXVqJ3x5UuN43k2JwD2s1kif48",
1159 };
1160 testNetwork(done, params);
1161});
1073it('Allows selection of Pesobit', function(done) { 1162it('Allows selection of Pesobit', function(done) {
1074 var params = { 1163 var params = {
1075 selectText: "PSB - Pesobit", 1164 selectText: "PSB - Pesobit",
@@ -1105,6 +1194,13 @@ it('Allows selection of Putincoin', function(done) {
1105 }; 1194 };
1106 testNetwork(done, params); 1195 testNetwork(done, params);
1107}); 1196});
1197it('Allows selection of Rapids', function(done) {
1198 var params = {
1199 selectText: "RPD - Rapids",
1200 firstAddress: "Ri8XxUdZaXS5LqxmFJcFEjFinkaMbmhSUp",
1201 };
1202 testNetwork(done, params);
1203});
1108it('Allows selection of Ravencoin', function(done) { 1204it('Allows selection of Ravencoin', function(done) {
1109 var params = { 1205 var params = {
1110 selectText: "RVN - Ravencoin", 1206 selectText: "RVN - Ravencoin",
@@ -1196,6 +1292,20 @@ it('Allows selection of Toa', function(done) {
1196 }; 1292 };
1197 testNetwork(done, params); 1293 testNetwork(done, params);
1198}); 1294});
1295it('Allows selection of TWINS', function(done) {
1296 var params = {
1297 selectText: "TWINS - TWINS",
1298 firstAddress: "WPpJnfLLubNmF7HLNxg8d8zH5haxn4wri8",
1299 };
1300 testNetwork(done, params);
1301});
1302it('Allows selection of TWINS testnet', function(done) {
1303 var params = {
1304 selectText: "TWINS - TWINS Testnet",
1305 firstAddress: "XpnU1HHdNG5YxvG9Rez4wjmidchxqnZaNa",
1306 };
1307 testNetwork(done, params);
1308});
1199it('Allows selection of Ultimatesecurecash', function(done) { 1309it('Allows selection of Ultimatesecurecash', function(done) {
1200 var params = { 1310 var params = {
1201 selectText: "USC - Ultimatesecurecash", 1311 selectText: "USC - Ultimatesecurecash",
@@ -1245,6 +1355,13 @@ it('Allows selection of Vpncoin', function(done) {
1245 }; 1355 };
1246 testNetwork(done, params); 1356 testNetwork(done, params);
1247}); 1357});
1358it('Allows selection of VeChain', function(done) {
1359 var params = {
1360 selectText: "VET - VeChain",
1361 firstAddress: "0xdba55B1B6070f3a733D5eDFf35F0da4A00E455F2",
1362 };
1363 testNetwork(done, params);
1364});
1248it('Allows selection of Whitecoin', function(done) { 1365it('Allows selection of Whitecoin', function(done) {
1249 var params = { 1366 var params = {
1250 selectText: "XWC - Whitecoin", 1367 selectText: "XWC - Whitecoin",
@@ -1280,9 +1397,9 @@ it('Allows selection of Zclassic', function(done) {
1280 }; 1397 };
1281 testNetwork(done, params); 1398 testNetwork(done, params);
1282}); 1399});
1283it('Allows selection of Zencash', function(done) { 1400it('Allows selection of Horizen', function(done) {
1284 var params = { 1401 var params = {
1285 selectText: "ZEN - Zencash", 1402 selectText: "ZEN - Horizen",
1286 firstAddress: "znWh9XASyW2dZq5tck84wFjiwuqVysi7q3p", 1403 firstAddress: "znWh9XASyW2dZq5tck84wFjiwuqVysi7q3p",
1287 }; 1404 };
1288 testNetwork(done, params); 1405 testNetwork(done, params);
@@ -1315,6 +1432,14 @@ it('Allows selection of MIX', function(done) {
1315 }; 1432 };
1316 testNetwork(done, params); 1433 testNetwork(done, params);
1317}); 1434});
1435it('Allows selection of Monkey Project', function(done) {
1436 var params = {
1437 selectText: "MONK - Monkey Project",
1438 firstAddress: "MnLrcnnUzKnf7TzufjRe5DLZqQJz18oYyu",
1439 };
1440 testNetwork(done, params);
1441});
1442
1318it('Allows selection of Musicoin', function(done) { 1443it('Allows selection of Musicoin', function(done) {
1319 var params = { 1444 var params = {
1320 selectText: "MUSIC - Musicoin", 1445 selectText: "MUSIC - Musicoin",
@@ -1345,11 +1470,18 @@ it('Allows selection of Callisto', function(done) {
1345}); 1470});
1346it('Allows selection of HUSH', function(done) { 1471it('Allows selection of HUSH', function(done) {
1347 var params = { 1472 var params = {
1348 selectText: "HUSH - Hush", 1473 selectText: "HUSH - Hush (Legacy)",
1349 firstAddress: "t1g6rLXUnJaiJuu4q4zmJjoa9Gk4fwKpiuA", 1474 firstAddress: "t1g6rLXUnJaiJuu4q4zmJjoa9Gk4fwKpiuA",
1350 }; 1475 };
1351 testNetwork(done, params); 1476 testNetwork(done, params);
1352}); 1477});
1478it('Allows selection of HUSH3', function(done) {
1479 var params = {
1480 selectText: "HUSH - Hush3",
1481 firstAddress: "RXWSQhwvw5jHPGP8bjwJhWoRnMLBnuPDKD",
1482 };
1483 testNetwork(done, params);
1484});
1353it('Allows selection of ExchangeCoin', function(done) { 1485it('Allows selection of ExchangeCoin', function(done) {
1354 var params = { 1486 var params = {
1355 selectText: "EXCC - ExchangeCoin", 1487 selectText: "EXCC - ExchangeCoin",
@@ -1434,6 +1566,48 @@ it('Allows selection of DEXON', function(done) {
1434 }; 1566 };
1435 testNetwork(done, params); 1567 testNetwork(done, params);
1436}); 1568});
1569it('Allows selection of Ellaism', function(done) {
1570 var params = {
1571 selectText: "ELLA - Ellaism",
1572 firstAddress: "0xa8B0BeA09eeBc41062308546a01d6E544277e2Ca",
1573 };
1574 testNetwork(done, params);
1575});
1576it('Allows selection of Ethersocial Network', function(done) {
1577 var params = {
1578 selectText: "ESN - Ethersocial Network",
1579 firstAddress: "0x6EE99Be2A0C7F887a71e21C8608ACF0aa0D2b767",
1580 };
1581 testNetwork(done, params);
1582});
1583it('Allows selection of Stellar', function(done) {
1584 var params = {
1585 selectText: "XLM - Stellar",
1586 firstAddress: "GCUK3NYYUXA2QGN6KU5RR36WAKN3Y5EANZV65XNAWN4XM4CHQ3G4DMO2",
1587 };
1588 testNetwork(done, params);
1589});
1590it('Allows selection of Wagerr', function(done) {
1591 var params = {
1592 selectText: "WGR - Wagerr",
1593 firstAddress: "WYiVgQU39VcQxcnacoCiaZHZZLjDCJoS95",
1594 };
1595 testNetwork(done, params);
1596});
1597it('Allows selection of Groestlcoin', function(done) {
1598 var params = {
1599 selectText: "GRS - Groestlcoin",
1600 firstAddress: "FZycsFvZ1eH1hbtyjBpAgJSukVw1bN6PBN",
1601 };
1602 testNetwork(done, params);
1603});
1604it('Allows selection of Groestlcoin Testnet', function(done) {
1605 var params = {
1606 selectText: "GRS - Groestlcoin Testnet",
1607 firstAddress: "mucaU5iiDaJDb69BHLeDv8JFfGiygRPne9",
1608 };
1609 testNetwork(done, params);
1610});
1437 1611
1438// BIP39 seed is set from phrase 1612// BIP39 seed is set from phrase
1439it('Sets the bip39 seed from the prhase', function(done) { 1613it('Sets the bip39 seed from the prhase', function(done) {
@@ -2014,6 +2188,7 @@ it('Ignores excess whitespace in the mnemonic', function(done) {
2014 2188
2015// Github Issue 23: Part 1: Use correct derivation path when changing tabs 2189// Github Issue 23: Part 1: Use correct derivation path when changing tabs
2016// https://github.com/iancoleman/bip39/issues/23 2190// https://github.com/iancoleman/bip39/issues/23
2191// This test was failing for default timeout of 5000ms so changed it to +10s
2017it('Uses the correct derivation path when changing tabs', function(done) { 2192it('Uses the correct derivation path when changing tabs', function(done) {
2018 // 1) and 2) set the phrase 2193 // 1) and 2) set the phrase
2019 driver.findElement(By.css('.phrase')) 2194 driver.findElement(By.css('.phrase'))
@@ -2038,7 +2213,7 @@ it('Uses the correct derivation path when changing tabs', function(done) {
2038 }); 2213 });
2039 }); 2214 });
2040 }); 2215 });
2041}); 2216}, generateDelay + 10000);
2042 2217
2043// Github Issue 23 Part 2: Coin selection in derivation path 2218// Github Issue 23 Part 2: Coin selection in derivation path
2044// https://github.com/iancoleman/bip39/issues/23#issuecomment-238011920 2219// https://github.com/iancoleman/bip39/issues/23#issuecomment-238011920
@@ -3896,6 +4071,27 @@ it('Shows litecoin BIP49 addresses', function(done) {
3896 }); 4071 });
3897}); 4072});
3898 4073
4074it('Shows Groestlcoin BIP49 addresses', function(done) {
4075 driver.findElement(By.css('.phrase'))
4076 .sendKeys('abandon abandon ability');
4077 selectNetwork("GRS - Groestlcoin");
4078 driver.findElement(By.css('#bip49-tab a'))
4079 .click()
4080 // bip49 addresses are shown
4081 driver.sleep(generateDelay).then(function() {
4082 driver.findElement(By.css('#bip49 .available'))
4083 .getAttribute("class")
4084 .then(function(classes) {
4085 expect(classes).not.toContain("hidden");
4086 // check first address
4087 getFirstAddress(function(address) {
4088 expect(address).toBe("3HXSCZwCypLyixMsF4Z1sN49noJtrm8gnX");
4089 done();
4090 });
4091 });
4092 });
4093});
4094
3899it('Can use root keys to generate segwit table rows', function(done) { 4095it('Can use root keys to generate segwit table rows', function(done) {
3900 // segwit uses ypub / zpub instead of xpub but the root key should still 4096 // segwit uses ypub / zpub instead of xpub but the root key should still
3901 // be valid regardless of the encoding used to import that key. 4097 // be valid regardless of the encoding used to import that key.