X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git;a=blobdiff_plain;f=tests%2Fspec%2Ftests.js;h=0bb56f8ac6affee7b49ddcd9ca4f157a140eae73;hp=4f774e8d0693ee7b85165f5d6664185793ed4e18;hb=acf4c9b588c6abcc275b4e46df54248a2c913366;hpb=1c2b8c6b2d77cdb0162f040c07d25bbe7cafe7c2 diff --git a/tests/spec/tests.js b/tests/spec/tests.js index 4f774e8..0bb56f8 100644 --- a/tests/spec/tests.js +++ b/tests/spec/tests.js @@ -30,9 +30,10 @@ var until = webdriver.until; var newDriver = null; var driver = null; // Delays in ms -var generateDelay = 1000; +var generateDelay = 1500; var feedbackDelay = 500; var entropyFeedbackDelay = 500; +var bip38delay = 15000; // url uses file:// scheme var path = require('path') @@ -422,6 +423,13 @@ it('Allows selection of dogecoin', function(done) { }; testNetwork(done, params); }); +it('Allows selection of denarius', function(done) { + var params = { + selectText: "DNR - Denarius", + firstAddress: "DFdFMVUMzU9xX88EywXvAGwjiwpxyh9vKb", + }; + testNetwork(done, params); +}); it('Allows selection of shadowcash', function(done) { var params = { selectText: "SDC - ShadowCash", @@ -492,6 +500,13 @@ it('Allows selection of game', function(done) { }; testNetwork(done, params); }); +it('Allows selection of komodo', function(done) { + var params = { + selectText: "KMD - Komodo", + firstAddress: "RMPPzJwAjPVZZAwJvXivHJGGjdCx6WBD2t", + }; + testNetwork(done, params); +}); it('Allows selection of namecoin', function(done) { var params = { selectText: "NMC - Namecoin", @@ -499,6 +514,13 @@ it('Allows selection of namecoin', function(done) { }; testNetwork(done, params); }); +it('Allows selection of onixcoin', function(done) { + var params = { + selectText: "ONX - Onixcoin", + firstAddress: "XGwMqddeKjT3ddgX73QokjVbCL3aK6Yxfk", + }; + testNetwork(done, params); +}); it('Allows selection of peercoin', function(done) { var params = { selectText: "PPC - Peercoin", @@ -531,7 +553,7 @@ it('Allows selection of slimcoin testnet', function(done) { it('Allows selection of bitcoin cash', function(done) { var params = { selectText: "BCH - Bitcoin Cash", - firstAddress: "1JKvb6wKtsjNoCRxpZ4DGrbniML7z5U16A", + firstAddress: "bitcoincash:qzlquk7w4hkudxypl4fgv8x279r754dkvur7jpcsps", }; testNetwork(done, params); }); @@ -580,7 +602,7 @@ it('Allows selection of nubits', function(done) { it('Allows selection of bitcoin gold', function(done) { var params = { selectText: "BTG - Bitcoin Gold", - firstAddress: "GWYxuwSqANWGV3WT7Gpr6HE91euYXBqtwQ", + firstAddress: "GdDqug4WUsn5syNbSTHatNn4XnuwZtzedx", }; testNetwork(done, params); }); @@ -591,1394 +613,2715 @@ it('Allows selection of monacoin', function(done) { }; testNetwork(done, params); }); - -// BIP39 seed is set from phrase -it('Sets the bip39 seed from the prhase', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('.seed')) - .getAttribute("value") - .then(function(seed) { - expect(seed).toBe("20da140d3dd1df8713cefcc4d54ce0e445b4151027a1ab567b832f6da5fcc5afc1c3a3f199ab78b8e0ab4652efd7f414ac2c9a3b81bceb879a70f377aa0a58f3"); - done(); - }) - }); +it('Allows selection of AXE', function(done) { + var params = { + selectText: "AXE - Axe", + firstAddress: "PScwtLUyPiGrqtKXrHF37DGETLXLZdw4up", + }; + testNetwork(done, params); }); - -// BIP32 root key is set from phrase -it('Sets the bip39 root key from the prhase', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('.root-key')) - .getAttribute("value") - .then(function(seed) { - expect(seed).toBe("xprv9s21ZrQH143K2jkGDCeTLgRewT9F2pH5JZs2zDmmjXes34geVnFiuNa8KTvY5WoYvdn4Ag6oYRoB6cXtc43NgJAEqDXf51xPm6fhiMCKwpi"); - done(); - }) - }); +it('Allows selection of BlackCoin', function(done) { + var params = { + selectText: "BLK - BlackCoin", + firstAddress: "B5MznAKwj7uQ42vDz3w4onhBXPcqhTwJ9z", + }; + testNetwork(done, params); }); - -// Tabs show correct addresses when changed -it('Shows the correct address when tab is changed', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('#bip32-tab a')) - .click(); - driver.sleep(generateDelay).then(function() { - getFirstAddress(function(address) { - expect(address).toBe("17uQ7s2izWPwBmEVFikTmZUjbBKWYdJchz"); - done(); - }); - }); - }); +it('Allows selection of Neblio', function(done) { + var params = { + selectText: "NEBL - Neblio", + firstAddress: "NefkeEEvhusbHMmTRrxx7H9wFnUXd8qQsE", + }; + testNetwork(done, params); }); - -// BIP44 derivation path is shown -it('Shows the derivation path for bip44 tab', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('#bip44 .path')) - .getAttribute("value") - .then(function(path) { - expect(path).toBe("m/44'/0'/0'/0"); - done(); - }) - }); +it('Allows selection of Beetlecoin', function(done) { + var params = { + selectText: "BEET - Beetlecoin", + firstAddress: "BVmtbEsGrjpknprmpHFq26z4kYHJUFHE71", + }; + testNetwork(done, params); }); - -// BIP44 extended private key is shown -it('Shows the extended private key for bip44 tab', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('.extended-priv-key')) - .getAttribute("value") - .then(function(path) { - expect(path).toBe("xprvA2DxxvPZcyRvYgZMGS53nadR32mVDeCyqQYyFhrCVbJNjPoxMeVf7QT5g7mQASbTf9Kp4cryvcXnu2qurjWKcrdsr91jXymdCDNxKgLFKJG"); - done(); - }) - }); +it('Allows selection of Adcoin', function(done) { + var params = { + selectText: "ACC - Adcoin", + firstAddress: "AcEDM6V5sF4kFHC76MJjjfProtS5Sw2qcd", + }; + testNetwork(done, params); }); - -// BIP44 extended public key is shown -it('Shows the extended public key for bip44 tab', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('.extended-pub-key')) - .getAttribute("value") - .then(function(path) { - expect(path).toBe("xpub6FDKNRvTTLzDmAdpNTc49ia9b4byd6vqCdUa46Fp3vqMcC96uBoufCmZXQLiN5AK3iSCJMhf9gT2sxkpyaPepRuA7W3MujV5tGmF5VfbueM"); - done(); - }) - }); +it('Allows selection of Asiacoin', function(done) { + var params = { + selectText: "AC - Asiacoin", + firstAddress: "ALupuEEz7kJjQTAvmtcBMBVuEjPa7GqZzE", + }; + testNetwork(done, params); }); - -// BIP44 account field changes address list -it('Changes the address list if bip44 account is changed', function(done) { - driver.findElement(By.css('#bip44 .account')) - .sendKeys('1'); - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - getFirstAddress(function(address) { - expect(address).toBe("1Nq2Wmu726XHCuGhctEtGmhxo3wzk5wZ1H"); - done(); - }); - }); +it('Allows selection of Auroracoin', function(done) { + var params = { + selectText: "AUR - Auroracoin", + firstAddress: "ANuraS6F4Jpi413FEnavjYkKYJJRHkgYCm", + }; + testNetwork(done, params); }); - -// BIP44 change field changes address list -it('Changes the address list if bip44 change is changed', function(done) { - driver.findElement(By.css('#bip44 .change')) - .sendKeys('1'); - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - getFirstAddress(function(address) { - expect(address).toBe("1KAGfWgqfVbSSXY56fNQ7YnhyKuoskHtYo"); - done(); - }); - }); +it('Allows selection of Bata', function(done) { + var params = { + selectText: "BTA - Bata", + firstAddress: "BGxBdNeYPtF3GCuTtZBPQdFxCkdBYSF3fj", + }; + testNetwork(done, params); }); - -// BIP32 derivation path can be set -it('Can use a custom bip32 derivation path', function(done) { - driver.findElement(By.css('#bip32-tab a')) - .click(); - driver.findElement(By.css('#bip32 .path')) - .clear(); - driver.findElement(By.css('#bip32 .path')) - .sendKeys('m/1'); - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - getFirstAddress(function(address) { - expect(address).toBe("16pYQQdLD1hH4hwTGLXBaZ9Teboi1AGL8L"); - done(); - }); - }); +it('Allows selection of Belacoin', function(done) { + var params = { + selectText: "BELA - Belacoin", + firstAddress: "BEeetqpNffdzeknSpNmQp5KAFh2KK1Qx7S", + }; + testNetwork(done, params); }); - -// BIP32 can use hardened derivation paths -it('Can use a hardened derivation paths', function(done) { - driver.findElement(By.css('#bip32-tab a')) - .click(); - driver.findElement(By.css('#bip32 .path')) - .clear(); - driver.findElement(By.css('#bip32 .path')) - .sendKeys("m/0'"); - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - getFirstAddress(function(address) { - expect(address).toBe("14aXZeprXAE3UUKQc4ihvwBvww2LuEoHo4"); - done(); - }); - }); +it('Allows selection of Bitcoin Atom', function(done) { + var params = { + selectText: "BCA - Bitcoin Atom", + firstAddress: "AMy6qMbJeC4zsGRL6iWszmeCdQH65fgfih", + }; + testNetwork(done, params); }); - -// BIP32 extended private key is shown -it('Shows the BIP32 extended private key', function(done) { - driver.findElement(By.css('#bip32-tab a')) - .click(); - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('.extended-priv-key')) - .getAttribute("value") - .then(function(privKey) { - expect(privKey).toBe("xprv9va99uTVE5aLiutUVLTyfxfe8v8aaXjSQ1XxZbK6SezYVuikA9MnjQVTA8rQHpNA5LKvyQBpLiHbBQiiccKiBDs7eRmBogsvq3THFeLHYbe"); - done(); - }); - }); +it('Allows selection of Bitcoinplus', function(done) { + var params = { + selectText: "XBC - Bitcoinplus", + firstAddress: "B7FSynZoDbEwTCSgsXq9nJ5ue8owYLVL8r", + }; + testNetwork(done, params); }); - -// BIP32 extended public key is shown -it('Shows the BIP32 extended public key', function(done) { - driver.findElement(By.css('#bip32-tab a')) - .click(); - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('.extended-pub-key')) - .getAttribute("value") - .then(function(pubKey) { - expect(pubKey).toBe("xpub69ZVZQzP4T8dwPxwbMzz36cNgwy4yzTHmETZMyihzzXXNi3thgg3HCow1RtY252wdw5rS8369xKnraN5Q93y3FkFfJp2XEHWUrkyXsjS93P"); - done(); - }); - }); +it('Allows selection of Bitcoin Private', function(done) { + var params = { + selectText: "BTCP - Bitcoin Private", + firstAddress: "b1M3PbiXXyN6Hdivdw5rJv5VKpLjPzhm4jM", + }; + testNetwork(done, params); }); - -// Derivation path is shown in table -it('Shows the derivation path in the table', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - getFirstPath(function(path) { - expect(path).toBe("m/44'/0'/0'/0/0"); - done(); - }); - }); +it('Allows selection of Bitcoinz', function(done) { + var params = { + selectText: "BTCZ - Bitcoinz", + firstAddress: "t1X2YQoxs8cYRo2oaBYgVEwW5QNjCC59NYc", + }; + testNetwork(done, params); }); - -// Derivation path for address can be hardened -it('Can derive hardened addresses', function(done) { - driver.findElement(By.css('#bip32-tab a')) - .click(); - driver.executeScript(function() { - $(".hardened-addresses").prop("checked", true); - }); - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - getFirstAddress(function(address) { - expect(address).toBe("18exLzUv7kfpiXRzmCjFDoC9qwNLFyvwyd"); - done(); - }); - }); +it('Allows selection of BitCloud', function(done) { + var params = { + selectText: "BTDX - BitCloud", + firstAddress: "BHbWitXCNgTf1BhsRDNMP186EeibuzmrBi", + }; + testNetwork(done, params); }); - -// Derivation path visibility can be toggled -it('Can toggle visibility of the derivation path column', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('.index-toggle')) - .click(); - testColumnValuesAreInvisible(done, "index"); - }); +it('Allows selection of Bitcore', function(done) { + var params = { + selectText: "BTX - Bitcore", + firstAddress: "2Rgp5Znhpy34TK4QmPkfCiYs9r4KovfTH9", + }; + testNetwork(done, params); }); - -// Address is shown -it('Shows the address in the table', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - getFirstAddress(function(address) { - expect(address).toBe("1Di3Vp7tBWtyQaDABLAjfWtF6V7hYKJtug"); - done(); - }); - }); +it('Allows selection of Bitsend', function(done) { + var params = { + selectText: "BSD - Bitsend", + firstAddress: "iBPk7LYjDun3EPk7CRR8UUmnPoceVc1bp2", + }; + testNetwork(done, params); }); - -// Addresses are shown in order of derivation path -it('Shows the address in order of derivation path', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - testRowsAreInCorrectOrder(done); - }); +it('Allows selection of Britcoin', function(done) { + var params = { + selectText: "BRIT - Britcoin", + firstAddress: "B6Aue4J2XLs1f1dtD4H1SHYFfh4XrmEbrw", + }; + testNetwork(done, params); }); - -// Address visibility can be toggled -it('Can toggle visibility of the address column', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('.address-toggle')) - .click(); - testColumnValuesAreInvisible(done, "address"); - }); +it('Allows selection of Canadaecoin', function(done) { + var params = { + selectText: "CDN - Canadaecoin", + firstAddress: "CanAyCfd5Rj2CQVfaoAmvDUZunPM5W1AEQ", + }; + testNetwork(done, params); }); - -// Public key is shown in table -it('Shows the public key in the table', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElements(By.css('.pubkey')) - .then(function(els) { - els[0].getText() - .then(function(pubkey) { - expect(pubkey).toBe("033f5aed5f6cfbafaf223188095b5980814897295f723815fea5d3f4b648d0d0b3"); - done(); - }); - }); - }); +it('Allows selection of Cannacoin', function(done) { + var params = { + selectText: "CCN - Cannacoin", + firstAddress: "CYjW8xWB43g6krLJTmmrPk1PonoQX7h9Qd", + }; + testNetwork(done, params); }); - -// Public key visibility can be toggled -it('Can toggle visibility of the public key column', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('.public-key-toggle')) - .click(); - testColumnValuesAreInvisible(done, "pubkey"); - }); +it('Allows selection of Clubcoin', function(done) { + var params = { + selectText: "CLUB - Clubcoin", + firstAddress: "CHMDEXN4sihpSVX4GyAa2hZ62shnby7uyN", + }; + testNetwork(done, params); }); - -// Private key is shown in table -it('Shows the private key in the table', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElements(By.css('.privkey')) - .then(function(els) { - els[0].getText() - .then(function(pubkey) { - expect(pubkey).toBe("L26cVSpWFkJ6aQkPkKmTzLqTdLJ923e6CzrVh9cmx21QHsoUmrEE"); - done(); - }); - }); - }); +it('Allows selection of Compcoin', function(done) { + var params = { + selectText: "CMP - Compcoin", + firstAddress: "CLshtw3zhxkseBJS46UF12v3AFy9Dx7JVv", + }; + testNetwork(done, params); }); - -// Private key visibility can be toggled -it('Can toggle visibility of the private key column', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('.private-key-toggle')) - .click(); - testColumnValuesAreInvisible(done, "privkey"); - }); +it('Allows selection of Crave', function(done) { + var params = { + selectText: "CRAVE - Crave", + firstAddress: "VCYJeti6uKMNBFKCL7eP96UwuFWYHM7c85", + }; + testNetwork(done, params); }); - -// More addresses can be generated -it('Can generate more rows in the table', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('.more')) - .click(); - driver.sleep(generateDelay).then(function() { - driver.findElements(By.css('.address')) - .then(function(els) { - expect(els.length).toBe(40); - done(); - }); - }); - }); +it('Allows selection of Defcoin', function(done) { + var params = { + selectText: "DFC - Defcoin", + firstAddress: "D8swcgyaaFUrXZU3ATwbgy16buCpWqbG1M", + }; + testNetwork(done, params); }); - -// A custom number of additional addresses can be generated -it('Can generate more rows in the table', function(done) { - driver.findElement(By.css('.rows-to-add')) - .clear(); - driver.findElement(By.css('.rows-to-add')) - .sendKeys('1'); - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('.more')) - .click(); - driver.sleep(generateDelay).then(function() { - driver.findElements(By.css('.address')) - .then(function(els) { - expect(els.length).toBe(21); - done(); - }); - }); - }); +it('Allows selection of Diamond', function(done) { + var params = { + selectText: "DMD - Diamond", + firstAddress: "dJnrVbLL9UPjdaVRz2C8VpqHZknqAqjLek", + }; + testNetwork(done, params); }); - -// Additional addresses are shown in order of derivation path -it('Shows additional addresses in order of derivation path', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('.more')) - .click(); - driver.sleep(generateDelay).then(function() { - testRowsAreInCorrectOrder(done); - }); - }); +it('Allows selection of Digibyte', function(done) { + var params = { + selectText: "DGB - Digibyte", + firstAddress: "D85Rp9jwLtMdmP6wGjTiqHBdVQLST3YCEq", + }; + testNetwork(done, params); }); - -// BIP32 root key can be set by the user -it('Allows the user to set the BIP32 root key', function(done) { - driver.findElement(By.css('.root-key')) - .sendKeys('xprv9s21ZrQH143K2jkGDCeTLgRewT9F2pH5JZs2zDmmjXes34geVnFiuNa8KTvY5WoYvdn4Ag6oYRoB6cXtc43NgJAEqDXf51xPm6fhiMCKwpi'); - driver.sleep(generateDelay).then(function() { - getFirstAddress(function(address) { - expect(address).toBe("1Di3Vp7tBWtyQaDABLAjfWtF6V7hYKJtug"); - done(); - }); - }); +it('Allows selection of Digitalcoin', function(done) { + var params = { + selectText: "DGC - Digitalcoin", + firstAddress: "DKw4UGKEAZWweDNEbBFNQx4EM8x1mpUdia", + }; + testNetwork(done, params); }); - -// Setting BIP32 root key clears the existing phrase, passphrase and seed -// TODO this doesn't work in selenium with chrome -it('Confirms the existing phrase should be cleared', function(done) { - if (browser == "chrome") { - pending("Selenium + Chrome headless bug for alert, see https://stackoverflow.com/q/45242264"); - } - driver.findElement(By.css('.phrase')) - .sendKeys('A non-blank but invalid value'); - driver.findElement(By.css('.root-key')) - .sendKeys('xprv9s21ZrQH143K2jkGDCeTLgRewT9F2pH5JZs2zDmmjXes34geVnFiuNa8KTvY5WoYvdn4Ag6oYRoB6cXtc43NgJAEqDXf51xPm6fhiMCKwpi'); - driver.switchTo().alert().accept(); - driver.findElement(By.css('.phrase')) - .getAttribute("value").then(function(value) { - expect(value).toBe(""); - done(); - }); +it('Allows selection of Ecoin', function(done) { + var params = { + selectText: "ECN - Ecoin", + firstAddress: "e6WFPLG5gcXyF7cESFteH1hE2XSmowW5yB", + }; + testNetwork(done, params); }); - -// Clearing of phrase, passphrase and seed can be cancelled by user -// TODO this doesn't work in selenium with chrome -it('Allows the clearing of the phrase to be cancelled', function(done) { - if (browser == "chrome") { - pending("Selenium + Chrome headless bug for alert, see https://stackoverflow.com/q/45242264"); - } - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('.root-key')) - .clear(); - driver.findElement(By.css('.root-key')) - .sendKeys('x'); - driver.switchTo().alert().dismiss(); - driver.findElement(By.css('.phrase')) - .getAttribute("value").then(function(value) { - expect(value).toBe("abandon abandon ability"); - done(); - }); - }); +it('Allows selection of Edrcoin', function(done) { + var params = { + selectText: "EDRC - Edrcoin", + firstAddress: "eh1nUJsvgKPFv6ebMBfcwJ299GMCpjeZUG", + }; + testNetwork(done, params); }); - -// Custom BIP32 root key is used when changing the derivation path -it('Can set derivation path for root key instead of phrase', function(done) { - driver.findElement(By.css('#bip44 .account')) - .sendKeys('1'); - driver.findElement(By.css('.root-key')) - .sendKeys('xprv9s21ZrQH143K2jkGDCeTLgRewT9F2pH5JZs2zDmmjXes34geVnFiuNa8KTvY5WoYvdn4Ag6oYRoB6cXtc43NgJAEqDXf51xPm6fhiMCKwpi'); - driver.sleep(generateDelay).then(function() { - getFirstAddress(function(address) { - expect(address).toBe("1Nq2Wmu726XHCuGhctEtGmhxo3wzk5wZ1H"); - done(); - }); - }); +it('Allows selection of Egulden', function(done) { + var params = { + selectText: "EFL - Egulden", + firstAddress: "Lg66yt55R7edRM58cDhKzXik2kFme3viX7", + }; + testNetwork(done, params); }); - -// Incorrect mnemonic shows error -it('Shows an error for incorrect mnemonic', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon abandon'); - driver.sleep(feedbackDelay).then(function() { - driver.findElement(By.css('.feedback')) - .getText() - .then(function(feedback) { - expect(feedback).toBe("Invalid mnemonic"); - done(); - }); - }); +it('Allows selection of Einsteinium', function(done) { + var params = { + selectText: "EMC2 - Einsteinium", + firstAddress: "EVAABm9hXKHk2MpVMbwNakRubFnNha5m8m", + }; + testNetwork(done, params); }); - -// Incorrect word shows suggested replacement -it('Shows word suggestion for incorrect word', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon abiliti'); - driver.sleep(feedbackDelay).then(function() { - driver.findElement(By.css('.feedback')) - .getText() - .then(function(feedback) { - var msg = "abiliti not in wordlist, did you mean ability?"; - expect(feedback).toBe(msg); - done(); - }); - }); +it('Allows selection of Europecoin', function(done) { + var params = { + selectText: "ERC - Europecoin", + firstAddress: "ESA2YwPYntAoaPrE8Fm5qkKRtkcwLcwD6R", + }; + testNetwork(done, params); }); - -// Github pull request 48 -// First four letters of word shows that word, not closest -// since first four letters gives unique word in BIP39 wordlist -// eg ille should show illegal, not idle -it('Shows word suggestion based on first four chars', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('ille'); - driver.sleep(feedbackDelay).then(function() { - driver.findElement(By.css('.feedback')) - .getText() - .then(function(feedback) { - var msg = "ille not in wordlist, did you mean illegal?"; - expect(feedback).toBe(msg); - done(); - }); - }); +it('Allows selection of Exclusivecoin', function(done) { + var params = { + selectText: "EXCL - Exclusivecoin", + firstAddress: "EbUa6m8UZW6nTxsYZD2FsDjkadKbp5M6JT", + }; + testNetwork(done, params); }); - -// Incorrect BIP32 root key shows error -it('Shows error for incorrect root key', function(done) { - driver.findElement(By.css('.root-key')) - .sendKeys('xprv9s21ZrQH143K2jkGDCeTLgRewT9F2pH5JZs2zDmmjXes34geVnFiuNa8KTvY5WoYvdn4Ag6oYRoB6cXtc43NgJAEqDXf51xPm6fhiMCKwpj'); - driver.sleep(feedbackDelay).then(function() { - driver.findElement(By.css('.feedback')) - .getText() - .then(function(feedback) { - var msg = "Invalid root key"; - expect(feedback).toBe(msg); - done(); - }); - }); +it('Allows selection of Feathercoin', function(done) { + var params = { + selectText: "FTC - Feathercoin", + firstAddress: "6gDdjAMoSgQaW8UhqK3oboHs6ftGAroKkM", + }; + testNetwork(done, params); }); - -// Derivation path not starting with m shows error -it('Shows error for derivation path not starting with m', function(done) { - driver.findElement(By.css('#bip32-tab a')) - .click(); - driver.findElement(By.css('#bip32 .path')) - .clear(); - driver.findElement(By.css('#bip32 .path')) - .sendKeys('n/0'); - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(feedbackDelay).then(function() { - driver.findElement(By.css('.feedback')) - .getText() - .then(function(feedback) { - var msg = "First character must be 'm'"; - expect(feedback).toBe(msg); - done(); - }); - }); +it('Allows selection of Firstcoin', function(done) { + var params = { + selectText: "FRST - Firstcoin", + firstAddress: "FJN9GzfMm7Q8R4DJwK1H9F6A1GTghvFiMJ", + }; + testNetwork(done, params); }); - -// Derivation path containing invalid characters shows useful error -it('Shows error for derivation path not starting with m', function(done) { - driver.findElement(By.css('#bip32-tab a')) - .click(); - driver.findElement(By.css('#bip32 .path')) - .clear(); - driver.findElement(By.css('#bip32 .path')) - .sendKeys('m/1/0wrong1/1'); - driver.findElement(By.css('.phrase')) - .sendKeys('abandon abandon ability'); - driver.sleep(feedbackDelay).then(function() { - driver.findElement(By.css('.feedback')) - .getText() - .then(function(feedback) { - var msg = "Invalid characters 0wrong1 found at depth 2"; - expect(feedback).toBe(msg); - done(); - }); - }); +it('Allows selection of Flashcoin', function(done) { + var params = { + selectText: "FLASH - Flashcoin", + firstAddress: "UWfpf5LfMmLxZYooEb2EyvWhZ8NG7EZDRt", + }; + testNetwork(done, params); }); - -// Github Issue 11: Default word length is 15 -// https://github.com/iancoleman/bip39/issues/11 -it('Sets the default word length to 15', function(done) { - driver.findElement(By.css('.strength')) - .getAttribute("value") - .then(function(strength) { - expect(strength).toBe("15"); - done(); - }); +it('Allows selection of GCRCoin', function(done) { + var params = { + selectText: "GCR - GCRCoin", + firstAddress: "GJjF5cLwyXLacpuvXAVksxGxKvHDjx58d6", + }; + testNetwork(done, params); }); - -// Github Issue 12: Generate more rows with private keys hidden -// https://github.com/iancoleman/bip39/issues/12 -it('Sets the correct hidden column state on new rows', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys("abandon abandon ability"); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('.private-key-toggle')) - .click(); - driver.findElement(By.css('.more')) - .click(); - driver.sleep(generateDelay).then(function() { - driver.findElements(By.css('.privkey')) - .then(function(els) { - expect(els.length).toBe(40); - }); - testColumnValuesAreInvisible(done, "privkey"); - }); - }); +it('Allows selection of Gobyte', function(done) { + var params = { + selectText: "GBX - Gobyte", + firstAddress: "GS813Ys2brkmvSUw1rUqGPm2HqQVDHJRyA", + }; + testNetwork(done, params); }); - -// Github Issue 19: Mnemonic is not sensitive to whitespace -// https://github.com/iancoleman/bip39/issues/19 -it('Ignores excess whitespace in the mnemonic', function(done) { - var doublespace = " "; - var mnemonic = "urge cat" + doublespace + "bid"; - driver.findElement(By.css('.phrase')) - .sendKeys(mnemonic); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css('.root-key')) - .getAttribute("value") - .then(function(seed) { - expect(seed).toBe("xprv9s21ZrQH143K3isaZsWbKVoTtbvd34Y1ZGRugGdMeBGbM3AgBVzTH159mj1cbbtYSJtQr65w6L5xy5L9SFC7c9VJZWHxgAzpj4mun5LhrbC"); - done(); - }); - }); +it('Allows selection of Gridcoin', function(done) { + var params = { + selectText: "GRC - Gridcoin", + firstAddress: "SGrWbBPvobgqKRF8td1Kdc9vbRY7MJ78Y9", + }; + testNetwork(done, params); }); - -// Github Issue 23: Part 1: Use correct derivation path when changing tabs -// https://github.com/iancoleman/bip39/issues/23 -it('Uses the correct derivation path when changing tabs', function(done) { - // 1) and 2) set the phrase - driver.findElement(By.css('.phrase')) - .sendKeys("abandon abandon ability"); - driver.sleep(generateDelay).then(function() { - // 3) select bip32 tab - driver.findElement(By.css('#bip32-tab a')) - .click(); - driver.sleep(generateDelay).then(function() { - // 4) switch from bitcoin to litecoin - selectNetwork("LTC - Litecoin"); - driver.sleep(generateDelay).then(function() { - // 5) Check address is displayed correctly - getFirstAddress(function(address) { - expect(address).toBe("LS8MP5LZ5AdzSZveRrjm3aYVoPgnfFh5T5"); - // 5) Check derivation path is displayed correctly - getFirstPath(function(path) { - expect(path).toBe("m/0/0"); - done(); - }); - }); - }); - }); - }); +it('Allows selection of Gulden', function(done) { + var params = { + selectText: "NLG - Gulden", + firstAddress: "GcDP7cNEc33MPPdTFNJ8pZc6VMZJ2CbKxY", + }; + testNetwork(done, params); }); - -// Github Issue 23 Part 2: Coin selection in derivation path -// https://github.com/iancoleman/bip39/issues/23#issuecomment-238011920 -it('Uses the correct derivation path when changing coins', function(done) { - // set the phrase - driver.findElement(By.css('.phrase')) - .sendKeys("abandon abandon ability"); - driver.sleep(generateDelay).then(function() { - // switch from bitcoin to clam - selectNetwork("CLAM - Clams"); - driver.sleep(generateDelay).then(function() { - // check derivation path is displayed correctly - getFirstPath(function(path) { - expect(path).toBe("m/44'/23'/0'/0/0"); - done(); - }); - }); - }); +it('Allows selection of Helleniccoin', function(done) { + var params = { + selectText: "HNC - Helleniccoin", + firstAddress: "LbHEKe5H72zp9G1fuWNiiNePTUfJb88915", + }; + testNetwork(done, params); }); - -// Github Issue 26: When using a Root key derrived altcoins are incorrect -// https://github.com/iancoleman/bip39/issues/26 -it('Uses the correct derivation for altcoins with root keys', function(done) { - // 1) 2) and 3) set the root key - driver.findElement(By.css('.root-key')) - .sendKeys("xprv9s21ZrQH143K2jkGDCeTLgRewT9F2pH5JZs2zDmmjXes34geVnFiuNa8KTvY5WoYvdn4Ag6oYRoB6cXtc43NgJAEqDXf51xPm6fhiMCKwpi"); - driver.sleep(generateDelay).then(function() { - // 4) switch from bitcoin to viacoin - selectNetwork("VIA - Viacoin"); - driver.sleep(generateDelay).then(function() { - // 5) ensure the derived address is correct - getFirstAddress(function(address) { - expect(address).toBe("Vq9Eq4N5SQnjqZvxtxzo7hZPW5XnyJsmXT"); - done(); - }); - }); - }); +it('Allows selection of Hempcoin', function(done) { + var params = { + selectText: "THC - Hempcoin", + firstAddress: "H8sdWbZyJV4gyXyHtLXDaNnAuUDhK5mfTV", + }; + testNetwork(done, params); }); - -// Selecting a language with no existing phrase should generate a phrase in -// that language. -it('Generate a random phrase when language is selected and no current phrase', function(done) { - driver.findElement(By.css("a[href='#japanese']")) - .click(); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css(".phrase")) - .getAttribute("value").then(function(phrase) { - expect(phrase.search(/[a-z]/)).toBe(-1); - expect(phrase.length).toBeGreaterThan(0); - done(); - }); - }); +it('Allows selection of Insane', function(done) { + var params = { + selectText: "INSN - Insane", + firstAddress: "iMPqEJMiXWuxC9U2NVinCCMr4t72h58EWx", + }; + testNetwork(done, params); }); - -// Selecting a language with existing phrase should update the phrase to use -// that language. -it('Updates existing phrases when the language is changed', function(done) { - driver.findElement(By.css(".phrase")) - .sendKeys("abandon abandon ability"); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css("a[href='#italian']")) - .click(); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css(".phrase")) - .getAttribute("value").then(function(phrase) { - // Check only the language changes, not the phrase - expect(phrase).toBe("abaco abaco abbaglio"); - getFirstAddress(function(address) { - // Check the address is correct - expect(address).toBe("1Dz5TgDhdki9spa6xbPFbBqv5sjMrx3xgV"); - done(); - }); - }); - }); - }); +it('Allows selection of Iop', function(done) { + var params = { + selectText: "IOP - Iop", + firstAddress: "pGKQmcaPf95Ur5o6oHK4qdiZ52p1yaTvq1", + }; + testNetwork(done, params); }); - -// Suggested replacement for erroneous word in non-English language -it('Shows word suggestion for incorrect word in non-English language', function(done) { - driver.findElement(By.css('.phrase')) - .sendKeys('abaco abaco zbbaglio'); - driver.sleep(feedbackDelay).then(function() { - driver.findElement(By.css('.feedback')) - .getText() - .then(function(feedback) { - var msg = "zbbaglio not in wordlist, did you mean abbaglio?"; - expect(feedback).toBe(msg); - done(); - }); - }); +it('Allows selection of Ixcoin', function(done) { + var params = { + selectText: "IXC - Ixcoin", + firstAddress: "xgE9bTZ6YypT3E6ByzkTt31Hq68E9BqywH", + }; + testNetwork(done, params); }); - -// Japanese word does not break across lines. -// Point 2 from -// https://github.com/bitcoin/bips/blob/master/bip-0039/bip-0039-wordlists.md#japanese -it('Does not break Japanese words across lines', function(done) { - driver.findElement(By.css('.phrase')) - .getCssValue("word-break") - .then(function(value) { - expect(value).toBe("keep-all"); - done(); - }); +it('Allows selection of Kobocoin', function(done) { + var params = { + selectText: "KOBO - Kobocoin", + firstAddress: "FTVoNJETXDAM8x7MnmdE8RwWndSr9PQWhy", + }; + testNetwork(done, params); }); - -// Language can be specified at page load using hash value in url -it('Can set the language from the url hash', function(done) { - driver.get(url + "#japanese").then(function() { - driver.findElement(By.css('.generate')).click(); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css(".phrase")) - .getAttribute("value").then(function(phrase) { - expect(phrase.search(/[a-z]/)).toBe(-1); - expect(phrase.length).toBeGreaterThan(0); - done(); - }); - }); - }); +it('Allows selection of Landcoin', function(done) { + var params = { + selectText: "LDCN - Landcoin", + firstAddress: "LLvLwNjG1aJcn1RS4W4GJUbv8fNaRATG7c", + }; + testNetwork(done, params); }); - -// Entropy can be entered by the user -it('Allows entropy to be entered', function(done) { - driver.findElement(By.css('.use-entropy')) - .click(); - driver.findElement(By.css('.entropy')) - .sendKeys('00000000 00000000 00000000 00000000'); - driver.sleep(generateDelay).then(function() { - driver.findElement(By.css(".phrase")) - .getAttribute("value").then(function(phrase) { - expect(phrase).toBe("abandon abandon ability"); - getFirstAddress(function(address) { - expect(address).toBe("1Di3Vp7tBWtyQaDABLAjfWtF6V7hYKJtug"); - done(); - }) - }); - }); +it('Allows selection of Library Credits', function(done) { + var params = { + selectText: "LBC - Library Credits", + firstAddress: "bQJEQrHDJyHdqycB32uysh1SWn8Ln8LMdg", + }; + testNetwork(done, params); }); - -// A warning about entropy is shown to the user, with additional information -it('Shows a warning about using entropy', function(done) { - driver.findElement(By.css('.use-entropy')) - .click(); - driver.findElement(By.css('.entropy-container')) - .getText() - .then(function(containerText) { - var warning = "mnemonic may be insecure"; - expect(containerText).toContain(warning); - driver.findElement(By.css('#entropy-notes')) - .findElement(By.xpath("parent::*")) - .getText() - .then(function(notesText) { - var detail = "flipping a fair coin, rolling a fair dice, noise measurements etc"; - expect(notesText).toContain(detail); - done(); - }); - }); +it('Allows selection of Linx', function(done) { + var params = { + selectText: "LINX - Linx", + firstAddress: "XGWQ3cb3LGUB3VnHmj6xYSMgnokNbf6dyk", + }; + testNetwork(done, params); }); - -// The types of entropy available are described to the user -it('Shows the types of entropy available', function(done) { - driver.findElement(By.css('.entropy')) - .getAttribute("placeholder") - .then(function(placeholderText) { - var options = [ - "binary", - "base 6", - "dice", - "base 10", - "hexadecimal", - "cards", - ]; - for (var i=0; i