Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P8716
API CRUD test in Behat
Active
Public
Actions
Authored by
daniel
on Jul 5 2019, 4:55 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F29682540: raw.txt
Jul 5 2019, 4:55 PM
2019-07-05 16:55:52 (UTC+0)
Subscribers
•
Clarakosi
kostajh
Feature: action API
In order to confidently refactor code
as a developer
I want to see if the action API works as expected
Scenario: CRUD
When I send a POST request to "/api.php?action=edit&format=json" with form data:
"""
title=BehatTest
createonly=1
summary=testing
text=some+text
token=%2B%5C
"""
Then response code should be 200
And field "edit/result" in the response should be "Success"
When I send a GET request to "/api.php?action=parse&page=BehatTest&format=json"
Then response code should be 200
And the response should contain "some text"
When I send a POST request to "/api.php?action=edit&format=json" with form data:
"""
title=BehatTest
summary=testing
text=different+text
token=%2B%5C
"""
Then response code should be 200
And field "edit/result" in the response should be "Success"
When I send a GET request to "/api.php?action=parse&page=BehatTest&format=json"
Then response code should be 200
And the response should contain "different text"
When I send a POST request to "/api.php?action=delete&format=json" with form data:
"""
title=BehatTest
token=%2B%5C
"""
Then response code should be 200
And field "edit/result" in the response should be "Success"
Event Timeline
daniel
created this paste.
Jul 5 2019, 4:55 PM
2019-07-05 16:55:52 (UTC+0)
daniel
mentioned this in
T222100: Decide whether creating Phester is actually worth while
.
Jul 5 2019, 5:05 PM
2019-07-05 17:05:42 (UTC+0)
Log In to Comment