@webship-js/espocrm-steps 0.0.0-stage → 2.0.0
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/LICENSE +21 -0
- package/README.md +265 -2
- package/package.json +62 -4
- package/tests/features/cases.feature +48 -0
- package/tests/features/lists.feature +31 -0
- package/tests/features/permissions.feature +28 -0
- package/tests/features/session.feature +22 -0
- package/tests/step-definitions/espocrm-cases.steps.js +434 -0
- package/tests/step-definitions/espocrm-helpers.js +377 -0
- package/tests/step-definitions/espocrm-lists.steps.js +118 -0
- package/tests/step-definitions/espocrm-session.steps.js +161 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Webship.co
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,266 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center"><img src="https://raw.githubusercontent.com/webship/espocrm-steps/2.0.x/assets/logo.png" alt="EspoCRM logo" width="240"></p>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# espocrm-steps
|
|
4
|
+
|
|
5
|
+
[](https://github.com/webship/espocrm-steps/actions/workflows/test.yml)
|
|
6
|
+
|
|
7
|
+
Cucumber step definitions for testing EspoCRM, the open-source CRM, with
|
|
8
|
+
[webship-js](https://webship.co/docs/webship-js/2.0.x), a BDD browser automation harness built on Playwright and
|
|
9
|
+
Cucumber-js. The pack covers the cases of a CRM:
|
|
10
|
+
|
|
11
|
+
- **logging in and out**: a user of the users registry by its handle (EspoCRM logs in with the user name), the login
|
|
12
|
+
form, a refused login, who the session is, logging out;
|
|
13
|
+
- **a new case**: the site's own form (Cases, Create);
|
|
14
|
+
- **one case**: a post on its stream, its status, its assignee and its teams, each through EspoCRM's own fields; and
|
|
15
|
+
what its page shows: its status, its assignee, its teams, its stream's posts and its changes of status;
|
|
16
|
+
- **the case list**: all the cases, the open ones, the closed ones, and the search;
|
|
17
|
+
- **what a user may not see or do**: a case of a team the user is not in ("You don't have access to this area."), and a
|
|
18
|
+
case a user whose role only reads cases may not change.
|
|
19
|
+
|
|
20
|
+
The steps make and remove their test content through EspoCRM's own REST API, as the managing user (an administrator of
|
|
21
|
+
the site): a case made in a team, removed after the scenario. The steps also find the cases they name that way. The
|
|
22
|
+
Webship Workspace's `cmd-tools-espocrm-cli.sh <site> --tidy`, or the build script's `TIDY_ONLY=1`, removes what a
|
|
23
|
+
stopped run left, for good.
|
|
24
|
+
|
|
25
|
+
No step phrase names the platform: a scenario reads `When I post "…" on the case` and
|
|
26
|
+
`Then I should be refused the case "…"`.
|
|
27
|
+
|
|
28
|
+
CI builds a real EspoCRM site with [DDEV](https://ddev.com) on the runner (EspoCRM 10.1.5 from its release archive,
|
|
29
|
+
checked against a pinned sha256, installed by EspoCRM's own installer, on Apache, PHP 8.3 and MariaDB 11.4, with the
|
|
30
|
+
teams, roles and users of the suite and the sample cases). It runs the whole suite against it twice on every push and
|
|
31
|
+
pull request, removes what each run left and checks the site then holds what it held before, then runs the assertions
|
|
32
|
+
that must fail; see [The test site](#the-test-site) and [`.github/workflows/test.yml`](.github/workflows/test.yml).
|
|
33
|
+
|
|
34
|
+
## Logging in first
|
|
35
|
+
|
|
36
|
+
Every scenario starts by logging in, so these are the steps to know first:
|
|
37
|
+
|
|
38
|
+
| Step | What it does |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `Given I am a logged in user with the "developer" user` | Logs in as an account of the users registry, by its handle, through the login form unless the session already is that account's |
|
|
41
|
+
| `When I log in with the "developer" user` | Fills and submits the login form with the account's user name and password, and asserts nothing: for scenarios about the login itself |
|
|
42
|
+
| `When I log in as "developer" with the password "wrong"` | The login form, with a user name and a password as typed |
|
|
43
|
+
| `Given I am not logged in` | The browser forgets its session |
|
|
44
|
+
| `When I log out` | Logs out through the menu's "Log Out", and waits until the session is a visitor's |
|
|
45
|
+
| `Then I should be logged in as "Developer Test"` | The session is the account's: its full name, or a handle |
|
|
46
|
+
| `Then I should not be logged in` | The session is a visitor's |
|
|
47
|
+
| `Then the login should be refused with "Wrong username/password"` | The login was refused with that message |
|
|
48
|
+
|
|
49
|
+
```gherkin
|
|
50
|
+
Scenario: A user logs in through the form and out again
|
|
51
|
+
Given I am not logged in
|
|
52
|
+
When I log in with the "developer" user
|
|
53
|
+
Then I should be logged in as "Developer Test"
|
|
54
|
+
When I log out
|
|
55
|
+
Then I should not be logged in
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## From nothing to a green run
|
|
59
|
+
|
|
60
|
+
What the machine needs: Docker, [DDEV](https://ddev.com), curl, python3, and Node.js 24 or later with npm. EspoCRM and
|
|
61
|
+
its database run in DDEV's containers.
|
|
62
|
+
|
|
63
|
+
**1. The site.** The pack's own build script (the one CI runs) makes the site in a DDEV project: EspoCRM 10.1.5 from its
|
|
64
|
+
release archive (sha256 `51e07fbe89d1…`), EspoCRM's own installer, the teams Support and Sales, the roles "Case agent"
|
|
65
|
+
and "Case viewer", the four accounts of [Test users](#test-users) and the sample cases (see
|
|
66
|
+
[The test site](#the-test-site)).
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
git clone https://github.com/webship/espocrm-steps.git
|
|
70
|
+
SITE_DIR="$PWD/espocrm-site" espocrm-steps/.github/scripts/build-ddev-site.sh
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The site answers at `https://espocrmsteps.ddev.site`. In the [Webship Workspace](https://github.com/webship/workspace)
|
|
74
|
+
(container-based, DDEV by default), its EspoCRM plugin builds the same site in a sites folder, on DDEV, Docker Compose,
|
|
75
|
+
Podman or Kubernetes, and wires this pack into the testing setup of the site:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
bash core/scripts/plugins.sh --require @webship.co/workspace-espocrm
|
|
79
|
+
bash core/scripts/plugins.sh --activate espocrm --with-needs
|
|
80
|
+
bash core/scripts/plugins.sh --install espocrm --with-needs
|
|
81
|
+
bash dev/cmd-espocrm-project.sh crm --install --add-users --sample-content
|
|
82
|
+
bash dev/cmd-tools-testing.sh crm --run
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**2. A test project.**
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
mkdir crm-tests && cd crm-tests
|
|
89
|
+
npm init -y
|
|
90
|
+
npm install --save-dev webship-js @webship-js/espocrm-steps
|
|
91
|
+
npx init-webship-js
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**3. `cucumber.js`.** Add the pack's step definitions after webship-js's own, and give the world its parameters:
|
|
95
|
+
|
|
96
|
+
```javascript
|
|
97
|
+
require: [
|
|
98
|
+
'node_modules/webship-js/tests/step-definitions/**/*.js',
|
|
99
|
+
'node_modules/@webship-js/espocrm-steps/tests/step-definitions/**/*.js',
|
|
100
|
+
],
|
|
101
|
+
tags: process.env.CUCUMBER_TAGS || 'not @wip and not @must-fail',
|
|
102
|
+
worldParameters: {
|
|
103
|
+
launchUrl: process.env.LAUNCH_URL || 'https://espocrmsteps.ddev.site',
|
|
104
|
+
// The user that makes and removes test content through the site's API: an administrator.
|
|
105
|
+
manager: process.env.MANAGER || 'owner',
|
|
106
|
+
// The team a case is made in when a step names none.
|
|
107
|
+
team: process.env.TEAM || 'Support',
|
|
108
|
+
users: {
|
|
109
|
+
owner: { username: 'owner', password: process.env.ESPOCRM_OWNER_PASSWORD, name: 'Owner Test' },
|
|
110
|
+
developer: { username: 'developer', password: process.env.ESPOCRM_DEVELOPER_PASSWORD, name: 'Developer Test' },
|
|
111
|
+
sales: { username: 'sales', password: process.env.ESPOCRM_SALES_PASSWORD, name: 'Sales Test' },
|
|
112
|
+
viewer: { username: 'viewer', password: process.env.ESPOCRM_VIEWER_PASSWORD, name: 'Viewer Test' },
|
|
113
|
+
},
|
|
114
|
+
javascript: { mode: process.env.WEBSHIP_JS_ERROR_MODE || 'fail', levels: ['error'], beforeScenario: false, afterScenario: true },
|
|
115
|
+
// … webship-js's own parameters (minWaitTime, screenshot …)
|
|
116
|
+
},
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
This repository's own [`cucumber.js`](cucumber.js) is a whole example.
|
|
120
|
+
|
|
121
|
+
**4. Run.**
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
npx cucumber-js # every feature
|
|
125
|
+
npx cucumber-js tests/features/cases.feature # one feature
|
|
126
|
+
CUCUMBER_TAGS=@permissions npx cucumber-js # one tag
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Steps
|
|
130
|
+
|
|
131
|
+
### Test content
|
|
132
|
+
|
|
133
|
+
| Step | What it does |
|
|
134
|
+
| --- | --- |
|
|
135
|
+
| `Given there is a case "Webship test post"` | The managing user makes a case through the site's API: status New, nobody assigned, in the team of `cucumber.js` (`in the team "Sales"` for another). A case of the name a stopped run left goes first; it goes after the scenario |
|
|
136
|
+
| `Given there is no case "Webship test new"` | Removes any case of that name, as the managing user |
|
|
137
|
+
|
|
138
|
+
### A new case
|
|
139
|
+
|
|
140
|
+
| Step | What it does |
|
|
141
|
+
| --- | --- |
|
|
142
|
+
| `When I create a case "Webship test made"` | The site's form (Cases, Create), as the session's user: the name and, `with the description "…"`, a description. The site puts it in the maker's default team. It goes after the scenario |
|
|
143
|
+
|
|
144
|
+
### One case
|
|
145
|
+
|
|
146
|
+
| Step | What it does |
|
|
147
|
+
| --- | --- |
|
|
148
|
+
| `When I open the case "Exported reports have no date"` | Opens a case by its name |
|
|
149
|
+
| `When I post "…" on the case` | The stream's box ("Write your comment here") and Post |
|
|
150
|
+
| `When I set the status of the case to "Pending"` | The status field, changed in place: New, Assigned, Pending, Closed, Rejected, Duplicate |
|
|
151
|
+
| `When I assign the case to "Owner Test"` | Edit, then Assigned User: a user the session may assign to, by name, or `"nobody"` |
|
|
152
|
+
| `When I set the teams of the case to "Sales"` | Edit, then Teams: the teams instead of the ones it is in (a list: `"Support, Sales"`) |
|
|
153
|
+
| `Then the status of the case should be "New"` | Its status |
|
|
154
|
+
| `Then the case should be assigned to "Developer Test"` | Its assignee (`should not be assigned` for nobody) |
|
|
155
|
+
| `Then the case should be in the team "Support"` | One of its teams (`should not be in the team` for the opposite) |
|
|
156
|
+
| `Then the case should show the post "…" by "Owner Test"` | A post of its stream, by its author |
|
|
157
|
+
| `Then the case should show the status change to "Pending" by "Developer Test"` | A change of its status on its stream, by its author |
|
|
158
|
+
|
|
159
|
+
### The case list
|
|
160
|
+
|
|
161
|
+
| Step | What it does |
|
|
162
|
+
| --- | --- |
|
|
163
|
+
| `When I open the open cases` | The case list with its Open filter (`all the cases`, `the closed cases` for the others) and no search |
|
|
164
|
+
| `When I search the cases for "export"` | The list's search box, over all the cases the session may see |
|
|
165
|
+
| `Then the case list should show "…"` | A case of the list on screen, by its name (`should not show` for the opposite) |
|
|
166
|
+
| `Then the case list should be empty` | No case ("No Data") |
|
|
167
|
+
|
|
168
|
+
### What a user may not see or do
|
|
169
|
+
|
|
170
|
+
| Step | What it does |
|
|
171
|
+
| --- | --- |
|
|
172
|
+
| `Then I should be refused the case "…"` | The site refuses the case: "403 You don't have access to this area." for a user not in its teams |
|
|
173
|
+
| `Then I should not be able to change the case` | The case offers no Edit and its fields no change in place |
|
|
174
|
+
|
|
175
|
+
```gherkin
|
|
176
|
+
Scenario: A case of a team the user is not in
|
|
177
|
+
Given I am a logged in user with the "developer" user
|
|
178
|
+
Then I should be refused the case "The release checklist of the site"
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## The browser's console
|
|
182
|
+
|
|
183
|
+
This pack's own suite runs in webship-js's `fail` mode: a JavaScript error or a console error fails the scenario. Two
|
|
184
|
+
refusals a suite asks for on purpose make the site log lines of its own, and the step that asserts each refusal lets
|
|
185
|
+
through exactly those lines, logged since that refusal began, and nothing else:
|
|
186
|
+
|
|
187
|
+
- **a refused login** (`Then the login should be refused with "…"`): the 401 of the site's request for its user
|
|
188
|
+
(`/api/v1/App/user`);
|
|
189
|
+
- **a refused case** (`Then I should be refused the case "…"`): the 403 of that case's own address
|
|
190
|
+
(`/api/v1/Case/<its id>`), the site's own report of it ("Server side error 403: No 'read' access."), and the request
|
|
191
|
+
the site leaves unhandled (an uncaught error whose message is one letter, with no address of its own), the last only
|
|
192
|
+
when that case's 403 was logged in the same step.
|
|
193
|
+
|
|
194
|
+
No scenario turns JavaScript errors off.
|
|
195
|
+
|
|
196
|
+
## Rules of a suite
|
|
197
|
+
|
|
198
|
+
- Log in by a handle of the users registry; never write a password into a feature.
|
|
199
|
+
- Never create or remove a user, a team or a role in a suite: they are configuration, made by the build of the site.
|
|
200
|
+
- Change only what the scenario made: a post, a status, an assignee and the teams go on a case of
|
|
201
|
+
`Given there is a case "…"` or one the scenario created, which goes after it. The sample cases are read only.
|
|
202
|
+
- Name test content "Webship test …": the Workspace's `cmd-tools-espocrm-cli.sh <site> --tidy` (or the build script's
|
|
203
|
+
`TIDY_ONLY=1`) removes it for good, with its stream.
|
|
204
|
+
|
|
205
|
+
## What EspoCRM does that a suite meets
|
|
206
|
+
|
|
207
|
+
- **A user whose role only reads cases may still post on their stream.** The role "Case viewer" reads Support's cases
|
|
208
|
+
and their stream, without editing them; EspoCRM still lets it post on a case's stream. The pack asserts what EspoCRM
|
|
209
|
+
does: the viewer may not change the case, and its post shows.
|
|
210
|
+
- **Assigning needs the role's own permission.** A role assigns cases only with its assignment permission ("team" for
|
|
211
|
+
the case agents), and offers in the Assigned User box only the users it may read. With that permission, a new case is
|
|
212
|
+
not assigned to its maker.
|
|
213
|
+
- **The case list remembers its filter and its search** in the browser, for the next user too: the list steps choose
|
|
214
|
+
them every time.
|
|
215
|
+
- **The site is one page:** a change saves without a page load, and a field's pencil shows only while the pointer is on
|
|
216
|
+
it. The steps wait for the record, the stream and the field they need.
|
|
217
|
+
- **Setting a user's password again ends that user's sessions**: the build sets a password only when it differs.
|
|
218
|
+
|
|
219
|
+
## Test users
|
|
220
|
+
|
|
221
|
+
The accounts the features log in as, each with the password `dD.123123ddd`:
|
|
222
|
+
|
|
223
|
+
| Handle | User name | Name | Role | Teams |
|
|
224
|
+
| --- | --- | --- | --- | --- |
|
|
225
|
+
| `owner` | `owner` | Owner Test | administrator | Support and Sales: the managing user |
|
|
226
|
+
| `developer` | `developer` | Developer Test | Case agent (creates, reads, edits its team's cases, assigns within its team) | Support |
|
|
227
|
+
| `sales` | `sales` | Sales Test | Case agent | Sales |
|
|
228
|
+
| `viewer` | `viewer` | Viewer Test | Case viewer (reads its team's cases and their stream, edits none) | Support |
|
|
229
|
+
|
|
230
|
+
## The test site
|
|
231
|
+
|
|
232
|
+
`.github/scripts/build-ddev-site.sh` builds it; `COUNTS_ONLY=1` makes it print what the site holds (cases, open cases,
|
|
233
|
+
posts, stream entries, users, API users, teams, roles, accounts), which CI compares before and after each run, and
|
|
234
|
+
`TIDY_ONLY=1` removes what a run left.
|
|
235
|
+
|
|
236
|
+
EspoCRM's install command line takes its answers on the command line, the administrator's password with them; the build
|
|
237
|
+
runs EspoCRM's own installer actions instead, in EspoCRM's order, with the answers in a file only its owner reads,
|
|
238
|
+
removed once read (`site/espocrm-install.php`).
|
|
239
|
+
|
|
240
|
+
The teams: Support (the default) and Sales. The account Webship Customer, in both. The sample cases:
|
|
241
|
+
|
|
242
|
+
- "The login page does not keep the user name": Support, Assigned to the developer, with the developer's and the
|
|
243
|
+
owner's posts;
|
|
244
|
+
- "Exported reports have no date": Support, New, nobody assigned;
|
|
245
|
+
- "Attachments larger than 2 MB fail": Support, Closed, the developer's, with a post;
|
|
246
|
+
- "The upload error page has no way back": Support, Pending, the owner's;
|
|
247
|
+
- "The release checklist of the site": Sales, Assigned to the sales user.
|
|
248
|
+
|
|
249
|
+
The build makes them with EspoCRM's own application, in the web container (`site/espocrm-site.php`); the features read
|
|
250
|
+
them and never change them.
|
|
251
|
+
|
|
252
|
+
## The assertions that must fail
|
|
253
|
+
|
|
254
|
+
`tests/must-fail/` holds scenarios that assert something that is not true on the test site; `npm run test:must-fail`
|
|
255
|
+
runs them and checks that each fails at its last step with the message its description announces, and a hint. A step
|
|
256
|
+
that cannot fail proves nothing.
|
|
257
|
+
|
|
258
|
+
## Logo
|
|
259
|
+
|
|
260
|
+
The logo is EspoCRM's own, as its pages show it on a light background (`client/img/logo-light.svg` of EspoCRM's
|
|
261
|
+
release, drawn as a PNG). It names the platform the pack tests.
|
|
262
|
+
|
|
263
|
+
## License
|
|
264
|
+
|
|
265
|
+
MIT (see `LICENSE`). EspoCRM itself is AGPL-3.0: the pack carries none of its code (the build fetches its release), and
|
|
266
|
+
EspoCRM's own tests were read for their flows only.
|
package/package.json
CHANGED
|
@@ -1,6 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webship-js/espocrm-steps",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Cucumber step definitions for EspoCRM, the open-source CRM, a pack for webship-js (Playwright and Cucumber): logging in and its refusal, the cases, one case with its stream posts, status, assignee and teams, the list and the search, and what a user outside a team or role may not see or do.",
|
|
5
|
+
"main": "tests/step-definitions/espocrm-helpers.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"tests/step-definitions/",
|
|
8
|
+
"tests/features/",
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"test": "cucumber-js --config cucumber.js",
|
|
14
|
+
"test:dry": "cucumber-js --config cucumber.js --dry-run",
|
|
15
|
+
"test:examples": "node tests/check-examples.js",
|
|
16
|
+
"test:paths": "node tests/check-paths.js",
|
|
17
|
+
"test:must-fail": "node tests/check-must-fail.js",
|
|
18
|
+
"test:chromium": "BROWSER=chromium cucumber-js --config cucumber.js",
|
|
19
|
+
"test:firefox": "BROWSER=firefox cucumber-js --config cucumber.js",
|
|
20
|
+
"test:webkit": "BROWSER=webkit cucumber-js --config cucumber.js",
|
|
21
|
+
"test:headed": "HEADLESS=false cucumber-js --config cucumber.js",
|
|
22
|
+
"generate-reports": "generate-reports",
|
|
23
|
+
"test:fast": "SLOW_MO=0 cucumber-js --config cucumber.js"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"webship-js",
|
|
27
|
+
"cucumber",
|
|
28
|
+
"cucumber-js",
|
|
29
|
+
"playwright",
|
|
30
|
+
"bdd",
|
|
31
|
+
"gherkin",
|
|
32
|
+
"step-definitions",
|
|
33
|
+
"e2e-testing",
|
|
34
|
+
"espocrm",
|
|
35
|
+
"crm",
|
|
36
|
+
"cases"
|
|
37
|
+
],
|
|
38
|
+
"author": "Webship.co",
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/webship/espocrm-steps.git"
|
|
43
|
+
},
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/webship/espocrm-steps/issues"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/webship/espocrm-steps#readme",
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">= 24.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"webship-js": "^2.0.16"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"tsx": "^4.23.0",
|
|
59
|
+
"webship-js": "^2.0.17"
|
|
60
|
+
},
|
|
61
|
+
"overrides": {
|
|
62
|
+
"@cucumber/cucumber": "^12"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
@cases
|
|
2
|
+
Feature: Working a case
|
|
3
|
+
A user creates a case, posts on its stream, assigns it, takes it through its statuses, and moves it between teams.
|
|
4
|
+
What a scenario makes goes after it.
|
|
5
|
+
|
|
6
|
+
Scenario: A user creates a case
|
|
7
|
+
Given there is no case "Webship test made"
|
|
8
|
+
And I am a logged in user with the "developer" user
|
|
9
|
+
When I create a case "Webship test made" with the description "The page title shows the old name."
|
|
10
|
+
Then the status of the case should be "New"
|
|
11
|
+
And the case should not be assigned
|
|
12
|
+
And the case should be in the team "Support"
|
|
13
|
+
|
|
14
|
+
Scenario: A developer works a case
|
|
15
|
+
Given there is a case "Webship test work"
|
|
16
|
+
And I am a logged in user with the "developer" user
|
|
17
|
+
When I open the case "Webship test work"
|
|
18
|
+
Then the case should not be assigned
|
|
19
|
+
When I post "The form forgets the field" on the case
|
|
20
|
+
Then the case should show the post "The form forgets the field" by "Developer Test"
|
|
21
|
+
When I assign the case to "Developer Test"
|
|
22
|
+
Then the case should be assigned to "Developer Test"
|
|
23
|
+
When I set the status of the case to "Pending"
|
|
24
|
+
Then the status of the case should be "Pending"
|
|
25
|
+
And the case should show the status change to "Pending" by "Developer Test"
|
|
26
|
+
When I set the status of the case to "Closed"
|
|
27
|
+
Then the status of the case should be "Closed"
|
|
28
|
+
|
|
29
|
+
Scenario: An owner moves a case to another team and gives it to someone there
|
|
30
|
+
Given there is a case "Webship test owner"
|
|
31
|
+
And I am a logged in user with the "owner" user
|
|
32
|
+
When I open the case "Webship test owner"
|
|
33
|
+
And I set the teams of the case to "Sales"
|
|
34
|
+
Then the case should be in the team "Sales"
|
|
35
|
+
And the case should not be in the team "Support"
|
|
36
|
+
When I assign the case to "Sales Test"
|
|
37
|
+
Then the case should be assigned to "Sales Test"
|
|
38
|
+
When I assign the case to "nobody"
|
|
39
|
+
Then the case should not be assigned
|
|
40
|
+
|
|
41
|
+
Scenario: The sample case's stream, assignee, status and team
|
|
42
|
+
Given I am a logged in user with the "developer" user
|
|
43
|
+
When I open the case "The login page does not keep the user name"
|
|
44
|
+
Then the status of the case should be "Assigned"
|
|
45
|
+
And the case should be assigned to "Developer Test"
|
|
46
|
+
And the case should be in the team "Support"
|
|
47
|
+
And the case should show the post "Reproduced on the test site." by "Developer Test"
|
|
48
|
+
And the case should show the post "The session cookie is set too late." by "Owner Test"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@lists
|
|
2
|
+
Feature: The case list, its filters and its search
|
|
3
|
+
The case list shows the cases of the teams a user is in; its filters show the open or the closed ones, and its search
|
|
4
|
+
finds a case by its words.
|
|
5
|
+
|
|
6
|
+
Scenario: The open cases show a new case, and the closed ones once it is closed
|
|
7
|
+
Given there is a case "Webship test list"
|
|
8
|
+
And I am a logged in user with the "developer" user
|
|
9
|
+
When I open the open cases
|
|
10
|
+
Then the case list should show "Webship test list"
|
|
11
|
+
And the case list should show "Exported reports have no date"
|
|
12
|
+
And the case list should not show "Attachments larger than 2 MB fail"
|
|
13
|
+
And the case list should not show "The release checklist of the site"
|
|
14
|
+
When I open the case "Webship test list"
|
|
15
|
+
And I set the status of the case to "Closed"
|
|
16
|
+
And I open the open cases
|
|
17
|
+
Then the case list should not show "Webship test list"
|
|
18
|
+
When I open the closed cases
|
|
19
|
+
Then the case list should show "Webship test list"
|
|
20
|
+
And the case list should show "Attachments larger than 2 MB fail"
|
|
21
|
+
|
|
22
|
+
Scenario: A search finds the cases of the user's teams
|
|
23
|
+
Given I am a logged in user with the "developer" user
|
|
24
|
+
When I search the cases for "export"
|
|
25
|
+
Then the case list should show "Exported reports have no date"
|
|
26
|
+
When I search the cases for "checklist"
|
|
27
|
+
Then the case list should not show "The release checklist of the site"
|
|
28
|
+
When I search the cases for "Webship nothing matches this"
|
|
29
|
+
Then the case list should be empty
|
|
30
|
+
When I open all the cases
|
|
31
|
+
Then the case list should show "The upload error page has no way back"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@permissions
|
|
2
|
+
Feature: What each user may see and do
|
|
3
|
+
A user sees the cases of the teams it is in and nothing else; a user whose role only reads cases changes none of them,
|
|
4
|
+
and may still post on their stream; an administrator sees every team.
|
|
5
|
+
|
|
6
|
+
Scenario: A case of a team the user is not in
|
|
7
|
+
Given I am a logged in user with the "developer" user
|
|
8
|
+
Then I should be refused the case "The release checklist of the site"
|
|
9
|
+
Given I am a logged in user with the "sales" user
|
|
10
|
+
Then I should be refused the case "Exported reports have no date"
|
|
11
|
+
When I open the case "The release checklist of the site"
|
|
12
|
+
Then the case should be assigned to "Sales Test"
|
|
13
|
+
And the case should be in the team "Sales"
|
|
14
|
+
|
|
15
|
+
Scenario: A user whose role only reads cases
|
|
16
|
+
Given there is a case "Webship test viewer"
|
|
17
|
+
And I am a logged in user with the "viewer" user
|
|
18
|
+
When I open the case "Webship test viewer"
|
|
19
|
+
Then I should not be able to change the case
|
|
20
|
+
When I post "Seen it, nothing to change" on the case
|
|
21
|
+
Then the case should show the post "Seen it, nothing to change" by "Viewer Test"
|
|
22
|
+
|
|
23
|
+
Scenario: An administrator sees every team
|
|
24
|
+
Given I am a logged in user with the "owner" user
|
|
25
|
+
When I search the cases for "checklist"
|
|
26
|
+
Then the case list should show "The release checklist of the site"
|
|
27
|
+
When I open the case "Exported reports have no date"
|
|
28
|
+
Then the status of the case should be "New"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@session
|
|
2
|
+
Feature: Logging in and out
|
|
3
|
+
The users of the CRM log in with their user name, a wrong password is refused, and logging out ends the session.
|
|
4
|
+
|
|
5
|
+
Scenario: A user logs in through the form and out again
|
|
6
|
+
Given I am not logged in
|
|
7
|
+
When I log in with the "developer" user
|
|
8
|
+
Then I should be logged in as "Developer Test"
|
|
9
|
+
When I log out
|
|
10
|
+
Then I should not be logged in
|
|
11
|
+
|
|
12
|
+
Scenario: A wrong password is refused
|
|
13
|
+
Given I am not logged in
|
|
14
|
+
When I log in as "nobody" with the password "not-the-right-password"
|
|
15
|
+
Then the login should be refused with "Wrong username/password"
|
|
16
|
+
And I should not be logged in
|
|
17
|
+
|
|
18
|
+
Scenario: Another account of the registry
|
|
19
|
+
Given I am a logged in user with the "owner" user
|
|
20
|
+
Then I should be logged in as "owner"
|
|
21
|
+
Given I am a logged in user with the "viewer" user
|
|
22
|
+
Then I should be logged in as "Viewer Test"
|