Newer
Older

Rajab Natshah
committed
Feature: Check JSON API admin interface and services and Varbase API settings

Rajab Natshah
committed
As a site admin user
I want to be able to check the JSON:API available interface options
So that I can use them to enable or disable API service for Varbase APIs.
Background:
Given I am a logged in user with the "webmaster" user

Rajab Natshah
committed
@check @local @development @staging @production

Rajab Natshah
committed
Scenario: Check the Varbase API settings in admin configurations page

Rajab Natshah
committed
When I go to "/admin/config"

Rajab Natshah
committed
And I wait

Rajab Natshah
committed
Then I should see "JSON:API"
And I should see "Varbase API settings"

Rajab Natshah
committed
@check @local @development @staging @production

Rajab Natshah
committed
Scenario: Check JSON:API configurations

Rajab Natshah
committed
When I go to "/admin/config/services/jsonapi"

Rajab Natshah
committed
And I wait

Rajab Natshah
committed
Then I should see "JSON:API"
And I should see "Allowed operations"
@check @local @development @staging @production

Rajab Natshah
committed
Scenario: Check JSON:API Extras configurations

Rajab Natshah
committed
When I go to "/admin/config/services/jsonapi/extras"

Rajab Natshah
committed
And I wait

Rajab Natshah
committed
Then I should see "JSON:API Extras"

Rajab Natshah
committed
And I should see "api" value in the "edit-path-prefix" input element

Rajab Natshah
committed

Rajab Natshah
committed
@check @local @development @staging @production

Rajab Natshah
committed
Scenario: Check JSON:API Resource overrides

Rajab Natshah
committed
When I go to "/admin/config/services/jsonapi/resource_types"

Rajab Natshah
committed
And I wait

Rajab Natshah
committed
Then I should see "JSON:API Resource overrides"
And I should see "The following table shows the list of JSON:API resource types available."

Rajab Natshah
committed
@check @local @development @staging @production

Rajab Natshah
committed
Scenario: Check Varbase API settings and Generate keys

Rajab Natshah
committed
When I go to "/admin/config/system/varbase/api"

Rajab Natshah
committed
And I wait

Rajab Natshah
committed
Then I should see "Varbase API settings"
And the "entity_json" checkbox is checked

Rajab Natshah
committed
And the "bundle_docs" checkbox is checked

Rajab Natshah
committed
When I go to "/admin/config/system/varbase/api/keys"

Rajab Natshah
committed
And I wait

Rajab Natshah
committed
Then I should see "Path to the directory in which to store the generated keys."

Rajab Natshah
committed

Rajab Natshah
committed
@check @local @development @staging @production

Rajab Natshah
committed
Scenario: Check Open API settings and documentation pages
When I go to "/admin/config/services/openapi"

Rajab Natshah
committed
And I wait

Rajab Natshah
committed
Then I should see "OpenAPI Resources"
And I should see "Rest"

Rajab Natshah
committed
And I should see "JSON:API"

Rajab Natshah
committed
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
@local @development @staging @production
Scenario: Upload a Media entity test for API
Given I am a logged in user with the "test_site_admin" user
When I go to "/media/add/image"
And I wait
Then I should see "Allowed types: png gif jpg jpeg."
When I attach the file "flag-earth.jpg" to "edit-field-media-image-0-upload"
And I wait
And I press the "Save" button
And I wait
And I fill in "Media entity test" for "field_media_image[0][alt]"
And I fill in "Media entity test" for "field_media_image[0][title]"
And I fill in "Media entity test" for "name[0][value]"
And I press the "Save" button
And I wait
Then I should see "Media entity test"
@local @development @staging @production
Scenario: Add a term "space" tag term for JSON:API to test.
Given I am a logged in user with the "test_site_admin" user
When I go to "/admin/structure/taxonomy/manage/tags/add"
And I wait
Then I should see "Add term"
When I fill in "space" for "Name"
And I press the "Save" button
And I wait
And I go to "/admin/structure/taxonomy/manage/tags/overview"
Then I should see "Tags"
And I should see "space"
@javascript @check @local @development @staging @production
Scenario: Check that Site Admin users can access "View JSON" and "View API Docs" entity operations
Given I am a logged in user with the "test_site_admin" user
When I go to "/admin/content"
And I wait
Then I should see "Content"
And I should see the "View JSON" operation for the "Homepage" content
And I should see the "View API Docs" operation for the "Homepage" content
And I should see the "Edit" operation for the "Homepage" content
And I should see the "Layout" operation for the "Homepage" content
And I should see the "View JSON" operation for the "Blog" content
And I should see the "View API Docs" operation for the "Blog" content
When I go to "/admin/content/media"
And I wait
Then I should see "Media"
And I should see the "View JSON" operation for the "Media entity test" media
And I should see the "View API Docs" operation for the "Media entity test" media
And I should see the "Edit" operation for the "Media entity test" media
When I go to "/admin/structure/taxonomy/manage/tags/overview"
And I wait
Then I should see "Tags"
And I should see "space"
And I should not see the "View JSON" operation for the "space" term
And I should not see the "View API Docs" operation for the "space" term
When I go to "/admin/structure/entityqueue"
And I wait
Then I should see "Entityqueues"
And I should not see the "View JSON" operation for the "Media Hero Slider" entity
And I should not see the "View API Docs" operation for the "Media Hero Slider" entity
But I should not see the "Edit items" operation for the "Media Hero Slider" entity
@javascript @check @local @development @staging @production
Scenario: Check that Content Admin users can not access "View JSON" and "View API Docs" entity operations
Given I am a logged in user with the "test_content_admin" user
When I go to "/admin/content"
And I wait
Then I should see "Content"
And I should not see the "View JSON" operation for the "Homepage" content
And I should not see the "View API Docs" operation for the "Homepage" content
But I should see the "Edit" operation for the "Homepage" content
And I should see the "Layout" operation for the "Homepage" content
When I go to "/admin/content/media"
And I wait
Then I should see "Media"
And I should not see the "View JSON" operation for the "Media entity test" media
And I should not see the "View API Docs" operation for the "Media entity test" media
But I should see the "Edit" operation for the "Media entity test" media
When I go to "/admin/structure/taxonomy/manage/tags/overview"
And I wait
Then I should see "Tags"
And I should see "space"
And I should not see the "View JSON" operation for the "space" term
And I should not see the "View API Docs" operation for the "space" term
When I go to "/admin/structure/entityqueue"
And I wait
Then I should see "Entityqueues"
And I should not see the "View JSON" operation for the "Media Hero Slider" entity
And I should not see the "View API Docs" operation for the "Media Hero Slider" entity
But I should not see the "Edit items" operation for the "Media Hero Slider" entity
@javascript @check @local @development @staging @production
Scenario: Check that Editor users can access "View JSON" and "View API Docs" entity operations
Given I am a logged in user with the "test_editor" user
When I go to "/admin/content"
And I wait
Then I should see "Content"
And I should not see the "View JSON" operation for the "Homepage" content
And I should not see the "View API Docs" operation for the "Homepage" content
But I should see the "Edit" operation for the "Homepage" content
And I should see the "Layout" operation for the "Homepage" content
When I go to "/admin/content/media"
And I wait
Then I should see "Media"
And I should not see the "View JSON" operation for the "Media entity test" media
And I should not see the "View API Docs" operation for the "Media entity test" media
But I should see the "Edit" operation for the "Media entity test" media
When I go to "/admin/structure/taxonomy/manage/tags/overview"
And I wait
Then I should see "Tags"
And I should see "space"
And I should not see the "View JSON" operation for the "space" term
And I should not see the "View API Docs" operation for the "space" term