Commit 833270db authored by Alaa Jwiehan's avatar Alaa Jwiehan Committed by Rajab Natshah
Browse files

Issue #3253354 by Alaa Jwiehan, RajabNatshah: Add new step definitions to...

Issue #3253354 by Alaa Jwiehan, RajabNatshah: Add new step definitions to Varbase Context to help automate the testing for Varbase Layout Builder
parent a22a3bbe
Loading
Loading
Loading
Loading
+195 −222
Original line number Diff line number Diff line
@@ -681,8 +681,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
   *
   * @Then I select the :arg1 container type
   */
    public function iSelectTheContainerType($name)
    {
  public function iSelectTheContainerType($name) {
    $element = $this->getSession()->getPage()->find('xpath', "//label[contains(.,'$name') and contains(@for, 'edit-layout-settings-ui-tab-content-layout-container-type')]");
    $element->click();
  }
@@ -697,13 +696,11 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
   *
   * @Then I select the :arg1 container width
   */
    public function iSelectTheContainerWidth($width)
    {
  public function iSelectTheContainerWidth($width) {
    $element = $this->getSession()->getPage()->find('xpath', "//label[contains(.,'$width') and contains(@for, 'edit-layout-settings-ui-tab-content-layout-container-width')]");
    $element->click();
  }


  /**
  * Select a section breakpoint
  *
@@ -715,15 +712,11 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  *
  * @Then I select the :arg1 :arg2 breakpoint
  */
    public function iSelectTheBreakpoint($size, $point)
    {

  public function iSelectTheBreakpoint($size, $point) {
    $element = $this->getSession()->getPage()->find('xpath', "//*[contains(@class,'$size') and contains(.,'$point')]");
    $element->click();
  }



  /**
   * Select with gutters option for section
   *
@@ -733,15 +726,11 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
   *
   * @Then I add gutters
   */
    public function iAddGutters()
    {
  public function iAddGutters() {
    $with_gutters = $this->getSession()->getPage()->find('xpath', "//label[contains(., 'With Gutters')]");
    $with_gutters->click();
  }




  /**
   * Remove gutters between columns
   *
@@ -751,14 +740,11 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
   *
   * @Then I remove gutters between columns
   */
    public function iRemoveGuttersBetweenColumns()
    {
  public function iRemoveGuttersBetweenColumns() {
    $no_gutters = $this->getSession()->getPage()->find('xpath', "//*[contains(@class, 'vlb_gutters_between')]");
    $no_gutters->click();
  }



  /**
   * Move to the styles tab
   *
@@ -768,14 +754,11 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
   *
   * @Then I move to the styles tab
   */
    public function iMoveToTheStylesTab()
    {
  public function iMoveToTheStylesTab() {
    $styles_tab = $this->getSession()->getPage()->find('xpath', "//a[contains(@data-target, 'appearance')]");
    $styles_tab->click();
  }



  /**
   * Open a specific setting menu under styles tab in section configuration
   *
@@ -786,14 +769,11 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
   *
   * @Then I open the :arg1 settings menu
   */
    public function iOpenTheSettingsMenu($menu)
    {
  public function iOpenTheSettingsMenu($menu) {
    $menu = $this->getSession()->getPage()->find('xpath', "//span[contains(., '$menu') and contains(@class, 'bs-group-title')]");
    $menu->click();
  }



  /**
   * Select a background color
   *
@@ -809,8 +789,6 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
    $bg_color->click();
  }



  /**
   * Uncheck the Edge to Edge Background option
   *
@@ -825,7 +803,6 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
    $e2e->click();
  }


  /**
   * Select a text color
   *
@@ -841,8 +818,6 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
    $text_color->click();
  }



  /**
   * Set alignment of text
   *
@@ -858,7 +833,6 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
    $alignment->click();
  }


  /**
   * Set horizontal alignment for blocks
   *
@@ -890,7 +864,6 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
    $vertical_alignment->click();
  }


  /**
   * Select an animation for a section
   *