]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Test custom number of additional addresses
authorIan Coleman <coleman.ian@gmail.com>
Sat, 3 Sep 2016 05:35:58 +0000 (15:35 +1000)
committerIan Coleman <coleman.ian@gmail.com>
Sat, 3 Sep 2016 05:35:58 +0000 (15:35 +1000)
tests.js

index 0c28ec8a68ff34a08f22233fb33a691b9b335739..124b6ce685b5cbed506133c6bcce285c7f99eef8 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -1214,6 +1214,43 @@ page.open(url, function(status) {
 },
 
 // A custom number of additional addresses can be generated
+function() {
+page.open(url, function(status) {
+    // set the phrase
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability");
+        $(".phrase").trigger("input");
+    });
+    waitForGenerate(function() {
+        // get the current number of addresses
+        var oldAddressCount = page.evaluate(function() {
+            return $(".address").length;
+        });
+        // set a custom number of additional addresses
+        page.evaluate(function() {
+            $(".rows-to-add").val(1);
+        });
+        // generate more addresses
+        page.evaluate(function() {
+            $(".more").click();
+        });
+        waitForGenerate(function() {
+            // check there are the correct number of addresses
+            var newAddressCount = page.evaluate(function() {
+                return $(".address").length;
+            });
+            if (newAddressCount - oldAddressCount != 1) {
+                console.log("Number of additional addresses cannot be customized");
+                console.log(newAddressCount)
+                console.log(oldAddressCount)
+                fail();
+            }
+            next();
+        });
+    });
+});
+},
+
 // Additional addresses are shown in order of derivation path
 
 // BIP32 root key can be set by the user