@verdaccio/e2e-ui 2.8.0 → 2.10.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/README.md +44 -8
- package/build/cjs/commands/index.cjs +1 -2
- package/build/cjs/features.cjs +6 -2
- package/build/cjs/features.cjs.map +1 -1
- package/build/cjs/index.cjs +6 -2
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/tasks/publish.cjs +1 -2
- package/build/cjs/tasks/publish.cjs.map +1 -1
- package/build/cjs/testIds.cjs +3 -2
- package/build/cjs/testIds.cjs.map +1 -1
- package/build/cjs/tests/change-password.cjs +1 -2
- package/build/cjs/tests/detail.cjs +1 -2
- package/build/cjs/tests/failure-modes.cjs +1 -2
- package/build/cjs/tests/home-detail-ux.cjs +1 -2
- package/build/cjs/tests/home.cjs +1 -2
- package/build/cjs/tests/i18n-keys.cjs +1 -2
- package/build/cjs/tests/index.cjs +4 -0
- package/build/cjs/tests/layout.cjs +1 -2
- package/build/cjs/tests/manifest-rendering.cjs +1 -2
- package/build/cjs/tests/prefixed-routing.cjs +53 -0
- package/build/cjs/tests/prefixed-routing.cjs.map +1 -0
- package/build/cjs/tests/provenance.cjs +133 -0
- package/build/cjs/tests/provenance.cjs.map +1 -0
- package/build/cjs/tests/publish.cjs +1 -2
- package/build/cjs/tests/search.cjs +1 -2
- package/build/cjs/tests/session.cjs +1 -2
- package/build/cjs/tests/settings.cjs +1 -2
- package/build/cjs/tests/signin.cjs +1 -2
- package/build/cjs/tests/signup.cjs +1 -2
- package/build/esm/commands/index.js +1 -2
- package/build/esm/features.js +6 -2
- package/build/esm/features.js.map +1 -1
- package/build/esm/index.js +5 -3
- package/build/esm/index.js.map +1 -1
- package/build/esm/tasks/publish.js +1 -2
- package/build/esm/testIds.js +3 -2
- package/build/esm/testIds.js.map +1 -1
- package/build/esm/tests/change-password.js +1 -2
- package/build/esm/tests/detail.js +1 -2
- package/build/esm/tests/failure-modes.js +1 -2
- package/build/esm/tests/home-detail-ux.js +1 -2
- package/build/esm/tests/home.js +1 -2
- package/build/esm/tests/i18n-keys.js +1 -2
- package/build/esm/tests/index.js +3 -1
- package/build/esm/tests/layout.js +1 -2
- package/build/esm/tests/manifest-rendering.js +1 -2
- package/build/esm/tests/prefixed-routing.js +53 -0
- package/build/esm/tests/prefixed-routing.js.map +1 -0
- package/build/esm/tests/provenance.js +133 -0
- package/build/esm/tests/provenance.js.map +1 -0
- package/build/esm/tests/publish.js +1 -2
- package/build/esm/tests/search.js +1 -2
- package/build/esm/tests/session.js +1 -2
- package/build/esm/tests/settings.js +1 -2
- package/build/esm/tests/signin.js +1 -2
- package/build/esm/tests/signup.js +1 -2
- package/build/features.d.ts +12 -0
- package/build/index.d.ts +1 -1
- package/build/testIds.d.ts +4 -0
- package/build/tests/index.d.ts +2 -0
- package/build/tests/prefixed-routing.d.ts +2 -0
- package/build/tests/provenance.d.ts +13 -0
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_features = require("../features.cjs");
|
|
2
|
-
|
|
2
|
+
// src/tests/manifest-rendering.ts
|
|
3
3
|
/**
|
|
4
4
|
* Manifest-shape rendering tests.
|
|
5
5
|
*
|
|
@@ -67,7 +67,6 @@ function manifestRenderingTests(config) {
|
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
//#endregion
|
|
71
70
|
exports.manifestRenderingTests = manifestRenderingTests;
|
|
72
71
|
|
|
73
72
|
//# sourceMappingURL=manifest-rendering.cjs.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// src/tests/prefixed-routing.ts
|
|
2
|
+
function prefixedRoutingTests(config) {
|
|
3
|
+
describe("routing under a prefix with an asynchronous middleware plugin", () => {
|
|
4
|
+
const pkgName = "@verdaccio/routing-fixture";
|
|
5
|
+
let registryUrl;
|
|
6
|
+
let tempFolder;
|
|
7
|
+
before(() => {
|
|
8
|
+
cy.task("startRoutingRegistry").then(({ registryUrl: url, publishUrl }) => {
|
|
9
|
+
registryUrl = url.replace(/\/$/, "");
|
|
10
|
+
cy.task("publishPackage", {
|
|
11
|
+
registryUrl: publishUrl,
|
|
12
|
+
pkgName,
|
|
13
|
+
version: "1.0.0",
|
|
14
|
+
unique: true
|
|
15
|
+
}).then((result) => {
|
|
16
|
+
tempFolder = result.tempFolder;
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
after(() => {
|
|
21
|
+
if (tempFolder) cy.task("cleanupPublished", tempFolder);
|
|
22
|
+
cy.task("stopRoutingRegistry");
|
|
23
|
+
});
|
|
24
|
+
it("renders the published package and its detail using the prefixed web API", () => {
|
|
25
|
+
const { testIds } = config;
|
|
26
|
+
const prefix = new URL(registryUrl).pathname;
|
|
27
|
+
assert.notStrictEqual(prefix, "/", "the fixture must mount Verdaccio under a prefix");
|
|
28
|
+
cy.intercept("GET", `${registryUrl}/-/verdaccio/data/packages*`).as("routingPackages");
|
|
29
|
+
cy.intercept("GET", `${registryUrl}/-/verdaccio/data/sidebar/**`).as("routingSidebar");
|
|
30
|
+
cy.intercept("GET", `${registryUrl}/-/verdaccio/data/package/readme/**`).as("routingReadme");
|
|
31
|
+
cy.visit(`${registryUrl}/`);
|
|
32
|
+
cy.wait("@routingPackages").then(({ response }) => {
|
|
33
|
+
assert.strictEqual(response?.statusCode, 200);
|
|
34
|
+
assert.include(response?.body.map((pkg) => pkg.name), pkgName);
|
|
35
|
+
});
|
|
36
|
+
cy.contains(`[data-testid="${testIds.package.title}"]`, pkgName).should("be.visible").click();
|
|
37
|
+
cy.location("pathname").should("eq", `${prefix}/-/web/detail/${pkgName}`);
|
|
38
|
+
cy.wait("@routingSidebar").then(({ response }) => {
|
|
39
|
+
assert.strictEqual(response?.statusCode, 200);
|
|
40
|
+
assert.strictEqual(response?.body.latest.name, pkgName);
|
|
41
|
+
});
|
|
42
|
+
cy.wait("@routingReadme").then(({ response }) => {
|
|
43
|
+
assert.strictEqual(response?.statusCode, 200);
|
|
44
|
+
assert.isString(response?.body);
|
|
45
|
+
assert.isNotEmpty(response?.body);
|
|
46
|
+
});
|
|
47
|
+
cy.request(`${registryUrl}/-/ping`).its("status").should("eq", 200);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
exports.prefixedRoutingTests = prefixedRoutingTests;
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=prefixed-routing.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefixed-routing.cjs","names":[],"sources":["../../../src/tests/prefixed-routing.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\nimport type { RegistryConfig } from '../types';\n\nexport function prefixedRoutingTests(config: RegistryConfig) {\n describe('routing under a prefix with an asynchronous middleware plugin', () => {\n const pkgName = '@verdaccio/routing-fixture';\n let registryUrl: string;\n let tempFolder: string | undefined;\n\n before(() => {\n cy.task<{ registryUrl: string; publishUrl: string }>('startRoutingRegistry').then(\n ({ registryUrl: url, publishUrl }) => {\n registryUrl = url.replace(/\\/$/, '');\n cy.task('publishPackage', {\n registryUrl: publishUrl,\n pkgName,\n version: '1.0.0',\n unique: true,\n }).then((result) => {\n tempFolder = result.tempFolder;\n });\n }\n );\n });\n\n after(() => {\n if (tempFolder) cy.task('cleanupPublished', tempFolder);\n cy.task('stopRoutingRegistry');\n });\n\n it('renders the published package and its detail using the prefixed web API', () => {\n const { testIds } = config;\n const prefix = new URL(registryUrl).pathname;\n assert.notStrictEqual(prefix, '/', 'the fixture must mount Verdaccio under a prefix');\n cy.intercept('GET', `${registryUrl}/-/verdaccio/data/packages*`).as('routingPackages');\n cy.intercept('GET', `${registryUrl}/-/verdaccio/data/sidebar/**`).as('routingSidebar');\n cy.intercept('GET', `${registryUrl}/-/verdaccio/data/package/readme/**`).as('routingReadme');\n\n cy.visit(`${registryUrl}/`);\n cy.wait('@routingPackages').then(({ response }) => {\n assert.strictEqual(response?.statusCode, 200);\n assert.include(\n response?.body.map((pkg: { name: string }) => pkg.name),\n pkgName\n );\n });\n cy.contains(`[data-testid=\"${testIds.package.title}\"]`, pkgName).should('be.visible').click();\n cy.location('pathname').should('eq', `${prefix}/-/web/detail/${pkgName}`);\n cy.wait('@routingSidebar').then(({ response }) => {\n assert.strictEqual(response?.statusCode, 200);\n assert.strictEqual(response?.body.latest.name, pkgName);\n });\n cy.wait('@routingReadme').then(({ response }) => {\n assert.strictEqual(response?.statusCode, 200);\n assert.isString(response?.body);\n assert.isNotEmpty(response?.body);\n });\n cy.request(`${registryUrl}/-/ping`).its('status').should('eq', 200);\n });\n });\n}\n"],"mappings":";AAGA,SAAgB,qBAAqB,QAAwB;CAC3D,SAAS,uEAAuE;EAC9E,MAAM,UAAU;EAChB,IAAI;EACJ,IAAI;EAEJ,aAAa;GACX,GAAG,KAAkD,sBAAsB,CAAC,CAAC,MAC1E,EAAE,aAAa,KAAK,iBAAiB;IACpC,cAAc,IAAI,QAAQ,OAAO,EAAE;IACnC,GAAG,KAAK,kBAAkB;KACxB,aAAa;KACb;KACA,SAAS;KACT,QAAQ;IACV,CAAC,CAAC,CAAC,MAAM,WAAW;KAClB,aAAa,OAAO;IACtB,CAAC;GACH,CACF;EACF,CAAC;EAED,YAAY;GACV,IAAI,YAAY,GAAG,KAAK,oBAAoB,UAAU;GACtD,GAAG,KAAK,qBAAqB;EAC/B,CAAC;EAED,GAAG,iFAAiF;GAClF,MAAM,EAAE,YAAY;GACpB,MAAM,SAAS,IAAI,IAAI,WAAW,CAAC,CAAC;GACpC,OAAO,eAAe,QAAQ,KAAK,iDAAiD;GACpF,GAAG,UAAU,OAAO,GAAG,YAAY,4BAA4B,CAAC,CAAC,GAAG,iBAAiB;GACrF,GAAG,UAAU,OAAO,GAAG,YAAY,6BAA6B,CAAC,CAAC,GAAG,gBAAgB;GACrF,GAAG,UAAU,OAAO,GAAG,YAAY,oCAAoC,CAAC,CAAC,GAAG,eAAe;GAE3F,GAAG,MAAM,GAAG,YAAY,EAAE;GAC1B,GAAG,KAAK,kBAAkB,CAAC,CAAC,MAAM,EAAE,eAAe;IACjD,OAAO,YAAY,UAAU,YAAY,GAAG;IAC5C,OAAO,QACL,UAAU,KAAK,KAAK,QAA0B,IAAI,IAAI,GACtD,OACF;GACF,CAAC;GACD,GAAG,SAAS,iBAAiB,QAAQ,QAAQ,MAAM,KAAK,OAAO,CAAC,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM;GAC5F,GAAG,SAAS,UAAU,CAAC,CAAC,OAAO,MAAM,GAAG,OAAO,gBAAgB,SAAS;GACxE,GAAG,KAAK,iBAAiB,CAAC,CAAC,MAAM,EAAE,eAAe;IAChD,OAAO,YAAY,UAAU,YAAY,GAAG;IAC5C,OAAO,YAAY,UAAU,KAAK,OAAO,MAAM,OAAO;GACxD,CAAC;GACD,GAAG,KAAK,gBAAgB,CAAC,CAAC,MAAM,EAAE,eAAe;IAC/C,OAAO,YAAY,UAAU,YAAY,GAAG;IAC5C,OAAO,SAAS,UAAU,IAAI;IAC9B,OAAO,WAAW,UAAU,IAAI;GAClC,CAAC;GACD,GAAG,QAAQ,GAAG,YAAY,QAAQ,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,OAAO,MAAM,GAAG;EACpE,CAAC;CACH,CAAC;AACH"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
const require_features = require("../features.cjs");
|
|
2
|
+
// src/tests/provenance.ts
|
|
3
|
+
/**
|
|
4
|
+
* "Provenance" sidebar section (9.x, verdaccio/verdaccio#6447).
|
|
5
|
+
*
|
|
6
|
+
* registry.npmjs.org attaches `dist.signatures` and `dist.attestations` to
|
|
7
|
+
* every version it signs; the UI shows them without verifying anything in
|
|
8
|
+
* the browser. The fixtures below publish those fields themselves (npm keeps
|
|
9
|
+
* extra `dist` fields on publish), so the suite runs offline and does not
|
|
10
|
+
* need an uplink. The build details come from the registry only when it
|
|
11
|
+
* announces the endpoint, so against this fixture the dialog ends at the
|
|
12
|
+
* summary.
|
|
13
|
+
*/
|
|
14
|
+
function provenanceTests(config) {
|
|
15
|
+
const { features } = config;
|
|
16
|
+
const { package: pkg } = config.testIds;
|
|
17
|
+
const attestations = {
|
|
18
|
+
url: "https://registry.npmjs.org/-/npm/v1/attestations/e2e-provenance@1.0.0",
|
|
19
|
+
provenance: { predicateType: "https://slsa.dev/provenance/v1" }
|
|
20
|
+
};
|
|
21
|
+
const signatures = [{
|
|
22
|
+
keyid: "SHA256:e2e-fixture-key",
|
|
23
|
+
sig: "MEUCIQDe2e"
|
|
24
|
+
}];
|
|
25
|
+
describe("provenance", () => {
|
|
26
|
+
describe("with provenance metadata", () => {
|
|
27
|
+
const pkgName = "@verdaccio/provenance-fixture";
|
|
28
|
+
let tempFolder = null;
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
cy.task("publishPackage", {
|
|
31
|
+
pkgName,
|
|
32
|
+
version: "1.0.0",
|
|
33
|
+
unique: true,
|
|
34
|
+
manifest: { dist: {
|
|
35
|
+
signatures,
|
|
36
|
+
attestations
|
|
37
|
+
} }
|
|
38
|
+
}).then((result) => {
|
|
39
|
+
tempFolder = result?.tempFolder ?? null;
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
afterEach(() => {
|
|
43
|
+
cy.task("unpublishPackage", {
|
|
44
|
+
pkgName,
|
|
45
|
+
tempFolder: tempFolder ?? void 0
|
|
46
|
+
});
|
|
47
|
+
if (tempFolder) cy.task("cleanupPublished", tempFolder);
|
|
48
|
+
tempFolder = null;
|
|
49
|
+
});
|
|
50
|
+
require_features.maybeIt(features.provenance.sidebarSection)("should show the provenance chip and open the dialog with the summary", () => {
|
|
51
|
+
cy.intercept("GET", `/-/verdaccio/data/sidebar/${pkgName}*`).as("sidebar");
|
|
52
|
+
cy.intercept("GET", `/-/verdaccio/data/package/provenance/${pkgName}*`).as("details");
|
|
53
|
+
cy.visit(`${config.registryUrl}/-/web/detail/${pkgName}`);
|
|
54
|
+
cy.wait("@sidebar", { timeout: 1e4 });
|
|
55
|
+
cy.getByTestId(pkg.provenanceBadge).scrollIntoView().should("be.visible").and("contain.text", "Provenance").and("contain.text", "SLSA v1");
|
|
56
|
+
cy.getByTestId(pkg.provenanceBadge).click();
|
|
57
|
+
cy.getByTestId(pkg.provenanceDialog).should("be.visible");
|
|
58
|
+
cy.getByTestId(pkg.provenanceDialog).within(() => {
|
|
59
|
+
cy.contains(`${pkgName}@`);
|
|
60
|
+
cy.contains("SLSA v1");
|
|
61
|
+
cy.contains(signatures[0].keyid);
|
|
62
|
+
cy.contains("registry.npmjs.org/-/npm/v1/attestations/e2e-provenance@1.0.0").should("have.attr", "href", attestations.url);
|
|
63
|
+
cy.contains("cryptographic verification has not been performed");
|
|
64
|
+
});
|
|
65
|
+
cy.wait("@details", { timeout: 1e4 }).then((interception) => {
|
|
66
|
+
expect(interception.response?.statusCode).to.equal(404);
|
|
67
|
+
});
|
|
68
|
+
cy.getByTestId(pkg.provenanceDialog).should("not.contain.text", "Built on");
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
describe("with a registry signature only", () => {
|
|
72
|
+
const pkgName = "@verdaccio/signature-fixture";
|
|
73
|
+
let tempFolder = null;
|
|
74
|
+
beforeEach(() => {
|
|
75
|
+
cy.task("publishPackage", {
|
|
76
|
+
pkgName,
|
|
77
|
+
version: "1.0.0",
|
|
78
|
+
unique: true,
|
|
79
|
+
manifest: { dist: { signatures } }
|
|
80
|
+
}).then((result) => {
|
|
81
|
+
tempFolder = result?.tempFolder ?? null;
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
afterEach(() => {
|
|
85
|
+
cy.task("unpublishPackage", {
|
|
86
|
+
pkgName,
|
|
87
|
+
tempFolder: tempFolder ?? void 0
|
|
88
|
+
});
|
|
89
|
+
if (tempFolder) cy.task("cleanupPublished", tempFolder);
|
|
90
|
+
tempFolder = null;
|
|
91
|
+
});
|
|
92
|
+
require_features.maybeIt(features.provenance.sidebarSection)("should show the registry signature chip without requesting build details", () => {
|
|
93
|
+
cy.intercept("GET", `/-/verdaccio/data/package/provenance/${pkgName}*`).as("details");
|
|
94
|
+
cy.visit(`${config.registryUrl}/-/web/detail/${pkgName}`);
|
|
95
|
+
cy.getByTestId(pkg.provenanceBadge).scrollIntoView().should("be.visible").and("contain.text", "Registry signature");
|
|
96
|
+
cy.getByTestId(pkg.provenanceBadge).click();
|
|
97
|
+
cy.getByTestId(pkg.provenanceDialog).within(() => {
|
|
98
|
+
cy.contains(signatures[0].keyid);
|
|
99
|
+
});
|
|
100
|
+
cy.get("@details.all").should("have.length", 0);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
describe("without provenance metadata", () => {
|
|
104
|
+
const pkgName = "@verdaccio/plain-fixture";
|
|
105
|
+
let tempFolder = null;
|
|
106
|
+
beforeEach(() => {
|
|
107
|
+
cy.task("publishPackage", {
|
|
108
|
+
pkgName,
|
|
109
|
+
version: "1.0.0",
|
|
110
|
+
unique: true
|
|
111
|
+
}).then((result) => {
|
|
112
|
+
tempFolder = result?.tempFolder ?? null;
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
afterEach(() => {
|
|
116
|
+
cy.task("unpublishPackage", {
|
|
117
|
+
pkgName,
|
|
118
|
+
tempFolder: tempFolder ?? void 0
|
|
119
|
+
});
|
|
120
|
+
if (tempFolder) cy.task("cleanupPublished", tempFolder);
|
|
121
|
+
tempFolder = null;
|
|
122
|
+
});
|
|
123
|
+
require_features.maybeIt(features.provenance.sidebarSection)("should not render the section", () => {
|
|
124
|
+
cy.visit(`${config.registryUrl}/-/web/detail/${pkgName}`);
|
|
125
|
+
cy.getByTestId(pkg.sidebar).should("be.visible");
|
|
126
|
+
cy.getByTestId(pkg.provenanceBadge).should("not.exist");
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
exports.provenanceTests = provenanceTests;
|
|
132
|
+
|
|
133
|
+
//# sourceMappingURL=provenance.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provenance.cjs","names":[],"sources":["../../../src/tests/provenance.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\nimport { maybeIt } from '../features';\nimport { RegistryConfig } from '../types';\n\n/**\n * \"Provenance\" sidebar section (9.x, verdaccio/verdaccio#6447).\n *\n * registry.npmjs.org attaches `dist.signatures` and `dist.attestations` to\n * every version it signs; the UI shows them without verifying anything in\n * the browser. The fixtures below publish those fields themselves (npm keeps\n * extra `dist` fields on publish), so the suite runs offline and does not\n * need an uplink. The build details come from the registry only when it\n * announces the endpoint, so against this fixture the dialog ends at the\n * summary.\n */\nexport function provenanceTests(config: RegistryConfig) {\n const { features } = config;\n const { package: pkg } = config.testIds;\n\n const attestations = {\n url: 'https://registry.npmjs.org/-/npm/v1/attestations/e2e-provenance@1.0.0',\n provenance: { predicateType: 'https://slsa.dev/provenance/v1' },\n };\n const signatures = [{ keyid: 'SHA256:e2e-fixture-key', sig: 'MEUCIQDe2e' }];\n\n describe('provenance', () => {\n describe('with provenance metadata', () => {\n const pkgName = '@verdaccio/provenance-fixture';\n let tempFolder: string | null = null;\n\n beforeEach(() => {\n cy.task('publishPackage', {\n pkgName,\n version: '1.0.0',\n unique: true,\n manifest: { dist: { signatures, attestations } },\n }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n });\n\n afterEach(() => {\n cy.task('unpublishPackage', { pkgName, tempFolder: tempFolder ?? undefined });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n maybeIt(features.provenance.sidebarSection)(\n 'should show the provenance chip and open the dialog with the summary',\n () => {\n cy.intercept('GET', `/-/verdaccio/data/sidebar/${pkgName}*`).as('sidebar');\n cy.intercept('GET', `/-/verdaccio/data/package/provenance/${pkgName}*`).as('details');\n\n cy.visit(`${config.registryUrl}/-/web/detail/${pkgName}`);\n cy.wait('@sidebar', { timeout: 10000 });\n\n // the sidebar scrolls on its own; bring the chip into its viewport first\n cy.getByTestId(pkg.provenanceBadge)\n .scrollIntoView()\n .should('be.visible')\n .and('contain.text', 'Provenance')\n .and('contain.text', 'SLSA v1');\n\n cy.getByTestId(pkg.provenanceBadge).click();\n cy.getByTestId(pkg.provenanceDialog).should('be.visible');\n cy.getByTestId(pkg.provenanceDialog).within(() => {\n cy.contains(`${pkgName}@`);\n cy.contains('SLSA v1');\n cy.contains(signatures[0].keyid);\n cy.contains('registry.npmjs.org/-/npm/v1/attestations/e2e-provenance@1.0.0').should(\n 'have.attr',\n 'href',\n attestations.url\n );\n cy.contains('cryptographic verification has not been performed');\n });\n\n // the build details are asked for only once the dialog is open; this\n // fixture has no uplink holding the bundle, so the registry answers 404\n // and the dialog keeps the summary\n cy.wait('@details', { timeout: 10000 }).then((interception: any) => {\n expect(interception.response?.statusCode).to.equal(404);\n });\n cy.getByTestId(pkg.provenanceDialog).should('not.contain.text', 'Built on');\n }\n );\n });\n\n describe('with a registry signature only', () => {\n const pkgName = '@verdaccio/signature-fixture';\n let tempFolder: string | null = null;\n\n beforeEach(() => {\n cy.task('publishPackage', {\n pkgName,\n version: '1.0.0',\n unique: true,\n manifest: { dist: { signatures } },\n }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n });\n\n afterEach(() => {\n cy.task('unpublishPackage', { pkgName, tempFolder: tempFolder ?? undefined });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n maybeIt(features.provenance.sidebarSection)(\n 'should show the registry signature chip without requesting build details',\n () => {\n cy.intercept('GET', `/-/verdaccio/data/package/provenance/${pkgName}*`).as('details');\n\n cy.visit(`${config.registryUrl}/-/web/detail/${pkgName}`);\n\n cy.getByTestId(pkg.provenanceBadge)\n .scrollIntoView()\n .should('be.visible')\n .and('contain.text', 'Registry signature');\n cy.getByTestId(pkg.provenanceBadge).click();\n cy.getByTestId(pkg.provenanceDialog).within(() => {\n cy.contains(signatures[0].keyid);\n });\n // no attestation, so the dialog never asks the registry for build details\n cy.get('@details.all').should('have.length', 0);\n }\n );\n });\n\n describe('without provenance metadata', () => {\n const pkgName = '@verdaccio/plain-fixture';\n let tempFolder: string | null = null;\n\n beforeEach(() => {\n cy.task('publishPackage', { pkgName, version: '1.0.0', unique: true }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n });\n\n afterEach(() => {\n cy.task('unpublishPackage', { pkgName, tempFolder: tempFolder ?? undefined });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n maybeIt(features.provenance.sidebarSection)('should not render the section', () => {\n cy.visit(`${config.registryUrl}/-/web/detail/${pkgName}`);\n cy.getByTestId(pkg.sidebar).should('be.visible');\n cy.getByTestId(pkg.provenanceBadge).should('not.exist');\n });\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;;AAeA,SAAgB,gBAAgB,QAAwB;CACtD,MAAM,EAAE,aAAa;CACrB,MAAM,EAAE,SAAS,QAAQ,OAAO;CAEhC,MAAM,eAAe;EACnB,KAAK;EACL,YAAY,EAAE,eAAe,iCAAiC;CAChE;CACA,MAAM,aAAa,CAAC;EAAE,OAAO;EAA0B,KAAK;CAAa,CAAC;CAE1E,SAAS,oBAAoB;EAC3B,SAAS,kCAAkC;GACzC,MAAM,UAAU;GAChB,IAAI,aAA4B;GAEhC,iBAAiB;IACf,GAAG,KAAK,kBAAkB;KACxB;KACA,SAAS;KACT,QAAQ;KACR,UAAU,EAAE,MAAM;MAAE;MAAY;KAAa,EAAE;IACjD,CAAC,CAAC,CAAC,MAAM,WAAW;KAClB,aAAa,QAAQ,cAAc;IACrC,CAAC;GACH,CAAC;GAED,gBAAgB;IACd,GAAG,KAAK,oBAAoB;KAAE;KAAS,YAAY,cAAc,KAAA;IAAU,CAAC;IAC5E,IAAI,YACF,GAAG,KAAK,oBAAoB,UAAU;IAExC,aAAa;GACf,CAAC;GAED,iBAAA,QAAQ,SAAS,WAAW,cAAc,CAAC,CACzC,8EACM;IACJ,GAAG,UAAU,OAAO,6BAA6B,QAAQ,EAAE,C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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_features = require("../features.cjs");
|
|
2
|
-
|
|
2
|
+
// src/tests/publish.ts
|
|
3
3
|
function publishTests(config) {
|
|
4
4
|
const { header, package: pkg } = config.testIds;
|
|
5
5
|
const { markdownBody, loginDialog } = config.selectors;
|
|
@@ -186,7 +186,6 @@ function publishTests(config) {
|
|
|
186
186
|
});
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
|
-
//#endregion
|
|
190
189
|
exports.publishTests = publishTests;
|
|
191
190
|
|
|
192
191
|
//# sourceMappingURL=publish.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_features = require("../features.cjs");
|
|
2
|
-
|
|
2
|
+
// src/tests/search.ts
|
|
3
3
|
/**
|
|
4
4
|
* UI tests for the Verdaccio search box.
|
|
5
5
|
*
|
|
@@ -109,7 +109,6 @@ function getSearchInput() {
|
|
|
109
109
|
function anySearchAlias() {
|
|
110
110
|
return "@webSearch";
|
|
111
111
|
}
|
|
112
|
-
//#endregion
|
|
113
112
|
exports.searchTests = searchTests;
|
|
114
113
|
|
|
115
114
|
//# sourceMappingURL=search.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_features = require("../features.cjs");
|
|
2
|
-
|
|
2
|
+
// src/tests/session.ts
|
|
3
3
|
/**
|
|
4
4
|
* Session lifecycle tests around the token stored in localStorage.
|
|
5
5
|
*
|
|
@@ -43,7 +43,6 @@ function sessionTests(config) {
|
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
//#endregion
|
|
47
46
|
exports.sessionTests = sessionTests;
|
|
48
47
|
|
|
49
48
|
//# sourceMappingURL=session.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_features = require("../features.cjs");
|
|
2
|
-
|
|
2
|
+
// src/tests/settings.ts
|
|
3
3
|
/**
|
|
4
4
|
* Tests for the header Settings dialog and the Translations (language)
|
|
5
5
|
* picker inside it.
|
|
@@ -93,7 +93,6 @@ function settingsTests(config) {
|
|
|
93
93
|
});
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
//#endregion
|
|
97
96
|
exports.settingsTests = settingsTests;
|
|
98
97
|
|
|
99
98
|
//# sourceMappingURL=settings.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_features = require("../features.cjs");
|
|
2
|
-
|
|
2
|
+
// src/tests/signin.ts
|
|
3
3
|
function signinTests(config) {
|
|
4
4
|
const { header, login } = config.testIds;
|
|
5
5
|
const { loginDialog } = config.selectors;
|
|
@@ -54,7 +54,6 @@ function signinTests(config) {
|
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
//#endregion
|
|
58
57
|
exports.signinTests = signinTests;
|
|
59
58
|
|
|
60
59
|
//# sourceMappingURL=signin.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_features = require("../features.cjs");
|
|
2
|
-
|
|
2
|
+
// src/tests/signup.ts
|
|
3
3
|
/**
|
|
4
4
|
* Create-user (web signup) tests.
|
|
5
5
|
*
|
|
@@ -50,7 +50,6 @@ function signupTests(config) {
|
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
//#endregion
|
|
54
53
|
exports.signupTests = signupTests;
|
|
55
54
|
|
|
56
55
|
//# sourceMappingURL=signup.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/commands/index.ts
|
|
2
2
|
/**
|
|
3
3
|
* Default login form selectors. Kept in sync with `DEFAULT_SELECTORS`
|
|
4
4
|
* in ../testIds.ts — duplicating them here (as plain constants) lets
|
|
@@ -34,7 +34,6 @@ Cypress.Commands.add("login", (user, password, selectors = {}) => {
|
|
|
34
34
|
cy.wait(500);
|
|
35
35
|
cy.get(submitButton).click();
|
|
36
36
|
});
|
|
37
|
-
//#endregion
|
|
38
37
|
export {};
|
|
39
38
|
|
|
40
39
|
//# sourceMappingURL=index.js.map
|
package/build/esm/features.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/features.ts
|
|
2
2
|
/** Defaults: all flags on. */
|
|
3
3
|
var DEFAULT_FEATURES = {
|
|
4
4
|
search: {
|
|
@@ -57,6 +57,7 @@ var DEFAULT_FEATURES = {
|
|
|
57
57
|
versionLink: false,
|
|
58
58
|
settingsPublishTab: false
|
|
59
59
|
},
|
|
60
|
+
provenance: { sidebarSection: false },
|
|
60
61
|
changePassword: {
|
|
61
62
|
happyPath: true,
|
|
62
63
|
validation: true,
|
|
@@ -122,6 +123,10 @@ function mergeFeatures(defaults, overrides) {
|
|
|
122
123
|
...defaults.homeDetailUx,
|
|
123
124
|
...overrides.homeDetailUx
|
|
124
125
|
},
|
|
126
|
+
provenance: {
|
|
127
|
+
...defaults.provenance,
|
|
128
|
+
...overrides.provenance
|
|
129
|
+
},
|
|
125
130
|
changePassword: {
|
|
126
131
|
...defaults.changePassword,
|
|
127
132
|
...overrides.changePassword
|
|
@@ -137,7 +142,6 @@ function mergeFeatures(defaults, overrides) {
|
|
|
137
142
|
function maybeIt(enabled) {
|
|
138
143
|
return enabled ? it : it.skip;
|
|
139
144
|
}
|
|
140
|
-
//#endregion
|
|
141
145
|
export { DEFAULT_FEATURES, maybeIt, mergeFeatures };
|
|
142
146
|
|
|
143
147
|
//# sourceMappingURL=features.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.js","names":[],"sources":["../../src/features.ts"],"sourcesContent":["import type { DeepPartial } from './testIds';\n\n/**\n * Per-test feature flags for enabling/disabling individual test cases\n * in the e2e-ui suites.\n *\n * The Verdaccio UI behaves differently across branches — search result\n * payload shape differs between the `/-/v1/search` and\n * `/-/verdaccio/data/search/*` endpoints, the language picker was\n * added in a specific minor, etc. Rather than forking the suite per\n * branch, consumers can disable individual tests via\n * `createRegistryConfig({ features: { … } })`.\n *\n * Most flags default to `true` (test runs). Compatibility probes for\n * unreleased server behavior may default to `false`; enable them in\n * consumers that run against a Verdaccio build with the feature.\n * A disabled flag converts the test into a Mocha `it.skip` call — the\n * suite still reports the test but marks it as pending.\n */\nexport interface Features {\n search: {\n /**\n * Whether to run the \"results dropdown renders a matching\n * package\" test. Disable on builds where the search result shape\n * or the Autocomplete rendering differs from the default assumption.\n */\n resultsDropdown: boolean;\n /**\n * Whether to run the \"clicking a result navigates to detail\" test.\n * Depends on the Autocomplete `onSelectItem` → router wiring.\n */\n resultClickNavigation: boolean;\n };\n home: {\n /**\n * Whether to run the `with a published package` sub-block inside\n * `homeTests` (publishes a throwaway package and asserts it\n * renders in the package list).\n */\n publishedPackageRendering: boolean;\n };\n settings: {\n /**\n * Whether to run the \"change language via card click\" test.\n * Depends on the `LanguageSwitch` component layout and its\n * translation sentinels (\"Translations\", \"German\"). Skip on\n * builds that lag behind the upstream translation file.\n */\n languageSwitcher: boolean;\n /**\n * Whether to assert that dates follow the selected language\n * (dayjs locale). Released UIs never load the dayjs locale, so\n * relative dates stay English in every language (fixed in\n * verdaccio/verdaccio#6210) — probe.\n */\n localizedDates: boolean;\n };\n signin: {\n /**\n * Whether to run the three validation tests (disabled submit\n * button, invalid credentials error banner). Depends on the\n * current yup schema and the hard-coded \"Invalid username or\n * password\" error string.\n */\n validationTests: boolean;\n };\n layout: {\n /**\n * Whether to run the dark/light theme switch test. Depends on\n * `web.showThemeSwitch` (defaults to true in ui-theme) and the\n * `header--button--light` / `header--button--dark` testids.\n */\n themeSwitch: boolean;\n };\n publish: {\n /**\n * Whether to run the \"tarball download button fires a GET\" test.\n * Depends on `web.showDownloadTarball` (defaults to true) and\n * the published package manifest having a valid `dist.tarball`.\n */\n downloadTarball: boolean;\n /**\n * Whether to run the private package tarball download tests from\n * the Web UI package list and sidebar.\n *\n * Enable only on Verdaccio builds that accept Web UI bearer tokens\n * on protected npm package/tarball routes. Verdaccio 6.x currently\n * returns HTTP 401 for this flow; the regression is tracked in\n * verdaccio/verdaccio#5765.\n */\n privateDownloadTarball: boolean;\n /**\n * Whether to run the \"raw viewer dialog opens + closes\" test.\n * Depends on `web.showRaw` (defaults to true).\n */\n rawViewer: boolean;\n };\n detail: {\n /**\n * Whether to run the \"visiting /v/<version> pins that version\" test\n * (asserts the sidebar request carries `?v=<version>`).\n */\n versionPinned: boolean;\n /**\n * Whether to run the wire-format test for scoped packages: the UI\n * must request `/-/verdaccio/data/sidebar/@scope/name` with the `@`\n * and `/` literal (npm registry convention), never `%40`-encoded.\n * Pins the regression caught by these suites in\n * verdaccio/verdaccio#6210.\n */\n scopedWireFormat: boolean;\n /**\n * Whether to run the \"nonexistent version renders Not Found\" test.\n * Requires the server to answer 404 for unknown `?v=` values\n * (verdaccio/verdaccio#6210); released lines silently fall back to\n * `latest`, so this defaults to `false` as a probe.\n */\n versionNotFound: boolean;\n /**\n * Whether to run the \"versions tab shows the CURRENT package after\n * SPA navigation\" test. The detail routes reuse one mounted\n * component, and released UIs cache the previous package's versions\n * in local state (fixed in verdaccio/verdaccio#6210) — defaults to\n * `false` as a probe.\n */\n staleVersionsNavigation: boolean;\n };\n manifestRendering: {\n /**\n * Whether to run the string-form manifest tests: `repository`,\n * `funding` and `bugs` in their string/array forms are valid npm\n * and must render (fixed in verdaccio/verdaccio#6210) — probe.\n */\n stringForms: boolean;\n /**\n * Whether to assert gravatar avatars render on the detail sidebar.\n * Released UIs read `avatar` while the sidebar endpoint sends\n * `_avatar` (fixed in verdaccio/verdaccio#6210) — probe.\n */\n gravatarAvatars: boolean;\n /**\n * Whether to assert contributors without email don't collapse into\n * one (fixed in verdaccio/verdaccio#6210) — probe.\n */\n developersWithoutEmail: boolean;\n };\n session: {\n /**\n * Whether to assert that an expired token in localStorage boots the\n * UI logged out (header shows the login button). Holds on every\n * released line.\n */\n expiredTokenLoggedOut: boolean;\n /**\n * Whether to assert the expired token is also PURGED from\n * localStorage on boot — otherwise the api client keeps attaching\n * it (fixed in verdaccio/verdaccio#6210) — probe.\n */\n expiredTokenPurged: boolean;\n };\n failureModes: {\n /**\n * Whether to run the \"backend 5xx on the package list must not\n * render the empty-registry onboarding\" test. Holds on every line\n * (a 5xx carries an HTTP code the UI always treated as an error).\n */\n homeServerError: boolean;\n /**\n * Whether to run the network-failure variant (request never\n * reaches the server). Released UIs treat a network failure as an\n * empty registry and show the onboarding card\n * (verdaccio/verdaccio#6210 fixes it), so this defaults to `false`\n * as a probe.\n */\n homeNetworkError: boolean;\n /**\n * Whether to run the \"5xx on the detail page renders an error\n * state instead of a blank page\" test. Requires the generic error\n * page from verdaccio/verdaccio#6210; released UIs render blank,\n * so this defaults to `false` as a probe.\n */\n detailErrorState: boolean;\n /**\n * Whether to run the \"search 5xx shows an error, not 'no results\n * found'\" test. The error state ships with verdaccio/verdaccio#6210\n * — probe.\n */\n searchError: boolean;\n /**\n * Whether to run the \"failed tarball download shows an error\n * snackbar\" test — clicking download and having nothing happen sent\n * users retrying blindly (fixed in verdaccio/verdaccio#6210) — probe.\n */\n downloadError: boolean;\n };\n i18n: {\n /**\n * Whether to scan the home and detail pages for raw i18n keys\n * (visible text like `sidebar.detail.version`). Holds on every\n * released line — these pages ship fully translated.\n */\n noRawKeysCorePages: boolean;\n /**\n * Whether to scan the security pages (login dialog, /-/web/login,\n * add-user, change-password) for raw i18n keys. The whole\n * `security.*` namespace is missing from every published ui-theme\n * bundle (fixed in verdaccio/verdaccio#6210), so this defaults to\n * `false` as a probe.\n */\n noRawKeysSecurityPages: boolean;\n };\n signup: {\n /**\n * Whether to run the create-user happy path (fill the form on\n * /-/web/add-user, submit, land on the success page) and assert\n * the wire contract: `PUT /-/verdaccio/sec/signup` with a 36-char\n * `sessionId`. Requires the server flag `createUser: true` AND the\n * fixed signup form from verdaccio/verdaccio#6210 — every\n * published ui-theme posts to a URL that only serves the SPA, so\n * this defaults to `false` as a probe.\n */\n happyPath: boolean;\n /**\n * Whether to run the client-side validation tests on the add-user\n * form (invalid email shows a message, url-unsafe username blocks\n * submit). Same requirements as `happyPath`.\n */\n validation: boolean;\n };\n homeDetailUx: {\n /**\n * Whether to run the home toolbar tests: filter narrows the list and\n * lives in `?q=`, `?scope=` restores the scope, no-match message.\n * Ships with the 9.x home toolbar — probe, defaults to `false`.\n */\n homeToolbar: boolean;\n /**\n * Whether to assert the package page tab lives in `?tab=` (click\n * writes it, a link opens it, readme removes it) — probe.\n */\n detailTabInUrl: boolean;\n /**\n * Whether to assert the step-by-step welcome card (setup tabs per\n * package manager, `.npmrc` tab, uplinks note) — probe.\n */\n welcomeGuide: boolean;\n /**\n * Whether to assert the sidebar install box lists `bun` and the\n * `.npmrc` registry line. Needs `bun` in `web.pkgManagers` (default\n * on 9.x) — probe.\n */\n installBunAndNpmrc: boolean;\n /**\n * Whether to assert that a copy button confirms the copy (its\n * accessible name switches to \"Copied\") — probe.\n */\n copyFeedback: boolean;\n /**\n * Whether to assert search results are grouped by origin and a\n * locally published package lands in the \"published here\" group.\n * Needs `web.showUplinks` (default true) — probe.\n */\n searchGrouping: boolean;\n /**\n * Whether to assert that the version on each home list item links\n * to its version page `/-/web/detail/<name>/v/<version>` — probe.\n */\n versionLink: boolean;\n /**\n * Whether to assert the settings dialog has a \"Publishing\" tab with\n * the welcome guide, so it stays reachable once packages exist — probe.\n */\n settingsPublishTab: boolean;\n };\n changePassword: {\n /**\n * Whether to run the happy-path test (submit valid change,\n * expect navigation to the success page, then restore the\n * original password in `after()`).\n *\n * The suite targets /-/web/change-password, which renders only\n * when the server is configured with `flags.changePassword: true`.\n * Disable on registries that do not enable the flag.\n *\n * Also disable on **published verdaccio 6.x** (all lines through\n * 6.5.0): the reset_password handler in\n * `verdaccio/build/api/web/api/user.js` ships with an inverted\n * conditional — `validatePassword(...) === false` gates the\n * `auth.changePassword(...)` call, so a *valid* new password\n * always returns HTTP 400 (`PASSWORD_VALIDATION`). The bug is\n * fixed on the development branch but has not been released\n * in any 6.x tag, so the happy path cannot succeed against an\n * `npm install verdaccio@6` runtime.\n */\n happyPath: boolean;\n /**\n * Whether to run the client-side validation tests (submit button\n * stays disabled while fields are empty / mismatched confirm).\n * Depends on the yup `changePasswordSchema`.\n */\n validation: boolean;\n /**\n * Whether to run the \"wrong old password shows error banner\" test.\n * Depends on the server rejecting the call and the onSubmit catch\n * block surfacing `\"Failed to change password\"` via\n * `LoginDialogFormError`.\n */\n wrongOldPassword: boolean;\n };\n}\n\n/** Defaults: all flags on. */\nexport const DEFAULT_FEATURES: Features = {\n search: {\n resultsDropdown: true,\n resultClickNavigation: true,\n },\n home: {\n publishedPackageRendering: true,\n },\n settings: {\n languageSwitcher: true,\n localizedDates: false,\n },\n signin: {\n validationTests: true,\n },\n layout: {\n themeSwitch: true,\n },\n publish: {\n downloadTarball: true,\n privateDownloadTarball: false,\n rawViewer: true,\n },\n detail: {\n versionPinned: true,\n scopedWireFormat: true,\n versionNotFound: false,\n staleVersionsNavigation: false,\n },\n manifestRendering: {\n stringForms: false,\n gravatarAvatars: false,\n developersWithoutEmail: false,\n },\n session: {\n expiredTokenLoggedOut: true,\n expiredTokenPurged: false,\n },\n failureModes: {\n homeServerError: true,\n homeNetworkError: false,\n detailErrorState: false,\n searchError: false,\n downloadError: false,\n },\n i18n: {\n noRawKeysCorePages: true,\n noRawKeysSecurityPages: false,\n },\n signup: {\n happyPath: false,\n validation: false,\n },\n homeDetailUx: {\n homeToolbar: false,\n detailTabInUrl: false,\n welcomeGuide: false,\n installBunAndNpmrc: false,\n copyFeedback: false,\n searchGrouping: false,\n versionLink: false,\n settingsPublishTab: false,\n },\n changePassword: {\n happyPath: true,\n validation: true,\n wrongOldPassword: true,\n },\n};\n\n/**\n * Merge user overrides into the default feature flags. Per-section,\n * one level deep — matching the style of `mergeTestIds`.\n */\nexport function mergeFeatures(defaults: Features, overrides?: DeepPartial<Features>): Features {\n if (!overrides) return defaults;\n return {\n search: { ...defaults.search, ...overrides.search },\n home: { ...defaults.home, ...overrides.home },\n settings: { ...defaults.settings, ...overrides.settings },\n signin: { ...defaults.signin, ...overrides.signin },\n layout: { ...defaults.layout, ...overrides.layout },\n publish: { ...defaults.publish, ...overrides.publish },\n detail: { ...defaults.detail, ...overrides.detail },\n manifestRendering: { ...defaults.manifestRendering, ...overrides.manifestRendering },\n session: { ...defaults.session, ...overrides.session },\n failureModes: { ...defaults.failureModes, ...overrides.failureModes },\n i18n: { ...defaults.i18n, ...overrides.i18n },\n signup: { ...defaults.signup, ...overrides.signup },\n homeDetailUx: { ...defaults.homeDetailUx, ...overrides.homeDetailUx },\n changePassword: { ...defaults.changePassword, ...overrides.changePassword },\n };\n}\n\n/**\n * Helper that returns either `it` or `it.skip` depending on an\n * enabled flag. Usage:\n *\n * maybeIt(features.search.resultsDropdown)('…', () => { … });\n */\nexport function maybeIt(enabled: boolean): Mocha.TestFunction | Mocha.PendingTestFunction {\n return enabled ? it : it.skip;\n}\n"],"mappings":";;AAwTA,IAAa,mBAA6B;CACxC,QAAQ;EACN,iBAAiB;EACjB,uBAAuB;CACzB;CACA,MAAM,EACJ,2BAA2B,KAC7B;CACA,UAAU;EACR,kBAAkB;EAClB,gBAAgB;CAClB;CACA,QAAQ,EACN,iBAAiB,KACnB;CACA,QAAQ,EACN,aAAa,KACf;CACA,SAAS;EACP,iBAAiB;EACjB,wBAAwB;EACxB,WAAW;CACb;CACA,QAAQ;EACN,eAAe;EACf,kBAAkB;EAClB,iBAAiB;EACjB,yBAAyB;CAC3B;CACA,mBAAmB;EACjB,aAAa;EACb,iBAAiB;EACjB,wBAAwB;CAC1B;CACA,SAAS;EACP,uBAAuB;EACvB,oBAAoB;CACtB;CACA,cAAc;EACZ,iBAAiB;EACjB,kBAAkB;EAClB,kBAAkB;EAClB,aAAa;EACb,eAAe;CACjB;CACA,MAAM;EACJ,oBAAoB;EACpB,wBAAwB;CAC1B;CACA,QAAQ;EACN,WAAW;EACX,YAAY;CACd;CACA,cAAc;EACZ,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,oBAAoB;EACpB,cAAc;EACd,gBAAgB;EAChB,aAAa;EACb,oBAAoB;CACtB;CACA,gBAAgB;EACd,WAAW;EACX,YAAY;EACZ,kBAAkB;CACpB;AACF;;;;;AAMA,SAAgB,cAAc,UAAoB,WAA6C;CAC7F,IAAI,CAAC,WAAW,OAAO;CACvB,OAAO;EACL,QAAQ;GAAE,GAAG,SAAS;GAAQ,GAAG,UAAU;EAAO;EAClD,MAAM;GAAE,GAAG,SAAS;GAAM,GAAG,UAAU;EAAK;EAC5C,UAAU;GAAE,GAAG,SAAS;GAAU,GAAG,UAAU;EAAS;EACxD,QAAQ;GAAE,GAAG,SAAS;GAAQ,GAAG,UAAU;EAAO;EAClD,QAAQ;GAAE,GAAG,SAAS;GAAQ,GAAG,UAAU;EAAO;EAClD,SAAS;GAAE,GAAG,SAAS;GAAS,GAAG,UAAU;EAAQ;EACrD,QAAQ;GAAE,GAAG,SAAS;GAAQ,GAAG,UAAU;EAAO;EAClD,mBAAmB;GAAE,GAAG,SAAS;GAAmB,GAAG,UAAU;EAAkB;EACnF,SAAS;GAAE,GAAG,SAAS;GAAS,GAAG,UAAU;EAAQ;EACrD,cAAc;GAAE,GAAG,SAAS;GAAc,GAAG,UAAU;EAAa;EACpE,MAAM;GAAE,GAAG,SAAS;GAAM,GAAG,UAAU;EAAK;EAC5C,QAAQ;GAAE,GAAG,SAAS;GAAQ,GAAG,UAAU;EAAO;EAClD,cAAc;GAAE,GAAG,SAAS;GAAc,GAAG,UAAU;EAAa;EACpE,gBAAgB;GAAE,GAAG,SAAS;GAAgB,GAAG,UAAU;EAAe;CAC5E;AACF;;;;;;;AAQA,SAAgB,QAAQ,SAAkE;CACxF,OAAO,UAAU,KAAK,GAAG;AAC3B"}
|
|
1
|
+
{"version":3,"file":"features.js","names":[],"sources":["../../src/features.ts"],"sourcesContent":["import type { DeepPartial } from './testIds';\n\n/**\n * Per-test feature flags for enabling/disabling individual test cases\n * in the e2e-ui suites.\n *\n * The Verdaccio UI behaves differently across branches — search result\n * payload shape differs between the `/-/v1/search` and\n * `/-/verdaccio/data/search/*` endpoints, the language picker was\n * added in a specific minor, etc. Rather than forking the suite per\n * branch, consumers can disable individual tests via\n * `createRegistryConfig({ features: { … } })`.\n *\n * Most flags default to `true` (test runs). Compatibility probes for\n * unreleased server behavior may default to `false`; enable them in\n * consumers that run against a Verdaccio build with the feature.\n * A disabled flag converts the test into a Mocha `it.skip` call — the\n * suite still reports the test but marks it as pending.\n */\nexport interface Features {\n search: {\n /**\n * Whether to run the \"results dropdown renders a matching\n * package\" test. Disable on builds where the search result shape\n * or the Autocomplete rendering differs from the default assumption.\n */\n resultsDropdown: boolean;\n /**\n * Whether to run the \"clicking a result navigates to detail\" test.\n * Depends on the Autocomplete `onSelectItem` → router wiring.\n */\n resultClickNavigation: boolean;\n };\n home: {\n /**\n * Whether to run the `with a published package` sub-block inside\n * `homeTests` (publishes a throwaway package and asserts it\n * renders in the package list).\n */\n publishedPackageRendering: boolean;\n };\n settings: {\n /**\n * Whether to run the \"change language via card click\" test.\n * Depends on the `LanguageSwitch` component layout and its\n * translation sentinels (\"Translations\", \"German\"). Skip on\n * builds that lag behind the upstream translation file.\n */\n languageSwitcher: boolean;\n /**\n * Whether to assert that dates follow the selected language\n * (dayjs locale). Released UIs never load the dayjs locale, so\n * relative dates stay English in every language (fixed in\n * verdaccio/verdaccio#6210) — probe.\n */\n localizedDates: boolean;\n };\n signin: {\n /**\n * Whether to run the three validation tests (disabled submit\n * button, invalid credentials error banner). Depends on the\n * current yup schema and the hard-coded \"Invalid username or\n * password\" error string.\n */\n validationTests: boolean;\n };\n layout: {\n /**\n * Whether to run the dark/light theme switch test. Depends on\n * `web.showThemeSwitch` (defaults to true in ui-theme) and the\n * `header--button--light` / `header--button--dark` testids.\n */\n themeSwitch: boolean;\n };\n publish: {\n /**\n * Whether to run the \"tarball download button fires a GET\" test.\n * Depends on `web.showDownloadTarball` (defaults to true) and\n * the published package manifest having a valid `dist.tarball`.\n */\n downloadTarball: boolean;\n /**\n * Whether to run the private package tarball download tests from\n * the Web UI package list and sidebar.\n *\n * Enable only on Verdaccio builds that accept Web UI bearer tokens\n * on protected npm package/tarball routes. Verdaccio 6.x currently\n * returns HTTP 401 for this flow; the regression is tracked in\n * verdaccio/verdaccio#5765.\n */\n privateDownloadTarball: boolean;\n /**\n * Whether to run the \"raw viewer dialog opens + closes\" test.\n * Depends on `web.showRaw` (defaults to true).\n */\n rawViewer: boolean;\n };\n detail: {\n /**\n * Whether to run the \"visiting /v/<version> pins that version\" test\n * (asserts the sidebar request carries `?v=<version>`).\n */\n versionPinned: boolean;\n /**\n * Whether to run the wire-format test for scoped packages: the UI\n * must request `/-/verdaccio/data/sidebar/@scope/name` with the `@`\n * and `/` literal (npm registry convention), never `%40`-encoded.\n * Pins the regression caught by these suites in\n * verdaccio/verdaccio#6210.\n */\n scopedWireFormat: boolean;\n /**\n * Whether to run the \"nonexistent version renders Not Found\" test.\n * Requires the server to answer 404 for unknown `?v=` values\n * (verdaccio/verdaccio#6210); released lines silently fall back to\n * `latest`, so this defaults to `false` as a probe.\n */\n versionNotFound: boolean;\n /**\n * Whether to run the \"versions tab shows the CURRENT package after\n * SPA navigation\" test. The detail routes reuse one mounted\n * component, and released UIs cache the previous package's versions\n * in local state (fixed in verdaccio/verdaccio#6210) — defaults to\n * `false` as a probe.\n */\n staleVersionsNavigation: boolean;\n };\n manifestRendering: {\n /**\n * Whether to run the string-form manifest tests: `repository`,\n * `funding` and `bugs` in their string/array forms are valid npm\n * and must render (fixed in verdaccio/verdaccio#6210) — probe.\n */\n stringForms: boolean;\n /**\n * Whether to assert gravatar avatars render on the detail sidebar.\n * Released UIs read `avatar` while the sidebar endpoint sends\n * `_avatar` (fixed in verdaccio/verdaccio#6210) — probe.\n */\n gravatarAvatars: boolean;\n /**\n * Whether to assert contributors without email don't collapse into\n * one (fixed in verdaccio/verdaccio#6210) — probe.\n */\n developersWithoutEmail: boolean;\n };\n session: {\n /**\n * Whether to assert that an expired token in localStorage boots the\n * UI logged out (header shows the login button). Holds on every\n * released line.\n */\n expiredTokenLoggedOut: boolean;\n /**\n * Whether to assert the expired token is also PURGED from\n * localStorage on boot — otherwise the api client keeps attaching\n * it (fixed in verdaccio/verdaccio#6210) — probe.\n */\n expiredTokenPurged: boolean;\n };\n failureModes: {\n /**\n * Whether to run the \"backend 5xx on the package list must not\n * render the empty-registry onboarding\" test. Holds on every line\n * (a 5xx carries an HTTP code the UI always treated as an error).\n */\n homeServerError: boolean;\n /**\n * Whether to run the network-failure variant (request never\n * reaches the server). Released UIs treat a network failure as an\n * empty registry and show the onboarding card\n * (verdaccio/verdaccio#6210 fixes it), so this defaults to `false`\n * as a probe.\n */\n homeNetworkError: boolean;\n /**\n * Whether to run the \"5xx on the detail page renders an error\n * state instead of a blank page\" test. Requires the generic error\n * page from verdaccio/verdaccio#6210; released UIs render blank,\n * so this defaults to `false` as a probe.\n */\n detailErrorState: boolean;\n /**\n * Whether to run the \"search 5xx shows an error, not 'no results\n * found'\" test. The error state ships with verdaccio/verdaccio#6210\n * — probe.\n */\n searchError: boolean;\n /**\n * Whether to run the \"failed tarball download shows an error\n * snackbar\" test — clicking download and having nothing happen sent\n * users retrying blindly (fixed in verdaccio/verdaccio#6210) — probe.\n */\n downloadError: boolean;\n };\n i18n: {\n /**\n * Whether to scan the home and detail pages for raw i18n keys\n * (visible text like `sidebar.detail.version`). Holds on every\n * released line — these pages ship fully translated.\n */\n noRawKeysCorePages: boolean;\n /**\n * Whether to scan the security pages (login dialog, /-/web/login,\n * add-user, change-password) for raw i18n keys. The whole\n * `security.*` namespace is missing from every published ui-theme\n * bundle (fixed in verdaccio/verdaccio#6210), so this defaults to\n * `false` as a probe.\n */\n noRawKeysSecurityPages: boolean;\n };\n signup: {\n /**\n * Whether to run the create-user happy path (fill the form on\n * /-/web/add-user, submit, land on the success page) and assert\n * the wire contract: `PUT /-/verdaccio/sec/signup` with a 36-char\n * `sessionId`. Requires the server flag `createUser: true` AND the\n * fixed signup form from verdaccio/verdaccio#6210 — every\n * published ui-theme posts to a URL that only serves the SPA, so\n * this defaults to `false` as a probe.\n */\n happyPath: boolean;\n /**\n * Whether to run the client-side validation tests on the add-user\n * form (invalid email shows a message, url-unsafe username blocks\n * submit). Same requirements as `happyPath`.\n */\n validation: boolean;\n };\n homeDetailUx: {\n /**\n * Whether to run the home toolbar tests: filter narrows the list and\n * lives in `?q=`, `?scope=` restores the scope, no-match message.\n * Ships with the 9.x home toolbar — probe, defaults to `false`.\n */\n homeToolbar: boolean;\n /**\n * Whether to assert the package page tab lives in `?tab=` (click\n * writes it, a link opens it, readme removes it) — probe.\n */\n detailTabInUrl: boolean;\n /**\n * Whether to assert the step-by-step welcome card (setup tabs per\n * package manager, `.npmrc` tab, uplinks note) — probe.\n */\n welcomeGuide: boolean;\n /**\n * Whether to assert the sidebar install box lists `bun` and the\n * `.npmrc` registry line. Needs `bun` in `web.pkgManagers` (default\n * on 9.x) — probe.\n */\n installBunAndNpmrc: boolean;\n /**\n * Whether to assert that a copy button confirms the copy (its\n * accessible name switches to \"Copied\") — probe.\n */\n copyFeedback: boolean;\n /**\n * Whether to assert search results are grouped by origin and a\n * locally published package lands in the \"published here\" group.\n * Needs `web.showUplinks` (default true) — probe.\n */\n searchGrouping: boolean;\n /**\n * Whether to assert that the version on each home list item links\n * to its version page `/-/web/detail/<name>/v/<version>` — probe.\n */\n versionLink: boolean;\n /**\n * Whether to assert the settings dialog has a \"Publishing\" tab with\n * the welcome guide, so it stays reachable once packages exist — probe.\n */\n settingsPublishTab: boolean;\n };\n provenance: {\n /**\n * Whether to run the \"Provenance\" sidebar section tests: a version\n * carrying `dist.attestations` or `dist.signatures` shows a chip\n * under \"Distribution\" that opens a dialog with the statement type,\n * the signing key ids and a link to the attestation bundle, and the\n * build details are only requested when the server announces the\n * endpoint (`capabilities.provenance`). Ships with 9.x\n * (verdaccio/verdaccio#6447) — probe, defaults to `false`.\n */\n sidebarSection: boolean;\n };\n changePassword: {\n /**\n * Whether to run the happy-path test (submit valid change,\n * expect navigation to the success page, then restore the\n * original password in `after()`).\n *\n * The suite targets /-/web/change-password, which renders only\n * when the server is configured with `flags.changePassword: true`.\n * Disable on registries that do not enable the flag.\n *\n * Also disable on **published verdaccio 6.x** (all lines through\n * 6.5.0): the reset_password handler in\n * `verdaccio/build/api/web/api/user.js` ships with an inverted\n * conditional — `validatePassword(...) === false` gates the\n * `auth.changePassword(...)` call, so a *valid* new password\n * always returns HTTP 400 (`PASSWORD_VALIDATION`). The bug is\n * fixed on the development branch but has not been released\n * in any 6.x tag, so the happy path cannot succeed against an\n * `npm install verdaccio@6` runtime.\n */\n happyPath: boolean;\n /**\n * Whether to run the client-side validation tests (submit button\n * stays disabled while fields are empty / mismatched confirm).\n * Depends on the yup `changePasswordSchema`.\n */\n validation: boolean;\n /**\n * Whether to run the \"wrong old password shows error banner\" test.\n * Depends on the server rejecting the call and the onSubmit catch\n * block surfacing `\"Failed to change password\"` via\n * `LoginDialogFormError`.\n */\n wrongOldPassword: boolean;\n };\n}\n\n/** Defaults: all flags on. */\nexport const DEFAULT_FEATURES: Features = {\n search: {\n resultsDropdown: true,\n resultClickNavigation: true,\n },\n home: {\n publishedPackageRendering: true,\n },\n settings: {\n languageSwitcher: true,\n localizedDates: false,\n },\n signin: {\n validationTests: true,\n },\n layout: {\n themeSwitch: true,\n },\n publish: {\n downloadTarball: true,\n privateDownloadTarball: false,\n rawViewer: true,\n },\n detail: {\n versionPinned: true,\n scopedWireFormat: true,\n versionNotFound: false,\n staleVersionsNavigation: false,\n },\n manifestRendering: {\n stringForms: false,\n gravatarAvatars: false,\n developersWithoutEmail: false,\n },\n session: {\n expiredTokenLoggedOut: true,\n expiredTokenPurged: false,\n },\n failureModes: {\n homeServerError: true,\n homeNetworkError: false,\n detailErrorState: false,\n searchError: false,\n downloadError: false,\n },\n i18n: {\n noRawKeysCorePages: true,\n noRawKeysSecurityPages: false,\n },\n signup: {\n happyPath: false,\n validation: false,\n },\n homeDetailUx: {\n homeToolbar: false,\n detailTabInUrl: false,\n welcomeGuide: false,\n installBunAndNpmrc: false,\n copyFeedback: false,\n searchGrouping: false,\n versionLink: false,\n settingsPublishTab: false,\n },\n provenance: {\n sidebarSection: false,\n },\n changePassword: {\n happyPath: true,\n validation: true,\n wrongOldPassword: true,\n },\n};\n\n/**\n * Merge user overrides into the default feature flags. Per-section,\n * one level deep — matching the style of `mergeTestIds`.\n */\nexport function mergeFeatures(defaults: Features, overrides?: DeepPartial<Features>): Features {\n if (!overrides) return defaults;\n return {\n search: { ...defaults.search, ...overrides.search },\n home: { ...defaults.home, ...overrides.home },\n settings: { ...defaults.settings, ...overrides.settings },\n signin: { ...defaults.signin, ...overrides.signin },\n layout: { ...defaults.layout, ...overrides.layout },\n publish: { ...defaults.publish, ...overrides.publish },\n detail: { ...defaults.detail, ...overrides.detail },\n manifestRendering: { ...defaults.manifestRendering, ...overrides.manifestRendering },\n session: { ...defaults.session, ...overrides.session },\n failureModes: { ...defaults.failureModes, ...overrides.failureModes },\n i18n: { ...defaults.i18n, ...overrides.i18n },\n signup: { ...defaults.signup, ...overrides.signup },\n homeDetailUx: { ...defaults.homeDetailUx, ...overrides.homeDetailUx },\n provenance: { ...defaults.provenance, ...overrides.provenance },\n changePassword: { ...defaults.changePassword, ...overrides.changePassword },\n };\n}\n\n/**\n * Helper that returns either `it` or `it.skip` depending on an\n * enabled flag. Usage:\n *\n * maybeIt(features.search.resultsDropdown)('…', () => { … });\n */\nexport function maybeIt(enabled: boolean): Mocha.TestFunction | Mocha.PendingTestFunction {\n return enabled ? it : it.skip;\n}\n"],"mappings":";;AAoUA,IAAa,mBAA6B;CACxC,QAAQ;EACN,iBAAiB;EACjB,uBAAuB;CACzB;CACA,MAAM,EACJ,2BAA2B,KAC7B;CACA,UAAU;EACR,kBAAkB;EAClB,gBAAgB;CAClB;CACA,QAAQ,EACN,iBAAiB,KACnB;CACA,QAAQ,EACN,aAAa,KACf;CACA,SAAS;EACP,iBAAiB;EACjB,wBAAwB;EACxB,WAAW;CACb;CACA,QAAQ;EACN,eAAe;EACf,kBAAkB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,GAAG,SAAS;GAAQ,GAAG,UAAU;EAAO;EAClD,cAAc;GAAE,GAAG,SAAS;GAAc,GAAG,UAAU;EAAa;EACpE,YAAY;GAAE,GAAG,SAAS;GAAY,GAAG,UAAU;EAAW;EAC9D,gBAAgB;GAAE,GAAG,SAAS;GAAgB,GAAG,UAAU;EAAe;CAC5E;AACF;;;;;;;AAQA,SAAgB,QAAQ,SAAkE;CACxF,OAAO,UAAU,KAAK,GAAG;AAC3B"}
|
package/build/esm/index.js
CHANGED
|
@@ -15,9 +15,11 @@ import { signupTests } from "./tests/signup.js";
|
|
|
15
15
|
import { manifestRenderingTests } from "./tests/manifest-rendering.js";
|
|
16
16
|
import { sessionTests } from "./tests/session.js";
|
|
17
17
|
import { homeDetailUxTests } from "./tests/home-detail-ux.js";
|
|
18
|
+
import { provenanceTests } from "./tests/provenance.js";
|
|
19
|
+
import { prefixedRoutingTests } from "./tests/prefixed-routing.js";
|
|
18
20
|
import "./tests/index.js";
|
|
19
21
|
import { appendFileSync } from "fs";
|
|
20
|
-
|
|
22
|
+
// src/index.ts
|
|
21
23
|
/**
|
|
22
24
|
* Build a full RegistryConfig from user-provided options with defaults.
|
|
23
25
|
*
|
|
@@ -176,9 +178,9 @@ function registerAllTests(config) {
|
|
|
176
178
|
sessionTests(config);
|
|
177
179
|
signupTests(config);
|
|
178
180
|
homeDetailUxTests(config);
|
|
181
|
+
provenanceTests(config);
|
|
179
182
|
changePasswordTests(config);
|
|
180
183
|
}
|
|
181
|
-
|
|
182
|
-
export { DEFAULT_FEATURES, DEFAULT_SELECTORS, DEFAULT_TEST_IDS, changePasswordTests, cleanupPublished, createRegistryConfig, detailTests, failureModeTests, homeDetailUxTests, homeTests, i18nKeyTests, layoutTests, manifestRenderingTests, maybeIt, publishPackage, publishTests, registerAllTests, searchTests, sessionTests, settingsTests, setupVerdaccioTasks, signinTests, signupTests, unpublishPackage };
|
|
184
|
+
export { DEFAULT_FEATURES, DEFAULT_SELECTORS, DEFAULT_TEST_IDS, changePasswordTests, cleanupPublished, createRegistryConfig, detailTests, failureModeTests, homeDetailUxTests, homeTests, i18nKeyTests, layoutTests, manifestRenderingTests, maybeIt, prefixedRoutingTests, provenanceTests, publishPackage, publishTests, registerAllTests, searchTests, sessionTests, settingsTests, setupVerdaccioTasks, signinTests, signupTests, unpublishPackage };
|
|
183
185
|
|
|
184
186
|
//# sourceMappingURL=index.js.map
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import { appendFileSync } from 'fs';\n\nimport { DEFAULT_FEATURES, mergeFeatures } from './features';\nimport {\n PublishPackageResult,\n PublishPackageTaskInput,\n UnpublishPackageInput,\n UnpublishPackageResult,\n cleanupPublished,\n publishPackage,\n unpublishPackage,\n} from './tasks';\nimport { DEFAULT_SELECTORS, DEFAULT_TEST_IDS, mergeSelectors, mergeTestIds } from './testIds';\n// Re-export for convenience\nimport {\n changePasswordTests,\n detailTests,\n failureModeTests,\n homeDetailUxTests,\n homeTests,\n i18nKeyTests,\n layoutTests,\n manifestRenderingTests,\n publishTests,\n searchTests,\n sessionTests,\n settingsTests,\n signinTests,\n signupTests,\n} from './tests';\nimport { RegistryConfig, RegistryTaskResult, VerdaccioUiOptions } from './types';\n\nexport type { RegistryConfig, RegistryTaskResult, VerdaccioUiOptions } from './types';\nexport type {\n PublishPackageInput,\n PublishPackageTaskInput,\n PublishPackageResult,\n UnpublishPackageInput,\n UnpublishPackageResult,\n} from './tasks';\nexport type { DeepPartial, Selectors, TestIds } from './testIds';\nexport type { Features } from './features';\nexport { DEFAULT_SELECTORS, DEFAULT_TEST_IDS } from './testIds';\nexport { DEFAULT_FEATURES, maybeIt } from './features';\nexport { publishPackage, cleanupPublished, unpublishPackage } from './tasks';\nexport {\n homeTests,\n signinTests,\n publishTests,\n searchTests,\n settingsTests,\n layoutTests,\n changePasswordTests,\n detailTests,\n failureModeTests,\n i18nKeyTests,\n manifestRenderingTests,\n sessionTests,\n signupTests,\n homeDetailUxTests,\n} from './tests';\n\n/**\n * Build a full RegistryConfig from user-provided options with defaults.\n *\n * `testIds` and `selectors` are deep-merged per section with the\n * defaults in `./testIds`. Consumers targeting a non-default Verdaccio\n * build can override just the fields that drifted:\n *\n * createRegistryConfig({\n * registryUrl: 'http://localhost:4873',\n * testIds: {\n * header: { settingsTooltip: 'my-new-settings-btn' },\n * },\n * });\n */\nexport function createRegistryConfig(options: VerdaccioUiOptions): RegistryConfig {\n const url = new URL(options.registryUrl);\n return {\n registryUrl: options.registryUrl,\n port: options.port ?? (parseInt(url.port, 10) || 4873),\n credentials: options.credentials ?? { user: 'test', password: 'test' },\n title: options.title ?? 'Verdaccio',\n testIds: mergeTestIds(DEFAULT_TEST_IDS, options.testIds),\n selectors: mergeSelectors(DEFAULT_SELECTORS, options.selectors),\n features: mergeFeatures(DEFAULT_FEATURES, options.features),\n };\n}\n\n/**\n * Register Verdaccio Cypress tasks in setupNodeEvents.\n *\n * Usage in cypress.config.ts:\n * import { setupVerdaccioTasks } from '@verdaccio/e2e-ui';\n *\n * export default defineConfig({\n * e2e: {\n * setupNodeEvents(on) {\n * setupVerdaccioTasks(on, { registryUrl: 'http://localhost:4873' });\n * },\n * },\n * });\n */\nexport function setupVerdaccioTasks(on: Cypress.PluginEvents, options: VerdaccioUiOptions): void {\n const config = createRegistryConfig(options);\n\n // GitHub Actions Step Summary\n on('after:run', (results) => {\n const summaryFile = process.env.GITHUB_STEP_SUMMARY;\n if (!summaryFile || !results || !('runs' in results)) return;\n\n const cypressResults = results as CypressCommandLine.CypressRunResult;\n const lines: string[] = [];\n\n lines.push('## UI E2E Test Results\\n');\n lines.push('| Spec | Tests | Passing | Failing | Pending | Duration |');\n lines.push('|------|-------|---------|---------|---------|----------|');\n\n for (const run of cypressResults.runs) {\n const specName = run.spec.relative || run.spec.name;\n const stats = run.stats;\n const icon = stats.failures > 0 ? '❌' : '✅';\n const dur = stats.duration ? `${(stats.duration / 1000).toFixed(1)}s` : '-';\n lines.push(\n `| ${icon} ${specName} | ${stats.tests} | ${stats.passes} | ${stats.failures} | ${stats.pending} | ${dur} |`\n );\n }\n\n lines.push('');\n const totals = cypressResults.totalTests ?? 0;\n const passed = cypressResults.totalPassed ?? 0;\n const failed = cypressResults.totalFailed ?? 0;\n const pending = cypressResults.totalPending ?? 0;\n const emoji = failed > 0 ? '❌' : '✅';\n lines.push(\n `${emoji} **${passed} passed**, **${failed} failed**, **${pending} pending** (${totals} total)\\n`\n );\n\n appendFileSync(summaryFile, lines.join('\\n'));\n });\n\n on('task', {\n registry(): RegistryTaskResult {\n return {\n registryUrl: config.registryUrl,\n port: config.port,\n };\n },\n /**\n * Publish a throwaway package to the registry.\n *\n * Usage from a Cypress spec:\n *\n * cy.task('publishPackage', { pkgName: '@verdaccio/pkg-scoped' });\n *\n * Any field not provided falls back to the values configured here\n * (registryUrl, credentials). The task returns a PublishPackageResult.\n */\n async publishPackage(input: PublishPackageTaskInput): Promise<PublishPackageResult> {\n return publishPackage({\n registryUrl: input.registryUrl ?? config.registryUrl,\n credentials: input.credentials ?? config.credentials,\n pkgName: input.pkgName,\n version: input.version,\n dependencies: input.dependencies,\n devDependencies: input.devDependencies,\n manifest: input.manifest,\n unique: input.unique,\n });\n },\n /**\n * Remove a temp project folder returned by a previous publishPackage\n * call. Returns null (Cypress tasks must return something serializable).\n *\n * cy.task('cleanupPublished', result.tempFolder);\n */\n async cleanupPublished(tempFolder: string): Promise<null> {\n await cleanupPublished(tempFolder);\n return null;\n },\n /**\n * Unpublish a package from the registry so the next test starts\n * from a clean slate. Accepts either a package name or a full input\n * object (to reuse a prior tempFolder's token).\n *\n * cy.task('unpublishPackage', '@verdaccio/pkg-scoped');\n * cy.task('unpublishPackage', { pkgName, tempFolder });\n */\n async unpublishPackage(\n input:\n | string\n | (Omit<UnpublishPackageInput, 'registryUrl'> & {\n registryUrl?: string;\n })\n ): Promise<UnpublishPackageResult> {\n const normalized =\n typeof input === 'string'\n ? { pkgName: input, registryUrl: config.registryUrl }\n : { ...input, registryUrl: input.registryUrl ?? config.registryUrl };\n return unpublishPackage(normalized);\n },\n });\n}\n\n/**\n * Register all Verdaccio UI tests.\n *\n * Usage in a spec file:\n * import { registerAllTests, createRegistryConfig } from '@verdaccio/e2e-ui';\n *\n * const config = createRegistryConfig({ registryUrl: 'http://localhost:4873' });\n * registerAllTests(config);\n *\n * Or pick individual suites:\n * import { homeTests, signinTests } from '@verdaccio/e2e-ui';\n *\n * const config = createRegistryConfig({ registryUrl: 'http://localhost:4873' });\n * homeTests(config);\n * signinTests(config);\n */\nexport function registerAllTests(config: RegistryConfig): void {\n homeTests(config);\n signinTests(config);\n layoutTests(config);\n searchTests(config);\n settingsTests(config);\n publishTests(config);\n detailTests(config);\n failureModeTests(config);\n i18nKeyTests(config);\n manifestRenderingTests(config);\n sessionTests(config);\n signupTests(config);\n homeDetailUxTests(config);\n changePasswordTests(config);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,SAAgB,qBAAqB,SAA6C;CAChF,MAAM,MAAM,IAAI,IAAI,QAAQ,WAAW;CACvC,OAAO;EACL,aAAa,QAAQ;EACrB,MAAM,QAAQ,SAAS,SAAS,IAAI,MAAM,EAAE,KAAK;EACjD,aAAa,QAAQ,eAAe;GAAE,MAAM;GAAQ,UAAU;EAAO;EACrE,OAAO,QAAQ,SAAS;EACxB,SAAS,aAAa,kBAAkB,QAAQ,OAAO;EACvD,WAAW,eAAe,mBAAmB,QAAQ,SAAS;EAC9D,UAAU,cAAc,kBAAkB,QAAQ,QAAQ;CAC5D;AACF;;;;;;;;;;;;;;;AAgBA,SAAgB,oBAAoB,IAA0B,SAAmC;CAC/F,MAAM,SAAS,qBAAqB,OAAO;CAG3C,GAAG,cAAc,YAAY;EAC3B,MAAM,cAAc,QAAQ,IAAI;EAChC,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,UAAU,UAAU;EAEtD,MAAM,i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;;;;;EASA,MAAM,iBACJ,OAKiC;GACjC,MAAM,aACJ,OAAO,UAAU,WACb;IAAE,SAAS;IAAO,aAAa,OAAO;GAAY,IAClD;IAAE,GAAG;IAAO,aAAa,MAAM,eAAe,OAAO;GAAY;GACvE,OAAO,iBAAiB,UAAU;EACpC;CACF,CAAC;AACH;;;;;;;;;;;;;;;;;AAkBA,SAAgB,iBAAiB,QAA8B;CAC7D,UAAU,MAAM;CAChB,YAAY,MAAM;CAClB,YAAY,MAAM;CAClB,YAAY,MAAM;CAClB,cAAc,MAAM;CACpB,aAAa,MAAM;CACnB,YAAY,MAAM;CAClB,iBAAiB,MAAM;CACvB,aAAa,MAAM;CACnB,uBAAuB,MAAM;CAC7B,aAAa,MAAM;CACnB,YAAY,MAAM;CAClB,kBAAkB,MAAM;CACxB,oBAAoB,MAAM;AAC5B"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import { appendFileSync } from 'fs';\n\nimport { DEFAULT_FEATURES, mergeFeatures } from './features';\nimport {\n PublishPackageResult,\n PublishPackageTaskInput,\n UnpublishPackageInput,\n UnpublishPackageResult,\n cleanupPublished,\n publishPackage,\n unpublishPackage,\n} from './tasks';\nimport { DEFAULT_SELECTORS, DEFAULT_TEST_IDS, mergeSelectors, mergeTestIds } from './testIds';\n// Re-export for convenience\nimport {\n changePasswordTests,\n detailTests,\n failureModeTests,\n homeDetailUxTests,\n homeTests,\n i18nKeyTests,\n layoutTests,\n manifestRenderingTests,\n provenanceTests,\n publishTests,\n searchTests,\n sessionTests,\n settingsTests,\n signinTests,\n signupTests,\n} from './tests';\nimport { RegistryConfig, RegistryTaskResult, VerdaccioUiOptions } from './types';\n\nexport type { RegistryConfig, RegistryTaskResult, VerdaccioUiOptions } from './types';\nexport type {\n PublishPackageInput,\n PublishPackageTaskInput,\n PublishPackageResult,\n UnpublishPackageInput,\n UnpublishPackageResult,\n} from './tasks';\nexport type { DeepPartial, Selectors, TestIds } from './testIds';\nexport type { Features } from './features';\nexport { DEFAULT_SELECTORS, DEFAULT_TEST_IDS } from './testIds';\nexport { DEFAULT_FEATURES, maybeIt } from './features';\nexport { publishPackage, cleanupPublished, unpublishPackage } from './tasks';\nexport {\n homeTests,\n signinTests,\n publishTests,\n searchTests,\n settingsTests,\n layoutTests,\n changePasswordTests,\n detailTests,\n failureModeTests,\n i18nKeyTests,\n manifestRenderingTests,\n sessionTests,\n signupTests,\n homeDetailUxTests,\n provenanceTests,\n prefixedRoutingTests,\n} from './tests';\n\n/**\n * Build a full RegistryConfig from user-provided options with defaults.\n *\n * `testIds` and `selectors` are deep-merged per section with the\n * defaults in `./testIds`. Consumers targeting a non-default Verdaccio\n * build can override just the fields that drifted:\n *\n * createRegistryConfig({\n * registryUrl: 'http://localhost:4873',\n * testIds: {\n * header: { settingsTooltip: 'my-new-settings-btn' },\n * },\n * });\n */\nexport function createRegistryConfig(options: VerdaccioUiOptions): RegistryConfig {\n const url = new URL(options.registryUrl);\n return {\n registryUrl: options.registryUrl,\n port: options.port ?? (parseInt(url.port, 10) || 4873),\n credentials: options.credentials ?? { user: 'test', password: 'test' },\n title: options.title ?? 'Verdaccio',\n testIds: mergeTestIds(DEFAULT_TEST_IDS, options.testIds),\n selectors: mergeSelectors(DEFAULT_SELECTORS, options.selectors),\n features: mergeFeatures(DEFAULT_FEATURES, options.features),\n };\n}\n\n/**\n * Register Verdaccio Cypress tasks in setupNodeEvents.\n *\n * Usage in cypress.config.ts:\n * import { setupVerdaccioTasks } from '@verdaccio/e2e-ui';\n *\n * export default defineConfig({\n * e2e: {\n * setupNodeEvents(on) {\n * setupVerdaccioTasks(on, { registryUrl: 'http://localhost:4873' });\n * },\n * },\n * });\n */\nexport function setupVerdaccioTasks(on: Cypress.PluginEvents, options: VerdaccioUiOptions): void {\n const config = createRegistryConfig(options);\n\n // GitHub Actions Step Summary\n on('after:run', (results) => {\n const summaryFile = process.env.GITHUB_STEP_SUMMARY;\n if (!summaryFile || !results || !('runs' in results)) return;\n\n const cypressResults = results as CypressCommandLine.CypressRunResult;\n const lines: string[] = [];\n\n lines.push('## UI E2E Test Results\\n');\n lines.push('| Spec | Tests | Passing | Failing | Pending | Duration |');\n lines.push('|------|-------|---------|---------|---------|----------|');\n\n for (const run of cypressResults.runs) {\n const specName = run.spec.relative || run.spec.name;\n const stats = run.stats;\n const icon = stats.failures > 0 ? '❌' : '✅';\n const dur = stats.duration ? `${(stats.duration / 1000).toFixed(1)}s` : '-';\n lines.push(\n `| ${icon} ${specName} | ${stats.tests} | ${stats.passes} | ${stats.failures} | ${stats.pending} | ${dur} |`\n );\n }\n\n lines.push('');\n const totals = cypressResults.totalTests ?? 0;\n const passed = cypressResults.totalPassed ?? 0;\n const failed = cypressResults.totalFailed ?? 0;\n const pending = cypressResults.totalPending ?? 0;\n const emoji = failed > 0 ? '❌' : '✅';\n lines.push(\n `${emoji} **${passed} passed**, **${failed} failed**, **${pending} pending** (${totals} total)\\n`\n );\n\n appendFileSync(summaryFile, lines.join('\\n'));\n });\n\n on('task', {\n registry(): RegistryTaskResult {\n return {\n registryUrl: config.registryUrl,\n port: config.port,\n };\n },\n /**\n * Publish a throwaway package to the registry.\n *\n * Usage from a Cypress spec:\n *\n * cy.task('publishPackage', { pkgName: '@verdaccio/pkg-scoped' });\n *\n * Any field not provided falls back to the values configured here\n * (registryUrl, credentials). The task returns a PublishPackageResult.\n */\n async publishPackage(input: PublishPackageTaskInput): Promise<PublishPackageResult> {\n return publishPackage({\n registryUrl: input.registryUrl ?? config.registryUrl,\n credentials: input.credentials ?? config.credentials,\n pkgName: input.pkgName,\n version: input.version,\n dependencies: input.dependencies,\n devDependencies: input.devDependencies,\n manifest: input.manifest,\n unique: input.unique,\n });\n },\n /**\n * Remove a temp project folder returned by a previous publishPackage\n * call. Returns null (Cypress tasks must return something serializable).\n *\n * cy.task('cleanupPublished', result.tempFolder);\n */\n async cleanupPublished(tempFolder: string): Promise<null> {\n await cleanupPublished(tempFolder);\n return null;\n },\n /**\n * Unpublish a package from the registry so the next test starts\n * from a clean slate. Accepts either a package name or a full input\n * object (to reuse a prior tempFolder's token).\n *\n * cy.task('unpublishPackage', '@verdaccio/pkg-scoped');\n * cy.task('unpublishPackage', { pkgName, tempFolder });\n */\n async unpublishPackage(\n input:\n | string\n | (Omit<UnpublishPackageInput, 'registryUrl'> & {\n registryUrl?: string;\n })\n ): Promise<UnpublishPackageResult> {\n const normalized =\n typeof input === 'string'\n ? { pkgName: input, registryUrl: config.registryUrl }\n : { ...input, registryUrl: input.registryUrl ?? config.registryUrl };\n return unpublishPackage(normalized);\n },\n });\n}\n\n/**\n * Register all Verdaccio UI tests.\n *\n * Usage in a spec file:\n * import { registerAllTests, createRegistryConfig } from '@verdaccio/e2e-ui';\n *\n * const config = createRegistryConfig({ registryUrl: 'http://localhost:4873' });\n * registerAllTests(config);\n *\n * Or pick individual suites:\n * import { homeTests, signinTests } from '@verdaccio/e2e-ui';\n *\n * const config = createRegistryConfig({ registryUrl: 'http://localhost:4873' });\n * homeTests(config);\n * signinTests(config);\n */\nexport function registerAllTests(config: RegistryConfig): void {\n homeTests(config);\n signinTests(config);\n layoutTests(config);\n searchTests(config);\n settingsTests(config);\n publishTests(config);\n detailTests(config);\n failureModeTests(config);\n i18nKeyTests(config);\n manifestRenderingTests(config);\n sessionTests(config);\n signupTests(config);\n homeDetailUxTests(config);\n provenanceTests(config);\n changePasswordTests(config);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+EA,SAAgB,qBAAqB,SAA6C;CAChF,MAAM,MAAM,IAAI,IAAI,QAAQ,WAAW;CACvC,OAAO;EACL,aAAa,QAAQ;EACrB,MAAM,QAAQ,SAAS,SAAS,IAAI,MAAM,EAAE,KAAK;EACjD,aAAa,QAAQ,eAAe;GAAE,MAAM;GAAQ,UAAU;EAAO;EACrE,OAAO,QAAQ,SAAS;EACxB,SAAS,aAAa,kBAAkB,QAAQ,OAAO;EACvD,WAAW,eAAe,mB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;GAClF,OAAO,eAAe;IACpB,aAAa,MAAM,eAAe,OAAO;IACzC,aAAa,MAAM,eAAe,OAAO;IACzC,SAAS,MAAM;IACf,SAAS,MAAM;IACf,cAAc,MAAM;IACpB,iBAAiB,MAAM;IACvB,UAAU,MAAM;IAChB,QAAQ,MAAM;GAChB,CAAC;EACH;;;;;;;EAOA,MAAM,iBAAiB,YAAmC;GACxD,MAAM,iBAAiB,UAAU;GACjC,OAAO;EACT;;;;;;;;;EASA,MAAM,iBACJ,OAKiC;GACjC,MAAM,aACJ,OAAO,UAAU,WACb;IAAE,SAAS;IAAO,aAAa,OAAO;GAAY,IAClD;IAAE,GAAG;IAAO,aAAa,MAAM,eAAe,OAAO;GAAY;GACvE,OAAO,iBAAiB,UAAU;EACpC;CACF,CAAC;AACH;;;;;;;;;;;;;;;;;AAkBA,SAAgB,iBAAiB,QAA8B;CAC7D,UAAU,MAAM;CAChB,YAAY,MAAM;CAClB,YAAY,MAAM;CAClB,YAAY,MAAM;CAClB,cAAc,MAAM;CACpB,aAAa,MAAM;CACnB,YAAY,MAAM;CAClB,iBAAiB,MAAM;CACvB,aAAa,MAAM;CACnB,uBAAuB,MAAM;CAC7B,aAAa,MAAM;CACnB,YAAY,MAAM;CAClB,kBAAkB,MAAM;CACxB,gBAAgB,MAAM;CACtB,oBAAoB,MAAM;AAC5B"}
|
|
@@ -2,7 +2,7 @@ import { spawn } from "child_process";
|
|
|
2
2
|
import { mkdtemp, rm, writeFile } from "fs/promises";
|
|
3
3
|
import { tmpdir } from "os";
|
|
4
4
|
import { join } from "path";
|
|
5
|
-
|
|
5
|
+
// src/tasks/publish.ts
|
|
6
6
|
function sanitizeFolderName(name) {
|
|
7
7
|
return name.replace(/[^a-zA-Z0-9-_]/g, "-");
|
|
8
8
|
}
|
|
@@ -238,7 +238,6 @@ async function unpublishPackage(input) {
|
|
|
238
238
|
}).catch(() => void 0);
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
//#endregion
|
|
242
241
|
export { cleanupPublished, publishPackage, unpublishPackage };
|
|
243
242
|
|
|
244
243
|
//# sourceMappingURL=publish.js.map
|
package/build/esm/testIds.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/testIds.ts
|
|
2
2
|
/**
|
|
3
3
|
* Defaults matching Verdaccio 6.x (bundled ui-theme@9.0.0-next-9.x).
|
|
4
4
|
* Overridable via `createRegistryConfig({ testIds: { ... } })`.
|
|
@@ -55,6 +55,8 @@ var DEFAULT_TEST_IDS = {
|
|
|
55
55
|
installBun: "installListItem-bun",
|
|
56
56
|
installNpmrc: "install-npmrc",
|
|
57
57
|
installNpmrcCopy: "installNpmrc",
|
|
58
|
+
provenanceBadge: "provenance-badge",
|
|
59
|
+
provenanceDialog: "registryInfo--dialog",
|
|
58
60
|
readmeTab: "readme-tab",
|
|
59
61
|
keywordList: "keyword-list",
|
|
60
62
|
dependenciesTab: "dependencies-tab",
|
|
@@ -148,7 +150,6 @@ function mergeSelectors(defaults, overrides) {
|
|
|
148
150
|
}
|
|
149
151
|
};
|
|
150
152
|
}
|
|
151
|
-
//#endregion
|
|
152
153
|
export { DEFAULT_SELECTORS, DEFAULT_TEST_IDS, mergeSelectors, mergeTestIds };
|
|
153
154
|
|
|
154
155
|
//# sourceMappingURL=testIds.js.map
|