Skip to content

Commit

Permalink
[Behat] Cleanup contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbager committed Nov 11, 2017
1 parent a416e76 commit b14c192
Show file tree
Hide file tree
Showing 44 changed files with 369 additions and 482 deletions.
19 changes: 0 additions & 19 deletions features/adding_block_with_sections.feature

This file was deleted.

18 changes: 0 additions & 18 deletions features/adding_new_html_block.feature

This file was deleted.

21 changes: 0 additions & 21 deletions features/adding_new_image_block.feature

This file was deleted.

20 changes: 0 additions & 20 deletions features/adding_new_text_block.feature

This file was deleted.

45 changes: 45 additions & 0 deletions features/admin/adding_block.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@managing_blocks
Feature: Adding blocks
In order to present and manage dynamic content on my store pages
As an Administrator
I want to be able to add new blocks

Background:
Given I am logged in as an administrator
And the store operates on a single channel in "United States"

@ui
Scenario: Adding html block
When I go to the create "html" block page
And I fill the code with "store_description"
And I fill the content with "<p>We have the best candies on the internet!</p>"
And I add it
Then I should be notified that the block has been created

@ui
Scenario: Adding text block
When I go to the create "text" block page
And I fill the code with "store_main_title"
And I fill the name with "Store title"
And I fill the content with "Welcome to the Candy Shop"
And I add it
Then I should be notified that the block has been created

@ui
Scenario: Adding image block
When I go to the create "image" block page
And I fill the code with "aston_martin_db_11"
And I fill the name with "Aston Marting DB 11 image"
And I fill the link with "/page/aston-martin-db-11-review"
And I upload the "aston_martin_db_11.jpg" image
And I add it
Then I should be notified that the block has been created

@ui @javascript
Scenario: Adding block with sections
Given there are existing sections named "Blog" and "Homepage"
When I go to the create "html" block page
And I fill "Code, Content" fields
And I add "Blog" and "Homepage" sections to it
And I add it
Then I should be notified that the block has been created
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Adding frequently asked question
And the store operates on a single channel in "United States"

@ui
Scenario: Adding new frequently asked question with valid data
Scenario: Adding frequently asked
When I go to the create faq page
And I fill code with "each_order_payment"
And I set the position to 1
Expand All @@ -19,18 +19,15 @@ Feature: Adding frequently asked question
Then I should be notified that a new faq has been created

@ui
Scenario: Adding new frequently asked question with invalid data
Scenario: Adding new frequently asked question with blank data
When I go to the create faq page
And I add it
Then I should be notified that "Code, Position, Question, Answer" can not be blank
Then I should be notified that "Code, Position, Question, Answer" cannot be blank

@ui
Scenario: Adding new frequently asked question with existing position
Given there is an existing faq with 1 position
When I go to the create faq page
And I fill code with "delivery_zones"
And I set the position to 1
And I fill the question with "Do you send packages to Russia?"
And I set the answer to "Yes"
And I add it
And I try to add it
Then I should be notified that there is already an existing faq with selected position
39 changes: 18 additions & 21 deletions features/adding_page.feature → features/admin/adding_page.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,43 @@ Feature: Adding new page
And I am logged in as an administrator

@ui @javascript
Scenario: Adding new page for en_US translation
When I go to the create new page page
Scenario: Adding page
When I go to the create page page
And I fill the code with "top_5_outfits_for_this_summer"
And I fill the name with "Top 5 outfits for this summer"
And I fill the meta keywords with "TOP 5 summer outfit trends, outfits, ralph lauren"
And I fill the meta description with "This summer is going to be hot. Here's what you must wear to look great on vacation."
And I fill the meta keywords with "TOP 5 summer outfit trends, outfits, Ralph Lauren"
And I fill the meta description with "This summer is going to be hot like a pizza."
And I fill the content with "The best looks, trends, inspiration, and shopping picks for summer style."
And I add it
Then I should be notified that new page was created
And this page should have "top_5_outfits_for_this_summer" code
And it should have "Top 5 outfits for this summer" name
And it should have "top-5-outfits-for-this-summer" slug
And it should have "TOP 5 summer outfit trends, outfits, ralph lauren" meta keywords
And it should have "The best looks, trends, inspiration, and shopping picks for summer style." content
Then I should be notified that the page has been created

@ui
Scenario: Adding new page with empty data
When I go to the create new page page
Scenario: Adding new page with blank data
When I go to the create page page
And I add it
And I should be notified that "Code, Name, Slug, Content" fields can not be blank

@ui
Scenario: Trying to add a page with too short data
When I go to the create new page page
When I go to the create page page
And I fill "Code, Name, Slug, Meta keywords, Meta description, Content" with 1 character
And I try to add it
Then I should be notified that the "Code, Name, Slug, Meta keywords, Meta description, Content" fields are too short

@ui
Scenario: Trying to add a new page with too long data
When I go to the create new page page
Scenario: Trying to add a page with too long data
When I go to the create page page
And I fill "Code, Name, Slug, Meta keywords, Meta description" with 6000 characters
And I try to add it
Then I should be notified that "Code, Name, Slug, Meta keywords, Meta description" fields are too long

@todo
Scenario: Adding new page with sections
Given there is are existing sections named "Blog" and "Homepage"
When I go to the create new page page
And I fill "Code, Name, Slug, Meta keywords, Meta description" with 5 characters
@ui @javascript
Scenario: Adding page with sections
Given there are existing sections named "Blog" and "Homepage"
When I go to the create page page
And I fill the code with "best_day_ever"
And I fill the name with "Best day ever"
And I add "Blog" and "Homepage" sections to it
And I fill the content with "This was the best day of my life"
And I add it
Then I should be notified that new page has been created
Then I should be notified that the page has been created
File renamed without changes.
61 changes: 61 additions & 0 deletions features/admin/managing_blocks.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
@managing_blocks
Feature: Managing cms blocks
In order to present dynamic content in my store
As an Administrator
I want to be able to manage existing blocks

Background:
Given the store operates on a single channel in "United States"
Given I am logged in as an administrator

@ui
Scenario: Seeing menu items
Given there is a cms text block with "store_phone_number" code and "123456789" content
When I go to the update "store_phone_number" block page
And I fill the content with "987654321"
And I update it
Then I should be notified that the block has been successfully updated

@ui
Scenario: Updating html block
Given there is a cms html block with "store_email" code and "<a href='mailto:mikolaj.krol@bitbag.pl'>mikolaj.krol@bitbag.pl</a>" content
When I go to the update "store_email" block page
And I fill the content with "<a href='mailto:mikolaj.krol@bitbag.pl'>mikolaj.krol@bitbag.pl</a>"
And I update it
Then I should be notified that the block has been successfully updated

@ui
Scenario: Updating image block
Given there is a cms block with "porsche_911_singer" code and "porsche_911_singer_1.jpg" image
When I go to the update "porsche_911_singer" block page
And I upload the "porsche_911_singer_2.jpg" image
And I update it
Then I should be notified that the block has been successfully updated

@ui
Scenario: Disabling block
Given there is a cms block with "bitbag_quote" code
When I go to the update "bitbag_quote" block page
And I disable it
And I update it
Then I should be notified that the block has been successfully updated

@ui
Scenario: Seeing dynamic blocks in the admin panel
Given there are 2 dynamic content blocks with "image" type
And there are 3 dynamic content blocks with "text" type
When I go to the cms blocks page
Then I should see 2 dynamic content blocks with "image" type
And I should see 3 dynamic content blocks with "text" type

@ui
Scenario: Removing single block
Given there is a dynamic content block with "image" type
When I go to the cms blocks page
And I remove this image block
Then I should be notified that this block was removed

@ui
Scenario: Being able to chose which block type to create
When I go to the cms blocks page
Then I should be able to select between "Text block", "HTML block" and "Image block" block types under Create button
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
@managing_pages
Feature: Updating cms page
In order to manage dynamic images
Feature: Managing cms pages
In order to present custom pages in my online store
As an Administrator
I want to be able to edit existing image pages
I want to be able to display and remove existing pages

Background:
Given the store operates on a single channel in "United States"
And I am logged in as an administrator
And there is a cms page with "How to tie a tie" name
Given I am logged in as an administrator

@ui
Scenario: Removing single page
Given there are 3 pages
When I go to the cms pages page
And I remove last page
Then I should be notified that this page has been removed
And only 2 pages should exist in the store

@ui
Scenario: Updating page
Given there is a cms page with "How to tie a tie" name
And it has "tie a tie, 100 ways to tie a tie" meta keywords
And it has "After reading this tut you will never get stuck while trying to tie a tie." meta description
And it has "Learn how to tie a tie with the Windsor, Half Windsor, Four in Hand and Pratt necktie knots by following step-by-step video." content

@ui
Scenario: Seeing menu items
When I go to the update "how_to_tie_a_tie" page page
And I fill the name with "Top 5 outfits for this summer"
And I fill the slug with "top-5-outfits-for-this-summer"
And I fill the meta keywords with "TOP 5 summer outfit trends, outfits, ralph lauren"
And I fill the meta description with "This summer is going to be hot. Here's what you must wear to look great on vacation."
And I fill the content with "The best looks, trends, inspiration, and shopping picks for summer style."
And I update it
Then I should be notified that the page was updated
And it should have "Top 5 outfits for this summer" name
And it should have "top-5-outfits-for-this-summer" slug
And it should have "TOP 5 summer outfit trends, outfits, ralph lauren" meta keywords
And it should have "The best looks, trends, inspiration, and shopping picks for summer style." content
Then I should be notified that the page was updated
17 changes: 0 additions & 17 deletions features/disabling_block.feature

This file was deleted.

30 changes: 0 additions & 30 deletions features/managing_blocks.feature

This file was deleted.

Loading

0 comments on commit b14c192

Please sign in to comment.