Skip to content

Commit 958162d

Browse files
committed
Scenarios from 'codecept generate:scenarios ..'
1 parent 29ce1c5 commit 958162d

File tree

73 files changed

+484
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+484
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
I WANT TO
2+
3+
I am on page '/posts'
4+
I click 'Add new post'
5+
I see current url equals '/posts/create'
6+
I fill field 'title'," 'test'
7+
I fill field 'body'," 'test new post'
8+
I click 'Submit'
9+
I see current url equals '/posts'
10+
I see 'test new post'
11+
I click 'Edit'
12+
I see 'test new post'
13+
I click 'Update'
14+
I click 'Edit'
15+
I fill field 'body'," 'test new post 2'
16+
I click 'Update'
17+
I see 'test new post 2'
18+
I click 'Delete'
19+
I see current url equals '/posts'
20+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
I WANT TO
2+
3+
I am on page '/register'
4+
I see 'Name'
5+
I see 'Confirm Password'
6+
I see 'Register'
7+
I fill field 'name'," 'Ivelin'
8+
I fill field('email', 'ibpavlov'.sq ").'@mailinator.com'
9+
I fill field 'password'," 'qwerty'
10+
I fill field 'password_confirmation'," 'qwerty'
11+
I click 'Register'," 'button'
12+
I see 'Hello world!'
13+
I see 'Logged in'
14+
I see 'Logout'
15+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
I WANT TO CREATE POST
2+
3+
I send post "$this->endpoint"," ['title' => 'Game of Rings'," 'body' => 'By George Tolkien']"
4+
I see response code is "201"
5+
I see response is json ""
6+
I see response contains json "['title' => 'Game of Rings']"
7+
I see record 'posts'," ['id' => $id"," 'title' => 'Game of Rings']"
8+
I send get "$this->endpoint."/$id""
9+
I see response code is "200"
10+
I see response is json ""
11+
I see response contains json "['title' => 'Game of Rings']"
12+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
I WANT TO DELETE POST
2+
3+
I send delete "$this->endpoint."/$id""
4+
I see response code is "200"
5+
I don't see record 'posts'," ['id' => $id]"
6+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
I WANT TO GET ALL POSTS
2+
3+
I send get "$this->endpoint"
4+
I see response code is "200"
5+
I see response is json ""
6+
I expect 'both items are in response'
7+
I see response contains json "['id' => $id"," 'title' => 'Game of Thrones'," 'body' => 'Body']"
8+
I see response contains json "['id' => $id2"," 'title' => 'Lord of the Rings'," 'body' => 'Body']"
9+
I expect 'both items are in root array'
10+
I see response contains json "[['id' => $id]"," ['id' => $id2]]"
11+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
I WANT TO GET SINGLE POST
2+
3+
I send get "$this->endpoint."/$id""
4+
I see response code is "200"
5+
I see response is json ""
6+
I see response contains json "['id' => $id"," 'title' => 'Starwars']"
7+
I expect 'there is no root array in response'
8+
I don't see response contains json "[['id' => $id]]"
9+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
I WANT TO
2+
3+
I see response code is "201"
4+
I see response is json ""
5+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
I WANT TO UPDATE POST
2+
3+
I send put "$this->endpoint."/$id""," ['title' => 'Lord of Thrones']"
4+
I see response code is "200"
5+
I see response is json ""
6+
I see response contains json "['title' => 'Lord of Thrones']"
7+
I see record 'posts'," ['title' => 'Lord of Thrones']"
8+
I don't see record 'posts'," ['title' => 'Game of Thrones']"
9+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
I WANT TO TEST DELETE NOT FOUND | "POSTS"
2+
3+
I send delete('/api/'.$example['endpoint'].'/'.sq ")"
4+
I see response code is "HttpCode::NOT_FOUND"
5+
I see response is json ""
6+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
I WANT TO TEST LIST | "POSTS"
2+
3+
I send get '/api/'.$example['endpoint']"
4+
I see response code is "HttpCode::OK"
5+
I see response is json ""
6+

0 commit comments

Comments
 (0)