@verdaccio/e2e-ui 2.5.0 → 2.6.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/build/cjs/features.cjs +34 -0
- package/build/cjs/features.cjs.map +1 -1
- package/build/cjs/index.cjs +13 -0
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/testIds.cjs +16 -1
- package/build/cjs/testIds.cjs.map +1 -1
- package/build/cjs/tests/detail.cjs +73 -0
- package/build/cjs/tests/detail.cjs.map +1 -0
- package/build/cjs/tests/failure-modes.cjs +75 -0
- package/build/cjs/tests/failure-modes.cjs.map +1 -0
- package/build/cjs/tests/i18n-keys.cjs +74 -0
- package/build/cjs/tests/i18n-keys.cjs.map +1 -0
- package/build/cjs/tests/index.cjs +22 -0
- package/build/cjs/tests/signup.cjs +56 -0
- package/build/cjs/tests/signup.cjs.map +1 -0
- package/build/esm/features.js +34 -0
- package/build/esm/features.js.map +1 -1
- package/build/esm/index.js +10 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/testIds.js +16 -1
- package/build/esm/testIds.js.map +1 -1
- package/build/esm/tests/detail.js +73 -0
- package/build/esm/tests/detail.js.map +1 -0
- package/build/esm/tests/failure-modes.js +75 -0
- package/build/esm/tests/failure-modes.js.map +1 -0
- package/build/esm/tests/i18n-keys.js +74 -0
- package/build/esm/tests/i18n-keys.js.map +1 -0
- package/build/esm/tests/index.js +12 -0
- package/build/esm/tests/signup.js +56 -0
- package/build/esm/tests/signup.js.map +1 -0
- package/build/features.d.ts +79 -0
- package/build/index.d.ts +1 -1
- package/build/testIds.d.ts +18 -0
- package/build/tests/detail.d.ts +12 -0
- package/build/tests/failure-modes.d.ts +11 -0
- package/build/tests/i18n-keys.d.ts +2 -0
- package/build/tests/index.d.ts +4 -0
- package/build/tests/signup.d.ts +12 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signup.js","names":[],"sources":["../../../src/tests/signup.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\nimport { maybeIt } from '../features';\nimport { RegistryConfig } from '../types';\n\n/**\n * Create-user (web signup) tests.\n *\n * Requires the server flag `createUser: true` (the /-/web/add-user page\n * redirects home without it) and the fixed signup form from\n * verdaccio/verdaccio#6210 — every published ui-theme posted to\n * `PUT /-/web/add-user:<user>`, a URL that only serves the SPA, so the\n * form could never succeed. That is exactly why this suite exists: the\n * bug lived for months because no e2e ever clicked through the flow.\n */\nexport function signupTests(config: RegistryConfig) {\n const { features } = config;\n const { signup } = config.selectors;\n\n describe('signup (create user)', () => {\n beforeEach(() => {\n cy.visit(`${config.registryUrl}/-/web/add-user`);\n cy.get('body').should('be.visible');\n });\n\n maybeIt(features.signup.happyPath)(\n 'should create a user through the real signup endpoint and land on success',\n () => {\n const username = `e2e-signup-${Date.now()}`;\n\n cy.intercept('PUT', '/-/verdaccio/sec/signup').as('signup');\n\n cy.get(signup.usernameInput).type(username);\n cy.get(signup.passwordInput).type('e2e-password');\n cy.get(signup.emailInput).type(`${username}@example.com`);\n cy.get(signup.submitButton).should('not.be.disabled').click();\n\n // Wire contract: the request must carry name/password/email and\n // the 36-char sessionId the endpoint validates before anything.\n cy.wait('@signup', { timeout: 10000 }).then((interception: any) => {\n const body = interception.request.body;\n expect(body.name).to.eq(username);\n expect(body.email).to.eq(`${username}@example.com`);\n expect(body.sessionId).to.be.a('string').with.length(36);\n expect(interception.response?.statusCode).to.be.oneOf([200, 201]);\n });\n\n cy.location('pathname', { timeout: 10000 }).should('contain', '/-/web/success');\n }\n );\n\n maybeIt(features.signup.validation)(\n 'an invalid email must show a visible message and keep submit disabled',\n () => {\n cy.get(signup.usernameInput).type('e2e-validation-user');\n cy.get(signup.passwordInput).type('e2e-password');\n cy.get(signup.emailInput).type('not-an-email');\n\n cy.get(signup.submitButton).should('be.disabled');\n // The reason must be visible, not a silently disabled button.\n cy.get(signup.emailInput)\n .closest('div.MuiFormControl-root')\n .find('.MuiFormHelperText-root')\n .should('be.visible')\n .and('not.be.empty');\n }\n );\n\n maybeIt(features.signup.validation)(\n 'a username with spaces must block submit with a visible message',\n () => {\n cy.get(signup.usernameInput).type('user name');\n cy.get(signup.passwordInput).type('e2e-password');\n cy.get(signup.emailInput).type('valid@example.com');\n\n cy.get(signup.submitButton).should('be.disabled');\n cy.get(signup.usernameInput)\n .closest('div.MuiFormControl-root')\n .find('.MuiFormHelperText-root')\n .should('be.visible')\n .and('not.be.empty');\n }\n );\n });\n}\n"],"mappings":";;;;;;;;;;;;AAcA,SAAgB,YAAY,QAAwB;CAClD,MAAM,EAAE,aAAa;CACrB,MAAM,EAAE,WAAW,OAAO;CAE1B,SAAS,8BAA8B;EACrC,iBAAiB;GACf,GAAG,MAAM,GAAG,OAAO,YAAY,gBAAgB;GAC/C,GAAG,IAAI,MAAM,CAAC,CAAC,OAAO,YAAY;EACpC,CAAC;EAED,QAAQ,SAAS,OAAO,SAAS,CAAC,CAChC,mFACM;GACJ,MAAM,WAAW,cAAc,KAAK,IAAI;GAExC,GAAG,UAAU,OAAO,yBAAyB,CAAC,CAAC,GAAG,QAAQ;GAE1D,GAAG,IAAI,OAAO,aAAa,CAAC,CAAC,KAAK,QAAQ;GAC1C,GAAG,IAAI,OAAO,aAAa,CAAC,CAAC,KAAK,cAAc;GAChD,GAAG,IAAI,OAAO,UAAU,CAAC,CAAC,KAAK,GAAG,SAAS,aAAa;GACxD,GAAG,IAAI,OAAO,YAAY,CAAC,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM;GAI5D,GAAG,KAAK,WAAW,EAAE,SAAS,IAAM,CAAC,CAAC,CAAC,MAAM,iBAAsB;IACjE,MAAM,OAAO,aAAa,QAAQ;IAClC,OAAO,KAAK,IAAI,CAAC,CAAC,GAAG,GAAG,QAAQ;IAChC,OAAO,KAAK,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,aAAa;IAClD,OAAO,KAAK,SAAS,CAAC,CAAC,GAAG,GAAG,EAAE,QAAQ,CAAC,CAAC,KAAK,OAAO,EAAE;IACvD,OAAO,aAAa,UAAU,UAAU,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC;GAClE,CAAC;GAED,GAAG,SAAS,YAAY,EAAE,SAAS,IAAM,CAAC,CAAC,CAAC,OAAO,WAAW,gBAAgB;EAChF,CACF;EAEA,QAAQ,SAAS,OAAO,UAAU,CAAC,CACjC,+EACM;GACJ,GAAG,IAAI,OAAO,aAAa,CAAC,CAAC,KAAK,qBAAqB;GACvD,GAAG,IAAI,OAAO,aAAa,CAAC,CAAC,KAAK,cAAc;GAChD,GAAG,IAAI,OAAO,UAAU,CAAC,CAAC,KAAK,cAAc;GAE7C,GAAG,IAAI,OAAO,YAAY,CAAC,CAAC,OAAO,aAAa;GAEhD,GAAG,IAAI,OAAO,UAAU,CAAC,CACtB,QAAQ,yBAAyB,CAAC,CAClC,KAAK,yBAAyB,CAAC,CAC/B,OAAO,YAAY,CAAC,CACpB,IAAI,cAAc;EACvB,CACF;EAEA,QAAQ,SAAS,OAAO,UAAU,CAAC,CACjC,yEACM;GACJ,GAAG,IAAI,OAAO,aAAa,CAAC,CAAC,KAAK,WAAW;GAC7C,GAAG,IAAI,OAAO,aAAa,CAAC,CAAC,KAAK,cAAc;GAChD,GAAG,IAAI,OAAO,UAAU,CAAC,CAAC,KAAK,mBAAmB;GAElD,GAAG,IAAI,OAAO,YAAY,CAAC,CAAC,OAAO,aAAa;GAChD,GAAG,IAAI,OAAO,aAAa,CAAC,CACzB,QAAQ,yBAAyB,CAAC,CAClC,KAAK,yBAAyB,CAAC,CAC/B,OAAO,YAAY,CAAC,CACpB,IAAI,cAAc;EACvB,CACF;CACF,CAAC;AACH"}
|
package/build/features.d.ts
CHANGED
|
@@ -87,6 +87,85 @@ export interface Features {
|
|
|
87
87
|
*/
|
|
88
88
|
rawViewer: boolean;
|
|
89
89
|
};
|
|
90
|
+
detail: {
|
|
91
|
+
/**
|
|
92
|
+
* Whether to run the "visiting /v/<version> pins that version" test
|
|
93
|
+
* (asserts the sidebar request carries `?v=<version>`).
|
|
94
|
+
*/
|
|
95
|
+
versionPinned: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Whether to run the wire-format test for scoped packages: the UI
|
|
98
|
+
* must request `/-/verdaccio/data/sidebar/@scope/name` with the `@`
|
|
99
|
+
* and `/` literal (npm registry convention), never `%40`-encoded.
|
|
100
|
+
* Pins the regression caught by these suites in
|
|
101
|
+
* verdaccio/verdaccio#6210.
|
|
102
|
+
*/
|
|
103
|
+
scopedWireFormat: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Whether to run the "nonexistent version renders Not Found" test.
|
|
106
|
+
* Requires the server to answer 404 for unknown `?v=` values
|
|
107
|
+
* (verdaccio/verdaccio#6210); released lines silently fall back to
|
|
108
|
+
* `latest`, so this defaults to `false` as a probe.
|
|
109
|
+
*/
|
|
110
|
+
versionNotFound: boolean;
|
|
111
|
+
};
|
|
112
|
+
failureModes: {
|
|
113
|
+
/**
|
|
114
|
+
* Whether to run the "backend 5xx on the package list must not
|
|
115
|
+
* render the empty-registry onboarding" test. Holds on every line
|
|
116
|
+
* (a 5xx carries an HTTP code the UI always treated as an error).
|
|
117
|
+
*/
|
|
118
|
+
homeServerError: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Whether to run the network-failure variant (request never
|
|
121
|
+
* reaches the server). Released UIs treat a network failure as an
|
|
122
|
+
* empty registry and show the onboarding card
|
|
123
|
+
* (verdaccio/verdaccio#6210 fixes it), so this defaults to `false`
|
|
124
|
+
* as a probe.
|
|
125
|
+
*/
|
|
126
|
+
homeNetworkError: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Whether to run the "5xx on the detail page renders an error
|
|
129
|
+
* state instead of a blank page" test. Requires the generic error
|
|
130
|
+
* page from verdaccio/verdaccio#6210; released UIs render blank,
|
|
131
|
+
* so this defaults to `false` as a probe.
|
|
132
|
+
*/
|
|
133
|
+
detailErrorState: boolean;
|
|
134
|
+
};
|
|
135
|
+
i18n: {
|
|
136
|
+
/**
|
|
137
|
+
* Whether to scan the home and detail pages for raw i18n keys
|
|
138
|
+
* (visible text like `sidebar.detail.version`). Holds on every
|
|
139
|
+
* released line — these pages ship fully translated.
|
|
140
|
+
*/
|
|
141
|
+
noRawKeysCorePages: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Whether to scan the security pages (login dialog, /-/web/login,
|
|
144
|
+
* add-user, change-password) for raw i18n keys. The whole
|
|
145
|
+
* `security.*` namespace is missing from every published ui-theme
|
|
146
|
+
* bundle (fixed in verdaccio/verdaccio#6210), so this defaults to
|
|
147
|
+
* `false` as a probe.
|
|
148
|
+
*/
|
|
149
|
+
noRawKeysSecurityPages: boolean;
|
|
150
|
+
};
|
|
151
|
+
signup: {
|
|
152
|
+
/**
|
|
153
|
+
* Whether to run the create-user happy path (fill the form on
|
|
154
|
+
* /-/web/add-user, submit, land on the success page) and assert
|
|
155
|
+
* the wire contract: `PUT /-/verdaccio/sec/signup` with a 36-char
|
|
156
|
+
* `sessionId`. Requires the server flag `createUser: true` AND the
|
|
157
|
+
* fixed signup form from verdaccio/verdaccio#6210 — every
|
|
158
|
+
* published ui-theme posts to a URL that only serves the SPA, so
|
|
159
|
+
* this defaults to `false` as a probe.
|
|
160
|
+
*/
|
|
161
|
+
happyPath: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Whether to run the client-side validation tests on the add-user
|
|
164
|
+
* form (invalid email shows a message, url-unsafe username blocks
|
|
165
|
+
* submit). Same requirements as `happyPath`.
|
|
166
|
+
*/
|
|
167
|
+
validation: boolean;
|
|
168
|
+
};
|
|
90
169
|
changePassword: {
|
|
91
170
|
/**
|
|
92
171
|
* Whether to run the happy-path test (submit valid change,
|
package/build/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type { Features } from './features';
|
|
|
6
6
|
export { DEFAULT_SELECTORS, DEFAULT_TEST_IDS } from './testIds';
|
|
7
7
|
export { DEFAULT_FEATURES, maybeIt } from './features';
|
|
8
8
|
export { publishPackage, cleanupPublished, unpublishPackage } from './tasks';
|
|
9
|
-
export { homeTests, signinTests, publishTests, searchTests, settingsTests, layoutTests, changePasswordTests, } from './tests';
|
|
9
|
+
export { homeTests, signinTests, publishTests, searchTests, settingsTests, layoutTests, changePasswordTests, detailTests, failureModeTests, i18nKeyTests, signupTests, } from './tests';
|
|
10
10
|
/**
|
|
11
11
|
* Build a full RegistryConfig from user-provided options with defaults.
|
|
12
12
|
*
|
package/build/testIds.d.ts
CHANGED
|
@@ -116,6 +116,14 @@ export interface TestIds {
|
|
|
116
116
|
/** Close button inside the raw viewer dialog. */
|
|
117
117
|
closeRawViewer: string;
|
|
118
118
|
};
|
|
119
|
+
errors: {
|
|
120
|
+
/**
|
|
121
|
+
* Generic error page shown when a data request fails without a
|
|
122
|
+
* specific status (5xx, network failure). Added by
|
|
123
|
+
* verdaccio/verdaccio#6210 — only present on builds with that fix.
|
|
124
|
+
*/
|
|
125
|
+
genericError: string;
|
|
126
|
+
};
|
|
119
127
|
}
|
|
120
128
|
/**
|
|
121
129
|
* CSS selectors (not data-testids) used by the test suites. These are
|
|
@@ -133,6 +141,16 @@ export interface Selectors {
|
|
|
133
141
|
/** Submit button inside the login dialog. */
|
|
134
142
|
submitButton: string;
|
|
135
143
|
};
|
|
144
|
+
signup: {
|
|
145
|
+
/** Username input on /-/web/add-user (shares ids with the login form). */
|
|
146
|
+
usernameInput: string;
|
|
147
|
+
/** Password input on /-/web/add-user. */
|
|
148
|
+
passwordInput: string;
|
|
149
|
+
/** Email input on /-/web/add-user (only email-typed input on the page). */
|
|
150
|
+
emailInput: string;
|
|
151
|
+
/** Submit button on /-/web/add-user. */
|
|
152
|
+
submitButton: string;
|
|
153
|
+
};
|
|
136
154
|
}
|
|
137
155
|
/**
|
|
138
156
|
* Defaults matching Verdaccio 6.x (bundled ui-theme@9.0.0-next-9.x).
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RegistryConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Package detail page tests: version-pinned URLs and the wire format of
|
|
4
|
+
* the UI's data requests.
|
|
5
|
+
*
|
|
6
|
+
* The wire format is an observable contract, not an implementation
|
|
7
|
+
* detail: proxies, intercepts and every npm client expect scoped names
|
|
8
|
+
* as literal `/@scope/name`. A ui-components refactor that
|
|
9
|
+
* percent-encoded the `@` broke exactly these suites
|
|
10
|
+
* (verdaccio/verdaccio#6210), which is why it is pinned here on purpose.
|
|
11
|
+
*/
|
|
12
|
+
export declare function detailTests(config: RegistryConfig): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RegistryConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Failure-mode tests: what the UI shows when the backend misbehaves.
|
|
4
|
+
*
|
|
5
|
+
* A registry that is down must never look like a healthy empty registry
|
|
6
|
+
* (that invites the user to publish into the void), and a failed detail
|
|
7
|
+
* request must render an error state instead of a blank page. These are
|
|
8
|
+
* the failure classes fixed by verdaccio/verdaccio#6210 — the strict
|
|
9
|
+
* assertions are feature-gated probes until that ships.
|
|
10
|
+
*/
|
|
11
|
+
export declare function failureModeTests(config: RegistryConfig): void;
|
package/build/tests/index.d.ts
CHANGED
|
@@ -5,3 +5,7 @@ export { searchTests } from './search';
|
|
|
5
5
|
export { settingsTests } from './settings';
|
|
6
6
|
export { layoutTests } from './layout';
|
|
7
7
|
export { changePasswordTests } from './change-password';
|
|
8
|
+
export { detailTests } from './detail';
|
|
9
|
+
export { failureModeTests } from './failure-modes';
|
|
10
|
+
export { i18nKeyTests } from './i18n-keys';
|
|
11
|
+
export { signupTests } from './signup';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RegistryConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Create-user (web signup) tests.
|
|
4
|
+
*
|
|
5
|
+
* Requires the server flag `createUser: true` (the /-/web/add-user page
|
|
6
|
+
* redirects home without it) and the fixed signup form from
|
|
7
|
+
* verdaccio/verdaccio#6210 — every published ui-theme posted to
|
|
8
|
+
* `PUT /-/web/add-user:<user>`, a URL that only serves the SPA, so the
|
|
9
|
+
* form could never succeed. That is exactly why this suite exists: the
|
|
10
|
+
* bug lived for months because no e2e ever clicked through the flow.
|
|
11
|
+
*/
|
|
12
|
+
export declare function signupTests(config: RegistryConfig): void;
|