Skip to content

Commit

Permalink
OP-322: Behat update page textarea element with new content
Browse files Browse the repository at this point in the history
  • Loading branch information
jkindly committed Jul 2, 2024
1 parent 6529a12 commit 1b2d825
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion features/admin/managing_pages.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 12 additions & 2 deletions tests/Behat/Context/Setup/PageContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 1b2d825

Please sign in to comment.