From 74d1f9c00aeefbdfa6bfabff6d31bb61a28279f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Fri, 15 Feb 2019 13:57:10 +0100 Subject: [PATCH] Sketch a cucumber feature for writing a post @appinteractive Cucumber lesson: Write the cucumber feature first, then add step definitions. If you do it the other way round, it will make your cucumber features less readable. --- .../integration/04.AboutMeAndLocation.feature | 4 ---- cypress/integration/06.WritePost.feature | 24 +++++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 cypress/integration/06.WritePost.feature diff --git a/cypress/integration/04.AboutMeAndLocation.feature b/cypress/integration/04.AboutMeAndLocation.feature index 8601f7c80..aedbf62bc 100644 --- a/cypress/integration/04.AboutMeAndLocation.feature +++ b/cypress/integration/04.AboutMeAndLocation.feature @@ -39,7 +39,3 @@ Feature: About me and location And my username is "Peter Lustig" When people visit my profile page Then they can see the text in the info box below my avatar - - - - diff --git a/cypress/integration/06.WritePost.feature b/cypress/integration/06.WritePost.feature new file mode 100644 index 000000000..98f49fb62 --- /dev/null +++ b/cypress/integration/06.WritePost.feature @@ -0,0 +1,24 @@ +Feature: Create a post + As a user + I would like to create a post + To say something to everyone in the community + + Background: + Given I am logged in + Given I am on the "landing" page + + Scenario: Create a post + When I click on the big plus icon in the bottom right corner to create post + And I choose "My first post" as the title of the post + And I type in the following text: + """ + Human Connection is a free and open-source social network + for active citizenship. + """ + And I click on "Save" + Then I get redirected to "/post/my-first-post/" + And the post was saved successfully + + Scenario: See a post on the landing page + Given I previously created a post + Then the post shows up on the landing page