From 1b2d825766af6694fd296bfaec7f1b9166971b51 Mon Sep 17 00:00:00 2001 From: jkindly Date: Tue, 2 Jul 2024 12:28:28 +0200 Subject: [PATCH] OP-322: Behat update page textarea element with new content --- features/admin/managing_pages.feature | 2 +- tests/Behat/Context/Setup/PageContext.php | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/features/admin/managing_pages.feature b/features/admin/managing_pages.feature index 1b6bf435..7e4c3f4c 100644 --- a/features/admin/managing_pages.feature +++ b/features/admin/managing_pages.feature @@ -32,7 +32,7 @@ Feature: Managing cms pages @ui Scenario: Updating page with textarea content element - Given there is a page in the store + Given there is a page in the store with textarea content element When I want to edit this page And I fill "Code, Name" fields And I change textarea content element value to "New content" diff --git a/tests/Behat/Context/Setup/PageContext.php b/tests/Behat/Context/Setup/PageContext.php index 5c797c0d..d91b1837 100755 --- a/tests/Behat/Context/Setup/PageContext.php +++ b/tests/Behat/Context/Setup/PageContext.php @@ -52,6 +52,16 @@ public function thereIsAPageInTheStore(): void $this->savePage($page); } + /** + * @Given there is a page in the store with textarea content element + */ + public function thereIsAPageInTheStoreWithTextareaContentElement(): void + { + $page = $this->createPageWithTextareaContentElement(); + + $this->savePage($page); + } + /** * @Given there is an existing page with :name name */ @@ -193,9 +203,9 @@ private function createPage( return $page; } - private function createPageWithTextareaContentElement(string $code): PageInterface + private function createPageWithTextareaContentElement(): PageInterface { - $page = $this->createPage($code); + $page = $this->createPage(); /** @var ContentConfigurationInterface $contentConfiguration */ $contentConfiguration = new ContentConfiguration();