diff --git a/uc_cart/lib/Drupal/uc_cart/Tests/CartCheckoutTest.php b/uc_cart/lib/Drupal/uc_cart/Tests/CartCheckoutTest.php
index 56a8df7..468a97a 100644
--- a/uc_cart/lib/Drupal/uc_cart/Tests/CartCheckoutTest.php
+++ b/uc_cart/lib/Drupal/uc_cart/Tests/CartCheckoutTest.php
@@ -16,6 +16,9 @@ class CartCheckoutTest extends UbercartTestBase {
 
   public static $modules = array('uc_payment', 'uc_payment_pack', 'uc_roles');
 
+  /** Authenticated but unprivileged user. */
+  protected $customer;
+
   public static function getInfo() {
     return array(
       'name' => 'Cart and checkout',
@@ -27,6 +30,9 @@ class CartCheckoutTest extends UbercartTestBase {
   public function setUp() {
     parent::setUp();
 
+    // Create a simple customer user account.
+    $this->customer = $this->drupalCreateUser();
+
     // Ensure test mails are logged.
     \Drupal::config('system.mail')
       ->set('interface.uc_order', 'Drupal\Core\Mail\TestMailCollector')
@@ -488,32 +494,9 @@ class CartCheckoutTest extends UbercartTestBase {
       t('Viewed cart page: Billing pane has been displayed.')
     );
 
-    // Build the panes.
-    $zone_id = db_query_range('SELECT zone_id FROM {uc_zones} WHERE zone_country_id = :country ORDER BY rand()', 0, 1, array('country' => \Drupal::config('uc_store.settings')->get('address.country')))->fetchField();
-    $oldname = $this->randomName(10);
-    $edit = array(
-      'panes[delivery][first_name]' => $oldname,
-      'panes[delivery][last_name]' => $this->randomName(10),
-      'panes[delivery][street1]' => $this->randomName(10),
-      'panes[delivery][city]' => $this->randomName(10),
-      'panes[delivery][zone]' => $zone_id,
-      'panes[delivery][postal_code]' => mt_rand(10000, 99999),
-
-      'panes[billing][first_name]' => $this->randomName(10),
-      'panes[billing][last_name]' => $this->randomName(10),
-      'panes[billing][street1]' => $this->randomName(10),
-      'panes[billing][city]' => $this->randomName(10),
-      'panes[billing][zone]' => $zone_id,
-      'panes[billing][postal_code]' => mt_rand(10000, 99999),
-    );
-
-    // If the email address has not been set, and the user has not logged in,
-    // add a primary email address.
-    if (!isset($edit['panes[customer][primary_email]']) && !$this->loggedInUser) {
-      $edit['panes[customer][primary_email]'] = $this->randomName(8) . '@example.com';
-    }
-
     // Submit the checkout page.
+    $edit = $this->populateCheckoutForm();
+    $oldname = $edit['panes[delivery][first_name]'];
     $this->drupalPostForm('cart/checkout', $edit, t('Review order'));
 
     $order_id = db_query("SELECT order_id FROM {uc_orders} WHERE delivery_first_name = :name", array(':name' => $oldname))->fetchField();
diff --git a/uc_order/lib/Drupal/uc_order/Tests/OrderTest.php b/uc_order/lib/Drupal/uc_order/Tests/OrderTest.php
index ffe0993..cfc4f7c 100644
--- a/uc_order/lib/Drupal/uc_order/Tests/OrderTest.php
+++ b/uc_order/lib/Drupal/uc_order/Tests/OrderTest.php
@@ -16,6 +16,9 @@ use Drupal\uc_store\Tests\UbercartTestBase;
  */
 class OrderTest extends UbercartTestBase {
 
+  /** Authenticated but unprivileged user. */
+  protected $customer;
+
   public static function getInfo() {
     return array(
       'name' => 'Orders',
@@ -24,6 +27,13 @@ class OrderTest extends UbercartTestBase {
     );
   }
 
+  public function setUp() {
+    parent::setUp();
+
+    // Create a simple customer user account.
+    $this->customer = $this->drupalCreateUser(array('view own orders'));
+  }
+
   public function testOrderAPI() {
     // Test defaults.
     $order = uc_order_new();
diff --git a/uc_store/lib/Drupal/uc_store/Tests/UbercartTestBase.php b/uc_store/lib/Drupal/uc_store/Tests/UbercartTestBase.php
index 0f2ce1c..7e071d3 100644
--- a/uc_store/lib/Drupal/uc_store/Tests/UbercartTestBase.php
+++ b/uc_store/lib/Drupal/uc_store/Tests/UbercartTestBase.php
@@ -40,9 +40,6 @@ abstract class UbercartTestBase extends WebTestBase {
     'unconditionally delete orders',
   );
 
-  /** Authenticated but unprivileged user. */
-  protected $customer;
-
   /** Test product. */
   protected $product;
 
@@ -65,9 +62,6 @@ abstract class UbercartTestBase extends WebTestBase {
     // Create a store administrator user account.
     $this->adminUser = $this->drupalCreateUser($adminPermissions);
 
-    // Create a simple customer user account.
-    $this->customer = $this->drupalCreateUser(array('view own orders'));
-
     // Create a test product.
     $this->product = $this->createProduct(array('uid' => $this->adminUser->id()));
   }
diff --git a/uc_taxes/lib/Drupal/uc_taxes/Tests/InclusiveTaxesTest.php b/uc_taxes/lib/Drupal/uc_taxes/Tests/InclusiveTaxesTest.php
index 583dbe5..2e7e2e3 100644
--- a/uc_taxes/lib/Drupal/uc_taxes/Tests/InclusiveTaxesTest.php
+++ b/uc_taxes/lib/Drupal/uc_taxes/Tests/InclusiveTaxesTest.php
@@ -110,22 +110,7 @@ class InclusiveTaxesTest extends UbercartTestBase {
     $this->assertText('Subtotal: $16.80', 'Order subtotal is correct on checkout page.');
 
     // Manually proceed to checkout review.
-    $zone_id = db_query_range('SELECT zone_id FROM {uc_zones} WHERE zone_country_id = :country ORDER BY rand()', 0, 1, array('country' => \Drupal::config('uc_store.settings')->get('address.country')))->fetchField();
-    $edit = array(
-      'panes[delivery][first_name]' => $this->randomName(10),
-      'panes[delivery][last_name]' => $this->randomName(10),
-      'panes[delivery][street1]' => $this->randomName(10),
-      'panes[delivery][city]' => $this->randomName(10),
-      'panes[delivery][zone]' => $zone_id,
-      'panes[delivery][postal_code]' => mt_rand(10000, 99999),
-
-      'panes[billing][first_name]' => $this->randomName(10),
-      'panes[billing][last_name]' => $this->randomName(10),
-      'panes[billing][street1]' => $this->randomName(10),
-      'panes[billing][city]' => $this->randomName(10),
-      'panes[billing][zone]' => $zone_id,
-      'panes[billing][postal_code]' => mt_rand(10000, 99999),
-    );
+    $edit = $this->populateCheckoutForm();
     $this->drupalPostForm('cart/checkout', $edit, t('Review order'));
     $this->assertRaw(t('Your order is almost complete.'));
 
diff --git a/uc_taxes/lib/Drupal/uc_taxes/Tests/StoredTaxesTest.php b/uc_taxes/lib/Drupal/uc_taxes/Tests/StoredTaxesTest.php
index e0955eb..cf40923 100644
--- a/uc_taxes/lib/Drupal/uc_taxes/Tests/StoredTaxesTest.php
+++ b/uc_taxes/lib/Drupal/uc_taxes/Tests/StoredTaxesTest.php
@@ -81,25 +81,8 @@ class StoredTaxesTest extends UbercartTestBase {
     $this->assertRaw($rate->name, t('Tax line item displayed.'));
     $this->assertRaw(uc_currency_format($rate->rate * $this->product->sell_price), t('Correct tax amount displayed.'));
 
-    // Build the panes.
-    $zone_id = db_query_range('SELECT zone_id FROM {uc_zones} WHERE zone_country_id = :country ORDER BY rand()', 0, 1, array('country' => \Drupal::config('uc_store.settings')->get('address.country')))->fetchField();
-    $edit = array(
-      'panes[delivery][first_name]' => $this->randomName(10),
-      'panes[delivery][last_name]' => $this->randomName(10),
-      'panes[delivery][street1]' => $this->randomName(10),
-      'panes[delivery][city]' => $this->randomName(10),
-      'panes[delivery][zone]' => $zone_id,
-      'panes[delivery][postal_code]' => mt_rand(10000, 99999),
-
-      'panes[billing][first_name]' => $this->randomName(10),
-      'panes[billing][last_name]' => $this->randomName(10),
-      'panes[billing][street1]' => $this->randomName(10),
-      'panes[billing][city]' => $this->randomName(10),
-      'panes[billing][zone]' => $zone_id,
-      'panes[billing][postal_code]' => mt_rand(10000, 99999),
-    );
-
     // Submit the checkout page.
+    $edit = $this->populateCheckoutForm();
     $this->drupalPostForm('cart/checkout', $edit, t('Review order'));
     $this->assertRaw(t('Your order is almost complete.'));
     $this->assertRaw($rate->name, t('Tax line item displayed.'));
