Test image width and position
[MAILPOET-1843]
This commit is contained in:
committed by
Rostislav Wolný
parent
0f2cf9644c
commit
47b264406f
@@ -50,7 +50,7 @@ Module.ProductsBlockModel = base.BlockModel.extend({
|
|||||||
titleIsLink: false, // false|true
|
titleIsLink: false, // false|true
|
||||||
imageFullWidth: false, // true|false
|
imageFullWidth: false, // true|false
|
||||||
titlePosition: 'abovePost', // 'abovePost'|'aboveExcerpt'
|
titlePosition: 'abovePost', // 'abovePost'|'aboveExcerpt'
|
||||||
featuredImagePosition: 'centered', // 'centered'|'right'|'left'|'alternate'|'none'
|
featuredImagePosition: 'alternate', // 'centered'|'right'|'left'|'alternate'|'none'
|
||||||
pricePosition: 'hidden', // 'hidden'|'above'|'below'
|
pricePosition: 'hidden', // 'hidden'|'above'|'below'
|
||||||
readMoreType: 'link', // 'link'|'button'
|
readMoreType: 'link', // 'link'|'button'
|
||||||
readMoreText: 'Buy now', // 'link'|'button'
|
readMoreText: 'Buy now', // 'link'|'button'
|
||||||
|
@@ -160,6 +160,12 @@ class AcceptanceTester extends \Codeception\Actor {
|
|||||||
expect($attributeValue)->contains($contains);
|
expect($attributeValue)->contains($contains);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function assertAttributeNotContains($selector, $attribute, $notContains) {
|
||||||
|
$I = $this;
|
||||||
|
$attributeValue = $I->grabAttributeFrom($selector, $attribute);
|
||||||
|
expect($attributeValue)->notContains($notContains);
|
||||||
|
}
|
||||||
|
|
||||||
public function searchFor($query, $delay = 0, $element = '#search_input', $button = 'Search') {
|
public function searchFor($query, $delay = 0, $element = '#search_input', $button = 'Search') {
|
||||||
$I = $this;
|
$I = $this;
|
||||||
$I->waitForElement($element);
|
$I->waitForElement($element);
|
||||||
|
@@ -213,6 +213,28 @@ class EditorProductsCest {
|
|||||||
$I->clickLabelWithInput('mailpoet_posts_show_divider', 'false');
|
$I->clickLabelWithInput('mailpoet_posts_show_divider', 'false');
|
||||||
$this->waitForChange($I);
|
$this->waitForChange($I);
|
||||||
$I->dontSeeElementInDOM(self::EDITOR_PRODUCTS_SELECTOR . ' .mailpoet_divider_block');
|
$I->dontSeeElementInDOM(self::EDITOR_PRODUCTS_SELECTOR . ' .mailpoet_divider_block');
|
||||||
|
|
||||||
|
// Test "Image width"
|
||||||
|
$I->assertAttributeNotContains(self::EDITOR_PRODUCTS_SELECTOR . ' .mailpoet_image_block', 'class', 'mailpoet_full_image');
|
||||||
|
$I->clickLabelWithInput('imageFullWidth', 'true');
|
||||||
|
$this->waitForChange($I);
|
||||||
|
$I->assertAttributeContains(self::EDITOR_PRODUCTS_SELECTOR . ' .mailpoet_image_block', 'class', 'mailpoet_full_image');
|
||||||
|
|
||||||
|
// Test "Image position"
|
||||||
|
$I->seeElementInDOM(self::EDITOR_PRODUCT_SELECTOR . ':nth-child(2) .mailpoet_block:nth-child(2) .mailpoet_image_block');
|
||||||
|
$I->seeElementInDOM(self::EDITOR_PRODUCT_SELECTOR . ':nth-child(4) .mailpoet_block:nth-child(1) .mailpoet_image_block');
|
||||||
|
$I->clickLabelWithInput('mailpoet_products_featured_image_position', 'none');
|
||||||
|
$this->waitForChange($I);
|
||||||
|
$I->dontSeeElementInDOM(self::EDITOR_PRODUCTS_SELECTOR . ' .mailpoet_image_block');
|
||||||
|
$I->clickLabelWithInput('mailpoet_products_featured_image_position', 'left');
|
||||||
|
$this->waitForChange($I);
|
||||||
|
$I->seeElementInDOM(self::EDITOR_PRODUCT_SELECTOR . ':nth-child(2) .mailpoet_block:nth-child(1) .mailpoet_image_block');
|
||||||
|
$I->clickLabelWithInput('mailpoet_products_featured_image_position', 'right');
|
||||||
|
$this->waitForChange($I);
|
||||||
|
$I->seeElementInDOM(self::EDITOR_PRODUCT_SELECTOR . ':nth-child(2) .mailpoet_block:nth-child(2) .mailpoet_image_block');
|
||||||
|
$I->clickLabelWithInput('mailpoet_products_featured_image_position', 'centered');
|
||||||
|
$this->waitForChange($I);
|
||||||
|
$I->seeElementInDOM(self::EDITOR_PRODUCT_SELECTOR . ':nth-child(1) .mailpoet_image_block');
|
||||||
}
|
}
|
||||||
|
|
||||||
private function clearCategories(\AcceptanceTester $I) {
|
private function clearCategories(\AcceptanceTester $I) {
|
||||||
|
Reference in New Issue
Block a user