diff --git a/src/DbContext.php b/src/DbContext.php new file mode 100644 index 0000000..7fea687 --- /dev/null +++ b/src/DbContext.php @@ -0,0 +1,39 @@ + "Db module required", + ]; + } + // phpcs:enable + + // phpcs:disable + /** + * @param Db $dbc + */ + public function _inject(Db $dbc) + { + $this->dbc = $dbc; + } + // phpcs:enable +} diff --git a/src/RestContext.php b/src/RestContext.php index 61352af..239a4f4 100644 --- a/src/RestContext.php +++ b/src/RestContext.php @@ -182,7 +182,6 @@ public function iShouldSeeResponseContainsJSONFromFile(string $filepath) */ protected function checkResponseContainsJson(string $jsonString) { - var_dump($jsonString); $json = json_decode($jsonString, true); if (null === $json && json_last_error() != JSON_ERROR_NONE) { diff --git a/src/WebdriverContext.php b/src/WebdriverContext.php index 4b25b82..69a5c00 100644 --- a/src/WebdriverContext.php +++ b/src/WebdriverContext.php @@ -11,6 +11,7 @@ * Class WebdriverHelper * @package Jeckel\GherkinHelper * @SuppressWarnings(PHPMD.TooManyPublicMethods) + * @SuppressWarnings(PHPMD.TooManyMethods) */ class WebdriverContext extends ContextAbstract implements DependsOnModule { @@ -123,6 +124,16 @@ public function iResizeWindow(int $width, int $height) $this->webDriver->resizeWindow($width, $height); } + /** + * @Then I select option :option of :select + * @param string $option + * @param string $select + */ + public function iSelectOptionOf(string $option, string $select) + { + $this->webDriver->selectOption($select, $option); + } + /** * @Then I should not see :text * @param string $text @@ -223,6 +234,16 @@ public function iShouldSeeInCurrentUrl(string $uri) $this->webDriver->seeInCurrentUrl($uri); } + /** + * @Then I should see :value in field :field + * @param string $value + * @param string $field + */ + public function iShouldSeeInField(string $value, string $field) + { + $this->webDriver->seeInField($field, $value); + } + /** * @Then I should see in source * @param string $raw @@ -251,6 +272,16 @@ public function iShouldSeeLinkWithUrl(string $link, string $url) $this->webDriver->seeLink($link, $url); } + /** + * @Then I should see option :option is selected in :select + * @param string $option + * @param string $select + */ + public function iShouldSeeOptionIsSelectedIn(string $option, string $select) + { + $this->webDriver->seeOptionIsSelected($select, $option); + } + /** * @When I submit form :form * @param string $form