@webship.co/workspace-ghost 0.0.0-stage → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +208 -2
- package/ai/agents/ghost-site-builder.md +131 -0
- package/ai/agents/ghost-tester.md +144 -0
- package/ai/commands/ghost-test.md +87 -0
- package/ai/prompts/ghost-build-and-test.md +27 -0
- package/ai/skills/ghost-scenarios/SKILL.md +288 -0
- package/ai/skills/ghost-scenarios/examples/front-end.feature +32 -0
- package/ai/skills/ghost-scenarios/examples/post-lifecycle.feature +24 -0
- package/ai/skills/ghost-scenarios/examples/roles-and-screens.feature +31 -0
- package/commands/cmd-ghost-project.sh +33 -0
- package/commands/cmd-tools-ghost-cli.sh +26 -0
- package/dist/src/index.d.ts +29 -0
- package/dist/src/index.js +50 -0
- package/dist/src/index.js.map +1 -0
- package/docs/plugin-items-pattern.md +145 -0
- package/features/ghost.feature +30 -0
- package/package.json +96 -4
- package/scripts/args/arg-ghost-cli.sh +25 -0
- package/scripts/args/arg-ghost.sh +21 -0
- package/scripts/functions/fun-ghost.sh +464 -0
- package/scripts/ghost-accounts.js +175 -0
- package/testing/site.feature +47 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ghost-scenarios
|
|
3
|
+
description: Write and run webship-js scenarios for a self-hosted Ghost site of the Webship Workspace with the Ghost step pack (`@webship-js/ghost-steps`) — the phrases of the pack by area (the session and the staff roles, the admin screens and lists, the editor and publishing, tags, the settings, the front end, the membership form), the handles of the users registry, and the workspace command that runs them in the site's container. Use when asked to "write a scenario for this Ghost site", "test the editor role", "which step is there for the admin menu", "add a feature for publishing a post", or when a `.feature` file of a Ghost project is being written or fixed.
|
|
4
|
+
argument-hint: '<site> [what to cover]'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# ghost-scenarios
|
|
8
|
+
|
|
9
|
+
Scenarios for a self-hosted Ghost site of a Webship Workspace (`~/workspace`, container-based, DDEV
|
|
10
|
+
by default), written from the steps of [`@webship-js/ghost-steps`](https://github.com/webship/ghost-steps)
|
|
11
|
+
and of [webship-js](https://github.com/webship/webship-js) itself, and run in the site's container
|
|
12
|
+
by the workspace's own command. It comes with the Ghost plugin (`@webship.co/workspace-ghost`),
|
|
13
|
+
like the builder (`cmd-ghost-project.sh`), the Ghost-CLI tool (`cmd-tools-ghost-cli.sh`) and the
|
|
14
|
+
agents `ghost-site-builder` and `ghost-tester`.
|
|
15
|
+
|
|
16
|
+
## Where everything is
|
|
17
|
+
|
|
18
|
+
| What | Where |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| The site | `~/workspace/<folder>/<site>`, at `https://<site>.ddev.site`, the admin at `/ghost` (`<folder>` is a sites folder: `dev`, `test`, `sandboxes`, `demos`) |
|
|
21
|
+
| The suite's configuration | `<site>/cucumber.js`: the step definitions it loads, the users registry (`worldParameters.users`) and the mailbox of the site (`mailUrl`) |
|
|
22
|
+
| The features | `<site>/tests/features/*.feature` (`site.feature` is the first one the setup wrote) |
|
|
23
|
+
| The pack's steps | `<site>/node_modules/@webship-js/ghost-steps/tests/step-definitions/*.steps.js` |
|
|
24
|
+
| webship-js's steps | `<site>/node_modules/webship-js/tests/step-definitions/*.js` |
|
|
25
|
+
| The reports | `<site>/tests/reports/` |
|
|
26
|
+
|
|
27
|
+
## The order of work
|
|
28
|
+
|
|
29
|
+
1. **Make sure the testing stack is there.** From the sites folder:
|
|
30
|
+
```bash
|
|
31
|
+
cd ~/workspace/<folder>
|
|
32
|
+
bash cmd-tools-testing.sh <site>
|
|
33
|
+
```
|
|
34
|
+
It adds webship-js, the step pack, the users registry, the address of the mailbox and
|
|
35
|
+
`tests/features/site.feature`, and makes sure the default staff accounts are on the site. It is
|
|
36
|
+
safe to run again: it adds what is missing and keeps what was changed.
|
|
37
|
+
2. **Read the installed steps before writing a phrase.** They are the source of truth: the pack
|
|
38
|
+
moves, and a phrase from memory is a guess.
|
|
39
|
+
```bash
|
|
40
|
+
cd ~/workspace/<folder>/<site>
|
|
41
|
+
grep -hE "^(Given|When|Then)\(" node_modules/@webship-js/ghost-steps/tests/step-definitions/*.steps.js
|
|
42
|
+
```
|
|
43
|
+
Every step carries a comment block with five examples above it; open the file when a phrase
|
|
44
|
+
is not obvious.
|
|
45
|
+
3. **Look at the screen first** (the Playwright MCP browser, a tab of your own) when the scenario
|
|
46
|
+
is about a screen you have not seen. The admin is a single-page application: what a screen
|
|
47
|
+
shows, and to which role, is only known once it has rendered.
|
|
48
|
+
4. **Write the feature** in `<site>/tests/features/`, from phrases that exist (the lists below).
|
|
49
|
+
5. **Match every step without a browser**, then run the feature, then the suite:
|
|
50
|
+
```bash
|
|
51
|
+
cd ~/workspace/<folder>
|
|
52
|
+
bash cmd-tools-testing.sh <site> --dry-run --path tests/features/<name>.feature
|
|
53
|
+
bash cmd-tools-testing.sh <site> --run --path tests/features/<name>.feature
|
|
54
|
+
bash cmd-tools-testing.sh <site> --run --tags "@critical"
|
|
55
|
+
bash cmd-tools-testing.sh <site> --run
|
|
56
|
+
```
|
|
57
|
+
A dry run says `Undefined` for a phrase no definition matches: fix the phrase, do not write a
|
|
58
|
+
step for it.
|
|
59
|
+
|
|
60
|
+
## Accounts: a handle, never a password
|
|
61
|
+
|
|
62
|
+
A scenario signs in by a handle of the users registry. The default staff accounts are on the site
|
|
63
|
+
already (`bash cmd-tools-ghost-cli.sh <site> --add-users` adds them again if they were removed):
|
|
64
|
+
|
|
65
|
+
| Handle | Account | Role |
|
|
66
|
+
| --- | --- | --- |
|
|
67
|
+
| `administrator` | `administrator@example.com` | Administrator |
|
|
68
|
+
| `editor` | `editor@example.com` | Editor |
|
|
69
|
+
| `author` | `author@example.com` | Author |
|
|
70
|
+
| `contributor` | `contributor@example.com` | Contributor |
|
|
71
|
+
|
|
72
|
+
```gherkin
|
|
73
|
+
Given I am logged in to the admin as "editor"
|
|
74
|
+
Then I should be logged in to the admin as "editor"
|
|
75
|
+
And the user menu should show "editor@example.com"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The pack's own features also sign in as `owner`. Here the owner of the site is the workspace
|
|
79
|
+
account, which is not in the registry: write the scenario for `administrator`.
|
|
80
|
+
|
|
81
|
+
## The phrases, by area
|
|
82
|
+
|
|
83
|
+
Each line is a phrase the pack defines, and each one passed on a site built with
|
|
84
|
+
`bash cmd-ghost-project.sh <site> --install --add-users` (the names in quotes are that site's: its
|
|
85
|
+
first post, its first page, its tag). Most `should` steps also take the negative: `should not
|
|
86
|
+
see`, `should not be`, `should not offer`.
|
|
87
|
+
|
|
88
|
+
### The session
|
|
89
|
+
|
|
90
|
+
```gherkin
|
|
91
|
+
Given I am an anonymous user
|
|
92
|
+
Given I am logged in to the admin as "editor"
|
|
93
|
+
When I log out of the admin
|
|
94
|
+
Then I should be logged in to the admin as "editor"
|
|
95
|
+
Then I should not be logged in to the admin
|
|
96
|
+
Then the user menu should show "editor@example.com"
|
|
97
|
+
When I try to log in to the admin with the email "editor@example.com" and the password "not-the-password"
|
|
98
|
+
Then I should see the sign in error "Your password is incorrect."
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Admin screens, by the name on the menu
|
|
102
|
+
|
|
103
|
+
```gherkin
|
|
104
|
+
When I go to the admin screen "Posts"
|
|
105
|
+
Then I should be on the admin screen "Posts"
|
|
106
|
+
Then the admin screen "Settings" should not be available
|
|
107
|
+
Then I should be on the admin screen "sign in"
|
|
108
|
+
Then I should see "Tags" in the admin menu
|
|
109
|
+
Then I should not see "Members" in the admin menu
|
|
110
|
+
When I click "Pages" in the admin menu
|
|
111
|
+
When I search the admin for "Coming soon"
|
|
112
|
+
Then I should see the admin search result "Coming soon"
|
|
113
|
+
When I open the admin search result "Coming soon"
|
|
114
|
+
Then I should see the notification "Post reverted to a draft."
|
|
115
|
+
Then I should see the dialog "Invite a new staff user"
|
|
116
|
+
When I answer the dialog with "Close"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The screens that have a name: `Analytics`, `Posts`, `Drafts`, `Scheduled`, `Published`, `Pages`,
|
|
120
|
+
`Tags`, `New tag`, `Members`, `New member`, `Comments`, `Settings`, `Staff`, `New post`,
|
|
121
|
+
`New page`, `sign in`.
|
|
122
|
+
|
|
123
|
+
### The lists, the tags and the staff
|
|
124
|
+
|
|
125
|
+
```gherkin
|
|
126
|
+
Then I should see the page "About this site" in the list
|
|
127
|
+
Then the page "About this site" should have the status "Published" in the list
|
|
128
|
+
Then I should not see the post "A post from the suite" in the list
|
|
129
|
+
Then I should see the tag "News" in the list
|
|
130
|
+
Then the tag "News" should have 1 post
|
|
131
|
+
When I set the tag name to "A tag from the suite"
|
|
132
|
+
Then the tag slug should be "a-tag-from-the-suite"
|
|
133
|
+
When I set the tag description to "Made by the suite."
|
|
134
|
+
When I save the tag
|
|
135
|
+
When I open the tag "A tag from the suite" from the list
|
|
136
|
+
When I delete the tag
|
|
137
|
+
Then I should see the staff user "editor" with the role "Editor"
|
|
138
|
+
When I open the staff user "author"
|
|
139
|
+
Then the staff user email should be "author@example.com"
|
|
140
|
+
Then the staff user role should be "Author"
|
|
141
|
+
When I close the staff user
|
|
142
|
+
Then the staff invitation should offer the role "Contributor"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
A tag is made on the screen `New tag`. The staff steps open the Staff settings themselves, and
|
|
146
|
+
`the staff invitation should offer the role` opens the invitation dialog and sends nothing: close
|
|
147
|
+
it with `When I answer the dialog with "Close"`.
|
|
148
|
+
|
|
149
|
+
### The editor and publishing
|
|
150
|
+
|
|
151
|
+
```gherkin
|
|
152
|
+
Given there is no post titled "A post from the suite"
|
|
153
|
+
When I start a new post
|
|
154
|
+
When I set the editor title to "A post from the suite"
|
|
155
|
+
When I write "Published by the suite." in the editor
|
|
156
|
+
When I wait for the editor to save
|
|
157
|
+
When I add the tag "News" to the post
|
|
158
|
+
Then the post should have the tag "News"
|
|
159
|
+
When I set the excerpt to "An excerpt."
|
|
160
|
+
Then the excerpt should be "An excerpt."
|
|
161
|
+
Then the post URL should be "a-post-from-the-suite"
|
|
162
|
+
When I preview the post
|
|
163
|
+
Then the preview should show "Published by the suite."
|
|
164
|
+
When I close the preview
|
|
165
|
+
When I open the publish dialog
|
|
166
|
+
Then the publish dialog should say "Ready, set, publish."
|
|
167
|
+
When I publish the post
|
|
168
|
+
Then the publish confirmation should say "A post from the suite"
|
|
169
|
+
When I close the publish confirmation
|
|
170
|
+
When I open the editor of the post "A post from the suite"
|
|
171
|
+
Then the editor title should be "Coming soon"
|
|
172
|
+
Then the editor status should be "Published"
|
|
173
|
+
Then the editor should offer "Update"
|
|
174
|
+
Then the post settings should offer "Excerpt"
|
|
175
|
+
When I unpublish the post
|
|
176
|
+
When I delete the post from the editor
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
`post` and `page` are interchangeable in every one of these. A contributor writes drafts and has
|
|
180
|
+
no Publish button:
|
|
181
|
+
|
|
182
|
+
```gherkin
|
|
183
|
+
Then the editor status should be "Draft"
|
|
184
|
+
Then the editor should not offer "Publish"
|
|
185
|
+
Then the editor should offer "Preview"
|
|
186
|
+
Then the post settings should not offer "Tags"
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### The settings
|
|
190
|
+
|
|
191
|
+
```gherkin
|
|
192
|
+
When I go to the settings section "Title & description"
|
|
193
|
+
Then the settings section "Title & description" should show "dev mysite"
|
|
194
|
+
When I open the navigation settings
|
|
195
|
+
Then the navigation settings should list the link "Home"
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### The front end
|
|
199
|
+
|
|
200
|
+
```gherkin
|
|
201
|
+
When I go to the homepage
|
|
202
|
+
Then the page should be the home page
|
|
203
|
+
Then the page should be a post
|
|
204
|
+
Then the page should be a page
|
|
205
|
+
Then the page should be the tag archive of "news"
|
|
206
|
+
Then the page generator should start with "Ghost 6"
|
|
207
|
+
Then I should see the post "Coming soon" in the post feed
|
|
208
|
+
Then the post feed should have 1 post
|
|
209
|
+
Then I should see "About" in the site navigation
|
|
210
|
+
Then the archive should be on page 1
|
|
211
|
+
Then the archive should not have a next page
|
|
212
|
+
Then the post should not be restricted to members
|
|
213
|
+
Then I should see a subscribe button
|
|
214
|
+
When I open the site search
|
|
215
|
+
When I search the site for "Coming"
|
|
216
|
+
Then I should see the site search result "Coming soon"
|
|
217
|
+
When I close the site search
|
|
218
|
+
When I open the membership sign up form
|
|
219
|
+
Then the membership form should show "Sign up"
|
|
220
|
+
When I close the membership form
|
|
221
|
+
Then I should not be signed in as a member
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
`I am an anonymous user`, `I go to the homepage`, `I go to "/about/"`, `I should see "<text>"`,
|
|
225
|
+
`I press the key "Escape"` and `the response status code should be 200` are webship-js's own
|
|
226
|
+
steps; its status codes, classes, landmarks and accessibility audits are used as they are and
|
|
227
|
+
never redefined for this platform.
|
|
228
|
+
|
|
229
|
+
## Traps found on a real site
|
|
230
|
+
|
|
231
|
+
- `the user menu should show "…"` opens the user menu and leaves it open, and
|
|
232
|
+
`When I log out of the admin` then cannot click it. Close it first:
|
|
233
|
+
```gherkin
|
|
234
|
+
Then the user menu should show "editor@example.com"
|
|
235
|
+
When I press the key "Escape"
|
|
236
|
+
And I log out of the admin
|
|
237
|
+
```
|
|
238
|
+
- An Editor has `Settings` in the admin menu and has no `Members`: the menu of an Editor is
|
|
239
|
+
`Posts` (with `Drafts`, `Scheduled`, `Published`), `Pages`, `Tags`, `Settings` and `Help`.
|
|
240
|
+
Assert the menu of a role from what the screen showed, not from what the role's name suggests.
|
|
241
|
+
- A site as built has one post (`Coming soon`), one page (`About this site`, at `/about/`), one
|
|
242
|
+
tag (`News`) and the navigation `Home` and `About`. The pack's own features
|
|
243
|
+
(`node_modules/@webship-js/ghost-steps/tests/features/`) are written for the pack's seeded test
|
|
244
|
+
site (`Travel diary 8`, the tag `Guides`): copy the shape, replace every title.
|
|
245
|
+
- A site title is `<folder> <site>` after a build (`dev mysite`), until somebody changes it.
|
|
246
|
+
- A scenario that failed half way leaves its post behind. Open it with
|
|
247
|
+
`Given there is no post titled "<title>"` (and `there is no tag named "<name>"`), so the next
|
|
248
|
+
run starts clean.
|
|
249
|
+
|
|
250
|
+
## Rules
|
|
251
|
+
|
|
252
|
+
- **No staff account is created in a suite.** No invitation that is sent, no call to the Admin API
|
|
253
|
+
in a hook that adds a user. A role the registry does not have is asked for, not made. A member
|
|
254
|
+
is content, not staff: a membership scenario may create one, and removes it again
|
|
255
|
+
(`Given there is no member with the email "<address>"`).
|
|
256
|
+
- **Never the workspace account.** The owner of the site is not in the registry.
|
|
257
|
+
- **No password in a feature file**, except where a wrong password is the subject.
|
|
258
|
+
- **No platform name in a step phrase**: `I am logged in to the admin as "editor"`, never a phrase
|
|
259
|
+
that names the product. The same holds for a custom step.
|
|
260
|
+
- **No selector and no route when a step says it**: `the admin screen "Staff"`, not the route of
|
|
261
|
+
the screen.
|
|
262
|
+
- **What a scenario creates, it removes** in the same scenario, under a title nobody else uses.
|
|
263
|
+
- **Nothing is e-mailed outside and nothing is paid for.** The mail of the site goes to the
|
|
264
|
+
mailbox of the container; no hosted service and no payment provider is connected.
|
|
265
|
+
- **A custom step is the last resort**: look in the pack and in webship-js first, write it in
|
|
266
|
+
`<site>/tests/step-definitions/` with a comment block and examples, and say it may belong in
|
|
267
|
+
the pack.
|
|
268
|
+
- **Everything runs in the container**, through `cmd-tools-testing.sh`. Never `npx cucumber-js`
|
|
269
|
+
or `npx playwright` on the host.
|
|
270
|
+
- **A failing scenario is a result.** No `@wip`, no longer timeout, no looser assertion to turn a
|
|
271
|
+
run green: say what the site did.
|
|
272
|
+
|
|
273
|
+
## Examples that run
|
|
274
|
+
|
|
275
|
+
`examples/` holds three features that pass on a site built with
|
|
276
|
+
`bash cmd-ghost-project.sh <site> --install --add-users`. Copy one into the suite and run it:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
cp ~/workspace/ai-skills/ghost-scenarios/examples/roles-and-screens.feature ~/workspace/<folder>/<site>/tests/features/
|
|
280
|
+
cd ~/workspace/<folder>
|
|
281
|
+
bash cmd-tools-testing.sh <site> --run --path tests/features/roles-and-screens.feature
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
| Feature | What it shows |
|
|
285
|
+
| --- | --- |
|
|
286
|
+
| `examples/roles-and-screens.feature` | Each staff role reaching, or being refused, an admin screen; the admin menu of a role; the staff list |
|
|
287
|
+
| `examples/post-lifecycle.feature` | An editor writing, publishing, viewing, unpublishing and deleting a post: content a scenario creates and removes |
|
|
288
|
+
| `examples/front-end.feature` | A visitor on the home page, a page, a tag archive and the search of the site, with no session |
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Feature: A visitor reads the site
|
|
2
|
+
As the owner of the site
|
|
3
|
+
I want the home page, the first post, the first page and the tag archive to be served
|
|
4
|
+
So that a theme or a setting that breaks the front end is caught by the suite
|
|
5
|
+
|
|
6
|
+
# The titles are the ones a site has right after it is built: change them to the content of the site.
|
|
7
|
+
|
|
8
|
+
Scenario: The home page lists the posts and the navigation
|
|
9
|
+
Given I am an anonymous user
|
|
10
|
+
When I go to the homepage
|
|
11
|
+
Then the page should be the home page
|
|
12
|
+
And I should see the post "Coming soon" in the post feed
|
|
13
|
+
And I should see "Home" in the site navigation
|
|
14
|
+
And I should see "About" in the site navigation
|
|
15
|
+
And I should see a subscribe button
|
|
16
|
+
And the archive should be on page 1
|
|
17
|
+
|
|
18
|
+
Scenario: A page and a tag archive have their own kind of page
|
|
19
|
+
Given I am an anonymous user
|
|
20
|
+
When I go to "/about/"
|
|
21
|
+
Then the page should be a page
|
|
22
|
+
And the page should not be a post
|
|
23
|
+
When I go to "/tag/news/"
|
|
24
|
+
Then the page should be the tag archive of "news"
|
|
25
|
+
And I should see the post "Coming soon" in the post feed
|
|
26
|
+
|
|
27
|
+
Scenario: The search of the site finds a post
|
|
28
|
+
Given I am an anonymous user
|
|
29
|
+
When I go to the homepage
|
|
30
|
+
And I open the site search
|
|
31
|
+
And I search the site for "Coming"
|
|
32
|
+
Then I should see the site search result "Coming soon"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Feature: An editor writes a post and removes it again
|
|
2
|
+
As an editor
|
|
3
|
+
I want to write, publish, unpublish and delete a post
|
|
4
|
+
So that the suite proves the editor works and leaves the site as it found it
|
|
5
|
+
|
|
6
|
+
Scenario: The editor publishes a post, sees it on the site and deletes it
|
|
7
|
+
Given I am logged in to the admin as "editor"
|
|
8
|
+
And there is no post titled "A post written by a scenario"
|
|
9
|
+
When I start a new post
|
|
10
|
+
And I set the editor title to "A post written by a scenario"
|
|
11
|
+
And I write "This post is written and removed by the suite." in the editor
|
|
12
|
+
And I publish the post
|
|
13
|
+
Then the publish confirmation should say "A post written by a scenario"
|
|
14
|
+
When I close the publish confirmation
|
|
15
|
+
Then the post "A post written by a scenario" should have the status "Published" in the list
|
|
16
|
+
When I go to "/a-post-written-by-a-scenario/"
|
|
17
|
+
Then the response status code should be 200
|
|
18
|
+
And the page should be a post
|
|
19
|
+
And I should see "This post is written and removed by the suite."
|
|
20
|
+
When I open the editor of the post "A post written by a scenario"
|
|
21
|
+
And I unpublish the post
|
|
22
|
+
Then the editor status should be "Draft"
|
|
23
|
+
When I delete the post from the editor
|
|
24
|
+
Then I should not see the post "A post written by a scenario" in the list
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Feature: Each staff role reaches the screens it may use
|
|
2
|
+
As the owner of the site
|
|
3
|
+
I want every staff role to open its own screens and to be refused the others
|
|
4
|
+
So that a change of what a role may do is caught by the suite
|
|
5
|
+
|
|
6
|
+
# The accounts are the default ones; a scenario signs in by a handle of the users registry.
|
|
7
|
+
|
|
8
|
+
Scenario: An editor opens the posts and the tags, and has no Members screen
|
|
9
|
+
Given I am logged in to the admin as "editor"
|
|
10
|
+
When I go to the admin screen "Posts"
|
|
11
|
+
Then I should be on the admin screen "Posts"
|
|
12
|
+
And I should see "Tags" in the admin menu
|
|
13
|
+
And I should not see "Members" in the admin menu
|
|
14
|
+
And the admin screen "Members" should not be available
|
|
15
|
+
|
|
16
|
+
Scenario: An author has the posts and nothing that manages the site
|
|
17
|
+
Given I am logged in to the admin as "author"
|
|
18
|
+
Then I should see "Posts" in the admin menu
|
|
19
|
+
And I should not see "Tags" in the admin menu
|
|
20
|
+
And the admin screen "Tags" should not be available
|
|
21
|
+
And the admin screen "Staff" should not be available
|
|
22
|
+
|
|
23
|
+
Scenario: A contributor is refused the settings
|
|
24
|
+
Given I am logged in to the admin as "contributor"
|
|
25
|
+
Then the admin screen "Settings" should not be available
|
|
26
|
+
|
|
27
|
+
Scenario: An administrator sees each staff account with its role
|
|
28
|
+
Given I am logged in to the admin as "administrator"
|
|
29
|
+
Then I should see the staff user "editor" with the role "Editor"
|
|
30
|
+
And I should see the staff user "author" with the role "Author"
|
|
31
|
+
And I should see the staff user "contributor" with the role "Contributor"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# workspace-name: Ghost (latest)
|
|
4
|
+
|
|
5
|
+
# Installed by the Ghost plugin (plugins.sh --install ghost); __WORKSPACE__ is the workspace it was installed into.
|
|
6
|
+
#
|
|
7
|
+
# Build a self-hosted Ghost site in a container: the latest release, or the one --version names, at
|
|
8
|
+
# https://<name>.ddev.site. With --install the site is set up with the workspace account as its
|
|
9
|
+
# owner; with --add-users it also gets the default staff accounts, one per role.
|
|
10
|
+
|
|
11
|
+
# Bootstrap.
|
|
12
|
+
# Find the workspace tooling from this script, so a fresh clone needs no setup.
|
|
13
|
+
WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
|
|
14
|
+
source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
|
|
15
|
+
|
|
16
|
+
# Load workspace settings.
|
|
17
|
+
eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.__WORKSPACE__.settings.yml);
|
|
18
|
+
|
|
19
|
+
# Set site version.
|
|
20
|
+
site_version="latest";
|
|
21
|
+
|
|
22
|
+
# Distribution.
|
|
23
|
+
distribution_name="ghost";
|
|
24
|
+
distribution_title="Ghost";
|
|
25
|
+
distribution_webroot="";
|
|
26
|
+
|
|
27
|
+
ARGPARSE_DESCRIPTION="Build a ${distribution_title} project in __WORKSPACE__"
|
|
28
|
+
# The args file comes with the plugin: core/scripts/plugins/ghost/ is where plugins.sh --install puts it.
|
|
29
|
+
source ${WORKSPACE_SCRIPTS}/plugins/ghost/args/arg-ghost.sh || exit 1 ;
|
|
30
|
+
|
|
31
|
+
shift $#;
|
|
32
|
+
|
|
33
|
+
ghost_build ;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Installed by the Ghost plugin (plugins.sh --install ghost); __WORKSPACE__ is the workspace it was installed into.
|
|
4
|
+
#
|
|
5
|
+
# Ghost-CLI for one Ghost project of this workspace, in its container: say what the site is,
|
|
6
|
+
# run a Ghost-CLI command, update Ghost, restart it, add or remove the default staff accounts.
|
|
7
|
+
# Nothing here runs on the host.
|
|
8
|
+
|
|
9
|
+
# Bootstrap.
|
|
10
|
+
# Find the workspace tooling from this script, so a fresh clone needs no setup.
|
|
11
|
+
WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
|
|
12
|
+
source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
|
|
13
|
+
|
|
14
|
+
# Load workspace settings.
|
|
15
|
+
eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.__WORKSPACE__.settings.yml);
|
|
16
|
+
|
|
17
|
+
# Distribution.
|
|
18
|
+
distribution_name="ghost";
|
|
19
|
+
|
|
20
|
+
ARGPARSE_DESCRIPTION="Run Ghost-CLI on a Ghost project of __WORKSPACE__: status, a command, an update, a restart, the default accounts"
|
|
21
|
+
# The args file comes with the plugin: core/scripts/plugins/ghost/ is where plugins.sh --install puts it.
|
|
22
|
+
source ${WORKSPACE_SCRIPTS}/plugins/ghost/args/arg-ghost-cli.sh || exit 1 ;
|
|
23
|
+
|
|
24
|
+
shift $#;
|
|
25
|
+
|
|
26
|
+
ghost_cli_tool ;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ghost for Webship Workspace: a platform plugin.
|
|
3
|
+
*
|
|
4
|
+
* What the package carries is placed by the installer from the manifest: the builder and the
|
|
5
|
+
* Ghost-CLI tool in the sites folders, their functions, argparse and the accounts script under
|
|
6
|
+
* core/scripts/plugins/ghost/, its AI items (ai/) in the AI folders. The dashboard needs nothing
|
|
7
|
+
* drawn for it: the builder is in the Build list because it is a cmd-*-project.sh, the row menus
|
|
8
|
+
* are the core's, the AI items are listed like any other. What register() adds is what the
|
|
9
|
+
* assistant is told.
|
|
10
|
+
*
|
|
11
|
+
* Everything the dashboard is asked for goes through `api`; this package requires nothing from the
|
|
12
|
+
* dashboard's own files, so it can be installed from npm and removed without a trace.
|
|
13
|
+
*/
|
|
14
|
+
import type { PluginApi } from '@webship.co/workspace-plugin-api';
|
|
15
|
+
/** The plugin's name, which its functions are named after. */
|
|
16
|
+
export declare const PLATFORM = "ghost";
|
|
17
|
+
/** The commands the installer places in every sites folder. */
|
|
18
|
+
export declare const COMMANDS: string[];
|
|
19
|
+
/** The agents the installer places in the AI Agents folder. */
|
|
20
|
+
export declare const AGENTS: string[];
|
|
21
|
+
/** The skill the installer places in the AI Skills folder (a folder each, with its SKILL.md). */
|
|
22
|
+
export declare const SKILLS: string[];
|
|
23
|
+
/** The slash command the installer places in the AI Commands folder. */
|
|
24
|
+
export declare const AI_COMMANDS: string[];
|
|
25
|
+
/** The prompt the installer places in the AI Prompts folder: a whole launch command for a new session. */
|
|
26
|
+
export declare const PROMPTS: string[];
|
|
27
|
+
/** What the assistant is told about Ghost in this workspace. */
|
|
28
|
+
export declare function assistantContext(): string;
|
|
29
|
+
export declare function register(api: PluginApi): void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Ghost for Webship Workspace: a platform plugin.
|
|
4
|
+
*
|
|
5
|
+
* What the package carries is placed by the installer from the manifest: the builder and the
|
|
6
|
+
* Ghost-CLI tool in the sites folders, their functions, argparse and the accounts script under
|
|
7
|
+
* core/scripts/plugins/ghost/, its AI items (ai/) in the AI folders. The dashboard needs nothing
|
|
8
|
+
* drawn for it: the builder is in the Build list because it is a cmd-*-project.sh, the row menus
|
|
9
|
+
* are the core's, the AI items are listed like any other. What register() adds is what the
|
|
10
|
+
* assistant is told.
|
|
11
|
+
*
|
|
12
|
+
* Everything the dashboard is asked for goes through `api`; this package requires nothing from the
|
|
13
|
+
* dashboard's own files, so it can be installed from npm and removed without a trace.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.PROMPTS = exports.AI_COMMANDS = exports.SKILLS = exports.AGENTS = exports.COMMANDS = exports.PLATFORM = void 0;
|
|
17
|
+
exports.assistantContext = assistantContext;
|
|
18
|
+
exports.register = register;
|
|
19
|
+
/** The plugin's name, which its functions are named after. */
|
|
20
|
+
exports.PLATFORM = 'ghost';
|
|
21
|
+
/** The commands the installer places in every sites folder. */
|
|
22
|
+
exports.COMMANDS = ['cmd-ghost-project.sh', 'cmd-tools-ghost-cli.sh'];
|
|
23
|
+
/** The agents the installer places in the AI Agents folder. */
|
|
24
|
+
exports.AGENTS = ['ghost-site-builder', 'ghost-tester'];
|
|
25
|
+
/** The skill the installer places in the AI Skills folder (a folder each, with its SKILL.md). */
|
|
26
|
+
exports.SKILLS = ['ghost-scenarios'];
|
|
27
|
+
/** The slash command the installer places in the AI Commands folder. */
|
|
28
|
+
exports.AI_COMMANDS = ['ghost-test'];
|
|
29
|
+
/** The prompt the installer places in the AI Prompts folder: a whole launch command for a new session. */
|
|
30
|
+
exports.PROMPTS = ['ghost-build-and-test'];
|
|
31
|
+
/** What the assistant is told about Ghost in this workspace. */
|
|
32
|
+
function assistantContext() {
|
|
33
|
+
return [
|
|
34
|
+
'Ghost (a plugin, @webship.co/workspace-ghost): a self-hosted Ghost site is built with',
|
|
35
|
+
'`bash cmd-ghost-project.sh <name> --install --add-users` from a sites folder (dev, test, sandboxes, demos),',
|
|
36
|
+
'in a container like every other project, at https://<name>.ddev.site (the admin at /ghost).',
|
|
37
|
+
'`bash cmd-tools-ghost-cli.sh <name>` says what the site is; `--run "<ghost-cli command>"` runs Ghost-CLI in it,',
|
|
38
|
+
'`--update` updates Ghost, `--restart` starts it again, `--add-users` adds the default staff accounts (one per role).',
|
|
39
|
+
'`bash cmd-tools-testing.sh <name>` sets up webship-js with the Ghost step pack; `--run` runs the suite.',
|
|
40
|
+
`For Ghost work, hand over to the agents ${exports.AGENTS.map((a) => `\`${a}\``).join(' and ')}.`,
|
|
41
|
+
`The plugin also places the skill ${exports.SKILLS.map((a) => `\`${a}\``).join(', ')} (the step pack's phrases, by area) in ai-skills/,`,
|
|
42
|
+
`the command ${exports.AI_COMMANDS.map((a) => `\`/${a} <site>\``).join(', ')} in ai-commands/ and the prompt ${exports.PROMPTS.map((a) => `\`${a}\``).join(' and ')} in ai-prompts/.`,
|
|
43
|
+
'Never run ghost, node, npm or mysql on the host for a project; the owner of a site is the workspace account,',
|
|
44
|
+
'and no hosted service or payment provider is connected.',
|
|
45
|
+
].join(' ');
|
|
46
|
+
}
|
|
47
|
+
function register(api) {
|
|
48
|
+
api.addAssistantContext(assistantContext);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAuBH,4CAcC;AAED,4BAEC;AArCD,8DAA8D;AACjD,QAAA,QAAQ,GAAG,OAAO,CAAC;AAEhC,+DAA+D;AAClD,QAAA,QAAQ,GAAG,CAAC,sBAAsB,EAAE,wBAAwB,CAAC,CAAC;AAE3E,+DAA+D;AAClD,QAAA,MAAM,GAAG,CAAC,oBAAoB,EAAE,cAAc,CAAC,CAAC;AAE7D,iGAAiG;AACpF,QAAA,MAAM,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAE1C,wEAAwE;AAC3D,QAAA,WAAW,GAAG,CAAC,YAAY,CAAC,CAAC;AAE1C,0GAA0G;AAC7F,QAAA,OAAO,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAEhD,gEAAgE;AAChE,SAAgB,gBAAgB;IAC9B,OAAO;QACL,uFAAuF;QACvF,6GAA6G;QAC7G,6FAA6F;QAC7F,iHAAiH;QACjH,sHAAsH;QACtH,yGAAyG;QACzG,2CAA2C,cAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG;QACzF,oCAAoC,cAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,oDAAoD;QAChI,eAAe,mBAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,mCAAmC,eAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB;QACrK,8GAA8G;QAC9G,yDAAyD;KAC1D,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC;AAED,SAAgB,QAAQ,CAAC,GAAc;IACrC,GAAG,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;AAC5C,CAAC"}
|