Commit 923d35fd authored by Alaa Jwiehan's avatar Alaa Jwiehan Committed by Rajab Natshah
Browse files

Issue #3269421 by Alaa Jwiehan, Rajab Natshah: Add exception messages for VLB...

Issue #3269421 by Alaa Jwiehan, Rajab Natshah: Add exception messages for VLB automated testing step definitions
parent 1d81b327
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
  <!--Exclude folders used by common frontend tools. These folders match the file_scan_ignore_directories setting in default.settings.php-->
  <exclude-pattern>*/node_modules/*</exclude-pattern>
  <exclude-pattern>*/bower_components/*</exclude-pattern>
  <exclude-pattern>*/tests/features/bootstrap/*</exclude-pattern>
  <!-- <exclude-pattern>*/tests/features/bootstrap/*</exclude-pattern> -->

  <!--Exclude minimized css.-->
  <exclude-pattern>*/*.min.css</exclude-pattern>
+2469 −2471
Original line number Diff line number Diff line
@@ -3,9 +3,7 @@
use WebDriver\Exception;
use Drupal\DrupalExtension\Context\RawDrupalContext;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Mink\Exception\ElementHtmlException;
use Behat\Mink\Element\Element;
use Behat\Gherkin\Node\TableNode;

/**
 * Defines application features from the specific context.
@@ -669,15 +667,15 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * =========================================================
   * =========================================================.
   *
   * Section Configuration Functions
   *
	 * =========================================================
   * =========================================================.
   */

  /**
	 * Add a basic section at the end of layout
   * Add a basic section at the end of layout.
   *
   * Varbase Context #varbase
   *
@@ -713,7 +711,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Select a section container type
   * Select a section container type.
   *
   * Varbase Context #varbase
   *
@@ -735,7 +733,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Select a section container width
   * Select a section container width.
   *
   * Varbase Context #varbase
   *
@@ -753,7 +751,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Select a section breakpoint
   * Select a section breakpoint.
   *
   * Varbase Context #varbase
   *
@@ -775,7 +773,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Select with gutters option for section
   * Select with gutters option for section.
   *
   * Varbase Context #varbase
   *
@@ -793,7 +791,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Remove gutters between columns
   * Remove gutters between columns.
   *
   * Varbase Context #varbase
   *
@@ -811,7 +809,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Move to the section styles tab
   * Move to the section styles tab.
   *
   * Varbase Context #varbase
   *
@@ -829,7 +827,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Open a specific setting menu under styles tab in section configuration
   * Open a specific setting menu under styles tab in section configuration.
   *
   * Varbase Context #varbase
   *
@@ -855,7 +853,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Select a section background color
   * Select a section background color.
   *
   * Varbase Context #varbase
   *
@@ -874,7 +872,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Uncheck the Edge to Edge Background option
   * Uncheck the Edge to Edge Background option.
   *
   * Varbase Contaxt #varbase
   *
@@ -893,7 +891,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Select a section text color
   * Select a section text color.
   *
   * Varbase Context #varbase
   *
@@ -912,7 +910,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Set alignment of text
   * Set alignment of text.
   *
   * Varbase Context #varbase
   *
@@ -931,7 +929,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Set the section blocks alignemnt
   * Set the section blocks alignemnt.
   *
   * #Varbase Context #varbase
   *
@@ -950,7 +948,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Set the padding for a section
   * Set the padding for a section.
   *
   * Varbase Context #varbase
   *
@@ -963,7 +961,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
   * @When I set the section :side padding to :value
   * @When I set the section padding to :value
   */
	public function iSetTheSectionPaddingTo($side = NULL, $value) {
  public function iSetTheSectionPaddingTo($side = NULL, $value = 0) {
    $this->iOpenTheSectionSettingsMenu("Spacing");
    if (is_numeric($value)) {
      if ($value >= 1 && $value <= 5) {
@@ -991,7 +989,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Set the margin for a section
   * Set the margin for a section.
   *
   * Varbase Context #varbase
   *
@@ -1004,7 +1002,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
   * @When I set the section :side margin to :value
   * @When I set the section margin to :value
   */
	public function iSetTheSectionMarginTo($side = NULL, $value) {
  public function iSetTheSectionMarginTo($side = NULL, $value = 0) {
    $this->iOpenTheSectionSettingsMenu("Spacing");
    if (is_numeric($value)) {
      if ($value >= 1 && $value <= 5) {
@@ -1032,7 +1030,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Select a border style for a section
   * Select a border style for a section.
   *
   * Varbase Context #varbase
   *
@@ -1069,7 +1067,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Set the border width for a section
   * Set the border width for a section.
   *
   * Varbase Context #varbase
   *
@@ -1107,7 +1105,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Set the border color
   * Set the border color.
   *
   * Varbase Context #varbase
   *
@@ -1143,7 +1141,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Set the border radius
   * Set the border radius.
   *
   * Varbase Context #varbase
   *
@@ -1156,7 +1154,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
   * @When I set the section border radius to :value
   * @When I set the section :corner border radius to :value
   */
	public function iSetTheSectionBorderRadiusTo($corner = NULL, $value) {
  public function iSetTheSectionBorderRadiusTo($corner = NULL, $value = 0) {
    $this->iOpenTheSectionSettingsMenu("Border");
    if (is_numeric($value)) {
      if ($value >= 1 && $value <= 3) {
@@ -1183,7 +1181,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Switch to the background image settings found under background styles settings
   * Switch to the background image settings found under background styles settings.
   *
   * Varbase Context #varbase
   *
@@ -1201,7 +1199,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Switch to the background video settings found under background styles settings
   * Switch to the background video settings found under background styles settings.
   *
   * Varbase Context #varbase
   *
@@ -1219,7 +1217,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Set an image attachment to be fixed
   * Set an image attachment to be fixed.
   *
   * Varbase Context #varbase
   *
@@ -1236,7 +1234,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Set the background image size
   * Set the background image size.
   *
   * Varbase Context #varbase
   *
@@ -1256,7 +1254,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Select an animation for a section
   * Select an animation for a section.
   *
   * Varbase Context #varbase
   *
@@ -1275,7 +1273,7 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
  }

  /**
	 * Add a block to a section
   * Add a block to a section.
   *
   * Varbase Context #varbase
   *
@@ -1706,7 +1704,6 @@ class VarbaseContext extends RawDrupalContext implements SnippetAcceptingContext
    }
  }


  /**
   * Check if we can click a value in the input element.
   *
@@ -2071,7 +2068,7 @@ JS;
    // Find the label by its text, then use that to get the radio item's ID.
    $radioId = NULL;

		/** @var $label NodeElement */
    /** @var NodeElement $label */
    foreach ($this->getSession()->getPage()->findAll('css', 'label') as $label) {
      if ($labelText === $label->getText()) {
        if ($label->hasAttribute('for')) {
@@ -2088,7 +2085,7 @@ JS;
    }

    // Now use the ID to retrieve the button and click it.
		// @var NodeElement $radioButton.
    /** @var NodeElement $radioButton. */
    $radioButton = $this->getSession()->getPage()->find('css', "#$radioId");
    if (!$radioButton) {
      throw new \Exception("$labelText radio button not found.");
@@ -2212,7 +2209,7 @@ JS;
  }

  /**
	 * Scroll to top
   * Scroll to top.
   *
   * Varbase Context #varbase.
   *
@@ -2228,7 +2225,7 @@ JS;
  }

  /**
	 * Scroll to bottom
   * Scroll to bottom.
   *
   * Varbase Context #varbase.
   *
@@ -2380,8 +2377,9 @@ JS;
  /**
   * Retrieve a table row containing specified entity with operations.
   *
	 * @param \Behat\Mink\Element\Element
	 * @param string
   * @param \Behat\Mink\Element\Element $element
   *   The element row name.
   * @param string $search
   *   The text to search for in the table row.
   *
   * @return \Behat\Mink\Element\NodeElement
@@ -2395,7 +2393,7 @@ JS;
    }

    foreach ($rows as $row) {
			if (strpos($row->getText(), $search) !== false) {
      if (strpos($row->getText(), $search) !== FALSE) {
        return $row;
      }
    }