@@ -693,16 +693,23 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
$this->iWaitForSeconds(1);
$end_layout=$this->getSession()->getPage()->find('xpath',"//a[contains(@class, 'use-ajax layout-builder__link layout-builder__link--add') and contains(., 'at end of layout')]")->click();
$this->iWaitForSeconds(1);
$section=$this->getSession()->getPage()->find('xpath',"//*[contains(., '$cols') and contains(@class, 'use-ajax')]")->click();
$section=$this->getSession()->getPage()->find('xpath',"//*[contains(., '$cols') and contains(@class, 'use-ajax')]");
if(is_null($section)){
thrownew\Exception('The '.$cols.' option was not found or not visible');
$element=$this->getSession()->getPage()->find('xpath',"//label[contains(.,'$type') and contains(@for, 'edit-layout-settings-ui-tab-content-layout-container-type')]")->click();
$element=$this->getSession()->getPage()->find('xpath',"//label[contains(.,'$type') and contains(@for, 'edit-layout-settings-ui-tab-content-layout-container-type')]");
if(is_null($element)){
thrownew\Exception("The $type option was not found or not visible. \nThese are the available container types:\n\tFull (Default)\n\tEdge to Edge\n\tBoxed\n");
}
$element->click();
if($type==="Boxed"&&isset($width)){
$this->iSelectTheContainerWidth($width);
}
@@ -731,10 +742,14 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
* Example #1: When I select the "Tiny" container width
* Example #2: And I select the "Narrow" container width
*
* @When I select the :arg1 container width
* @When I select the :width container width
*/
publicfunctioniSelectTheContainerWidth($width){
$element=$this->getSession()->getPage()->find('xpath',"//label[contains(.,'$width') and contains(@for, 'edit-layout-settings-ui-tab-content-layout-container-width')]")->click();
$element=$this->getSession()->getPage()->find('xpath',"//label[contains(.,'$width') and contains(@for, 'edit-layout-settings-ui-tab-content-layout-container-width')]");
if(is_null($element)){
thrownew\Exception("The $width option was not found or not visible. \nThese are the available container widths:\n\tWide (Default)\n\tMedium\n\tNarrow\n\tTiny\n");
}
$element->click();
}
/**
@@ -745,10 +760,17 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
* Example #1: When I select the "md" "33% 67%" section breakpoint
* Example #2: And I select the "xs" "75% 25%" section breakpoint
*
*
* @When I select the :arg1 :arg2 section breakpoint
* @When I select the :size :point section breakpoint
$bg_color=$this->getSession()->getPage()->find('xpath',"//label[contains(., '$bg_color') and contains(@for, 'edit-layout-settings-ui-tab-content-appearance-background-background-color')]")->click();
$bg_color=$this->getSession()->getPage()->find('xpath',"//label[contains(., '$color') and contains(@for, 'edit-layout-settings-ui-tab-content-appearance-background-background-color')]");
if(is_null($bg_color)){
thrownew\Exception('The "'.$color.'" option was not found or not visible');
}
$bg_color->click();
}
/**
@@ -843,7 +885,11 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
thrownew\Exception('The "Edge to Edge Background" checkbox was not found or not visible');
}
$e2e->click();
}
/**
@@ -854,11 +900,15 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
* Example #1: When I select the "Dark" section text color
* Example #2: And I select the "White" section text color
*
* @When I select the :arg1 section text color
* @When I select the :color section text color
*/
publicfunctioniSelectTheSectionTextColor($color){
$this->iOpenTheSectionSettingsMenu("Typography");
$text_color=$this->getSession()->getPage()->find('xpath',"//label[contains(., '$color') and contains(@for, 'edit-layout-settings-ui-tab-content-appearance-typography-text-color-text')]")->click();
$text_color=$this->getSession()->getPage()->find('xpath',"//label[contains(., '$color') and contains(@for, 'edit-layout-settings-ui-tab-content-appearance-typography-text-color-text')]");
if(is_null($text_color)){
thrownew\Exception('The "'.$color.'" option was not found or not visible');
}
$text_color->click();
}
/**
@@ -869,41 +919,34 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
* Example #1: When I set the alignment to "End"
* Example #2: And I set the alignment to "Start"
*
* @When I set the alignment to :arg1
* @When I set the alignment to :align
*/
publicfunctioniSetTheAlignmentTo($align){
$this->iOpenTheSectionSettingsMenu("Typography");
$alignment=$this->getSession()->getPage()->find('xpath',"//label[contains(., '$align') and contains(@for, 'edit-layout-settings-ui-tab-content-appearance-typography-text-alignment')]")->click();
$alignment=$this->getSession()->getPage()->find('xpath',"//label[contains(., '$align') and contains(@for, 'edit-layout-settings-ui-tab-content-appearance-typography-text-alignment')]");
if(is_null($alignment)){
thrownew\Exception("The alignment option selected was not found or not visible. \nSelect one of these: \n\tStart\n\tCenter\n\tEnd\n\tJustify\n");
}
/**
* Set horizontal alignment for blocks
*
* Varbase Context #varbase
*
* Example #1: When I set the horizontal alignment to "Align center"
* Example #2: And I set the horizontal alignment to "Align start"
$horizontal_alignment=$this->getSession()->getPage()->find('xpath',"//label[contains(., '$h_align') and contains(@for, 'edit-layout-settings-ui-tab-content-appearance-alignment-horizontal-alignment-justify-content')]")->click();
$alignment->click();
}
/**
* Set vertical alignment for blocks
* Set the section blocks alignemnt
*
* Varbase Context #varbase
* #Varbase Context #varbase
*
* Example #1: When I set the vertical alignment to "Align bottom"
* Example #2: And I set the vertical alignment to "Align middle"
* Example #1: When I set the blocks vertical alignment to "Align middle"
* Example #2: When I set the blocks horizontal alignment to "Align start"
*
* @When I set the vertical alignment to :arg1
* @When I set the blocks :orientation alignment to :align
$vertical_alignment=$this->getSession()->getPage()->find('xpath',"//label[contains(., '$v_align') and contains(@for, 'edit-layout-settings-ui-tab-content-appearance-alignment-vertical-alignment-align-items')]")->click();
$alignment=$this->getSession()->getPage()->find('xpath',"//label[contains(., '$align') and contains(@for, 'edit-layout-settings-ui-tab-content-appearance-alignment-$orientation')]");
if(is_null($alignment)){
thrownew\Exception("The alignment option selected was not found or not visible\nAlignment options for vertical orientation are: \n\tAlign top\n\tAlign middle\n\tAlign bottom\n\nAlignment options for horizontal orientation are: \n\tAlign start\n\tAlign center\n\tAlign end\n");
}
$alignment->click();
}
/**
@@ -922,10 +965,13 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
$this->getSession()->getPage()->find('xpath',"//label[contains(.,'$b_color') and contains(@for, 'edit-layout-settings-ui-tab-content-appearance-border-border-color-border')]")->click();
$this->getSession()->getPage()->find('xpath',"//label[contains(@for, 'edit-layout-settings-ui-tab-content-appearance-border-border-$b_side') and contains(.,'$b_color')]")->click();
$all_sides=$this->getSession()->getPage()->find('xpath',"//label[contains(.,'$b_color') and contains(@for, 'edit-layout-settings-ui-tab-content-appearance-border-border-color-border')]");
if(is_null($all_sides)){
thrownew\Exception("The $b_color option was not found or not visible");
thrownew\Exception("The option selected was not found or not visible\nThe available border sides are:\n\ttop\n\tright\n\tbottom\n\tleft\n");
}
$one_side->click();
$color=$this->getSession()->getPage()->find('xpath',"//label[contains(@for, 'edit-layout-settings-ui-tab-content-appearance-border-border-$b_side') and contains(.,'$b_color')]");
if(is_null($color)){
thrownew\Exception("The $b_color option was not found or not visible");
}
$color->click();
}
}
/**
@@ -1059,9 +1158,12 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
thrownew\Exception('The image attachment options were not found or not visible');
}
$fixed_image->click();
}
/**
@@ -1125,9 +1246,14 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
* @When I set the image size to :arg1
*/
publicfunctioniSetTheImageSizeTo($arg1){
$image_size=$this->getSession()->getPage()->find('xpath',"//label[contains(@for, 'edit-layout-settings-ui-tab-content-appearance-background-background-options-background-size') and contains(., '$arg1')]")->click();
$this->iOpenTheSectionSettingsMenu("Background");
$this->iSwitchToSectionBackgroundImageSettings();
$image_size=$this->getSession()->getPage()->find('xpath',"//label[contains(@for, 'edit-layout-settings-ui-tab-content-appearance-background-background-options-background-size') and contains(., '$arg1')]");
if(is_null($image_size)){
thrownew\Exception("The background image size selected was not found or not visible\nThe available images sizes are:\n\tCover (Default)\n\tContain\n\tAuto\n");
}
$image_size->click();
}
/**
* Select an animation for a section
@@ -1141,7 +1267,11 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
*/
publicfunctioniSelectTheSectionAnimation($anime){
$this->iOpenTheSectionSettingsMenu("Animation");
$animation=$this->getSession()->getPage()->find('xpath',"//label[contains(., '$anime') and contains(@for, 'edit-layout-settings-ui-tab-content-appearance-animation-scroll-effects')]")->click();
$animation=$this->getSession()->getPage()->find('xpath',"//label[contains(., '$anime') and contains(@for, 'edit-layout-settings-ui-tab-content-appearance-animation-scroll-effects')]");
if(is_null($animation)){
thrownew\Exception('The "'.$anime.'" option was not found or not visible');
}
$animation->click();
}
/**
@@ -1155,8 +1285,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
*
* @When I add a :block block
*/
publicfunctioniAddABlock($block)
{
publicfunctioniAddABlock($block){
$add_block_btn=$this->getSession()->getPage()->find('xpath',"//*[contains(@class, 'use-ajax layout-builder__link layout-builder__link--add') and contains(., 'Add block')]")->click();
$this->iWaitForSeconds(1);
$custom_block_btn=$this->getSession()->getPage()->find('xpath',"//*[contains(@class, 'use-ajax inline-block-create-button') and contains(., 'Create custom block')]")->click();
@@ -1211,7 +1340,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
*
* Varbase Context #varbase.
*
* Example 1: I double click on the image with the "Flag Earth image title" title text.
* Example 1: I double click on the image with the "Flafg Earth image title" title text.
*
* @Given /^I double click on the image with the "([^"]*)" title text$/