Commit 27c4c784 authored by bojanz's avatar bojanz Committed by bojanz

Issue #3093383 by bojanz: Fix the tests on Drupal 8.8-beta1

parent 2aecf668
......@@ -39,6 +39,11 @@ class AddToCartFieldReplacementTest extends CartWebDriverTestBase {
'commerce_product',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'classy';
/**
* {@inheritdoc}
*/
......
......@@ -43,6 +43,11 @@ class CheckoutOrderTest extends CommerceBrowserTestBase {
'views_ui',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'classy';
/**
* {@inheritdoc}
*/
......
......@@ -68,8 +68,8 @@ class CustomerProfileTypeTest extends OrderBrowserTestBase {
$this->drupalGet($profile_type->toUrl('edit-form'));
$checkbox = $this->getSession()->getPage()->findField('commerce_order[customer_profile_type]');
$this->assertNotEmpty($checkbox);
$this->assertTrue($checkbox->getAttribute('checked'));
$this->assertTrue($checkbox->getAttribute('disabled'));
$this->assertNotEmpty($checkbox->getAttribute('checked'));
$this->assertNotEmpty($checkbox->getAttribute('disabled'));
$this->submitForm([], 'Save');
// Confirm that saving the form doesn't unset the flag.
/** @var \Drupal\profile\Entity\ProfileTypeInterface $profile_type */
......@@ -80,8 +80,8 @@ class CustomerProfileTypeTest extends OrderBrowserTestBase {
$this->drupalGet('admin/config/people/profile-types/add');
$checkbox = $this->getSession()->getPage()->findField('commerce_order[customer_profile_type]');
$this->assertNotEmpty($checkbox);
$this->assertFalse($checkbox->getAttribute('checked'));
$this->assertFalse($checkbox->getAttribute('disabled'));
$this->assertEmpty($checkbox->getAttribute('checked'));
$this->assertEmpty($checkbox->getAttribute('disabled'));
$this->submitForm([
'label' => 'Customer (Shipping information)',
......@@ -111,8 +111,8 @@ class CustomerProfileTypeTest extends OrderBrowserTestBase {
$this->drupalGet($profile_type->toUrl('edit-form'));
$checkbox = $this->getSession()->getPage()->findField('commerce_order[customer_profile_type]');
$this->assertNotEmpty($checkbox);
$this->assertTrue($checkbox->getAttribute('checked'));
$this->assertFalse($checkbox->getAttribute('disabled'));
$this->assertNotEmpty($checkbox->getAttribute('checked'));
$this->assertEmpty($checkbox->getAttribute('disabled'));
// Confirm that the flag can't be unset once there's data.
$profile = Profile::create([
......@@ -131,8 +131,8 @@ class CustomerProfileTypeTest extends OrderBrowserTestBase {
$this->drupalGet($profile_type->toUrl('edit-form'));
$checkbox = $this->getSession()->getPage()->findField('commerce_order[customer_profile_type]');
$this->assertNotEmpty($checkbox);
$this->assertTrue($checkbox->getAttribute('checked'));
$this->assertTrue($checkbox->getAttribute('disabled'));
$this->assertNotEmpty($checkbox->getAttribute('checked'));
$this->assertNotEmpty($checkbox->getAttribute('disabled'));
// Confirm that unsetting the flag removes the address field.
$profile->delete();
......
......@@ -83,7 +83,7 @@ class CustomerProfileTest extends OrderWebDriverTestBase {
$this->assertEquals('RS', $options[1]->getValue());
$this->assertEquals('US', $options[2]->getValue());
// Confirm that the store default is selected when available.
$this->assertTrue($options[1]->getAttribute('selected'));
$this->assertNotEmpty($options[1]->getAttribute('selected'));
// Confirm that it is possible to change the country and submit the form.
$this->getSession()->getPage()->fillField('profile[address][0][address][country_code]', 'FR');
......@@ -141,7 +141,7 @@ class CustomerProfileTest extends OrderWebDriverTestBase {
$this->assertEquals($this->usAddress['address_line1'], $options[0]->getText());
$this->assertEquals($this->frenchAddress['address_line1'], $options[1]->getText());
$this->assertEquals('+ Enter a new address', $options[2]->getText());
$this->assertTrue($options[0]->getAttribute('selected'));
$this->assertNotEmpty($options[0]->getAttribute('selected'));
// Confirm that the US profile is shown rendered.
$this->assertRenderedAddress($this->usAddress);
......@@ -300,7 +300,7 @@ class CustomerProfileTest extends OrderWebDriverTestBase {
$this->assertEquals($this->frenchAddress['address_line1'], $options[1]->getText());
$this->assertEquals('+ Enter a new address', $options[2]->getText());
// Confirm that the address book profile is selected.
$this->assertTrue($options[1]->getAttribute('selected'));
$this->assertNotEmpty($options[1]->getAttribute('selected'));
$this->assertRenderedAddress($this->frenchAddress);
$this->submitForm([], 'Submit');
......@@ -348,7 +348,7 @@ class CustomerProfileTest extends OrderWebDriverTestBase {
$this->assertEquals($new_french_address['address_line1'], $options[1]->getText());
$this->assertEquals($this->frenchAddress['address_line1'], $options[2]->getText());
$this->assertEquals('+ Enter a new address', $options[3]->getText());
$this->assertTrue($options[2]->getAttribute('selected'));
$this->assertNotEmpty($options[2]->getAttribute('selected'));
$this->assertEquals('_original', $options[2]->getValue());
$this->assertRenderedAddress($this->frenchAddress);
......@@ -419,7 +419,7 @@ class CustomerProfileTest extends OrderWebDriverTestBase {
$this->assertEquals($this->frenchAddress['address_line1'] . ' (updated version)', $options[1]->getText());
$this->assertEquals($this->frenchAddress['address_line1'] . ' (original version)', $options[2]->getText());
$this->assertEquals('+ Enter a new address', $options[3]->getText());
$this->assertTrue($options[2]->getAttribute('selected'));
$this->assertNotEmpty($options[2]->getAttribute('selected'));
$this->assertEquals('_original', $options[2]->getValue());
$this->assertRenderedAddress($new_french_address);
......@@ -567,7 +567,7 @@ class CustomerProfileTest extends OrderWebDriverTestBase {
$this->assertEquals('37 Rue du Sentier', $options[0]->getText());
$this->assertEquals('Cetinjska 13', $options[1]->getText());
$this->assertEquals('+ Enter a new address', $options[2]->getText());
$this->assertTrue($options[1]->getAttribute('selected'));
$this->assertNotEmpty($options[1]->getAttribute('selected'));
// Confirm that a deleted address book profile is detected.
$new_address_book_profile->delete();
......@@ -577,7 +577,7 @@ class CustomerProfileTest extends OrderWebDriverTestBase {
$this->assertEquals('37 Rue du Sentier', $options[0]->getText());
$this->assertEquals('Cetinjska 13', $options[1]->getText());
$this->assertEquals('+ Enter a new address', $options[2]->getText());
$this->assertTrue($options[1]->getAttribute('selected'));
$this->assertNotEmpty($options[1]->getAttribute('selected'));
$this->assertEquals('_original', $options[1]->getValue());
$rendered_address = [
......
......@@ -236,7 +236,7 @@ class PaymentCheckoutTest extends CommerceWebDriverTestBase {
$this->assertNotNull($radio_button);
}
$default_radio_button = $page->findField('Visa ending in 9999');
$this->assertTrue($default_radio_button->getAttribute('checked'));
$this->assertNotEmpty($default_radio_button->getAttribute('checked'));
/** @var \Drupal\commerce_payment\Entity\PaymentGatewayInterface $payment_gateway */
$payment_gateway = PaymentGateway::create([
......
......@@ -64,8 +64,6 @@ class StoreTest extends CommerceWebDriverTestBase {
}
$this->submitForm($edit, t('Save'));
$this->assertSession()->pageTextContains("Saved the $name store.");
$store_count = $this->getSession()->getPage()->findAll('css', '.view-commerce-stores tr td.views-field-name');
$this->assertEquals(2, count($store_count));
}
/**
......
......@@ -44,6 +44,11 @@ class TaxNumberTest extends CommerceWebDriverTestBase {
'commerce_tax_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'classy';
/**
* {@inheritdoc}
*/
......
......@@ -45,6 +45,11 @@ abstract class CommerceBrowserTestBase extends BrowserTestBase {
'commerce_store',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* A test user with administrative privileges.
*
......
......@@ -47,6 +47,11 @@ class UninstallTest extends BrowserTestBase {
'commerce_payment',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests module uninstallation.
*/
......
......@@ -53,6 +53,11 @@ abstract class CommerceWebDriverTestBase extends WebDriverTestBase {
'commerce_store',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* A test user with administrative privileges.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment