@verdaccio/e2e-ui 2.7.0 → 2.9.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.
Files changed (42) hide show
  1. package/README.md +13 -8
  2. package/build/cjs/features.cjs +19 -0
  3. package/build/cjs/features.cjs.map +1 -1
  4. package/build/cjs/index.cjs +6 -0
  5. package/build/cjs/index.cjs.map +1 -1
  6. package/build/cjs/testIds.cjs +25 -1
  7. package/build/cjs/testIds.cjs.map +1 -1
  8. package/build/cjs/tests/change-password.cjs +20 -6
  9. package/build/cjs/tests/change-password.cjs.map +1 -1
  10. package/build/cjs/tests/home-detail-ux.cjs +166 -0
  11. package/build/cjs/tests/home-detail-ux.cjs.map +1 -0
  12. package/build/cjs/tests/index.cjs +4 -0
  13. package/build/cjs/tests/provenance.cjs +134 -0
  14. package/build/cjs/tests/provenance.cjs.map +1 -0
  15. package/build/cjs/tests/publish.cjs +1 -1
  16. package/build/cjs/tests/publish.cjs.map +1 -1
  17. package/build/cjs/tests/settings.cjs +5 -2
  18. package/build/cjs/tests/settings.cjs.map +1 -1
  19. package/build/esm/features.js +19 -0
  20. package/build/esm/features.js.map +1 -1
  21. package/build/esm/index.js +5 -1
  22. package/build/esm/index.js.map +1 -1
  23. package/build/esm/testIds.js +25 -1
  24. package/build/esm/testIds.js.map +1 -1
  25. package/build/esm/tests/change-password.js +20 -6
  26. package/build/esm/tests/change-password.js.map +1 -1
  27. package/build/esm/tests/home-detail-ux.js +166 -0
  28. package/build/esm/tests/home-detail-ux.js.map +1 -0
  29. package/build/esm/tests/index.js +3 -1
  30. package/build/esm/tests/provenance.js +134 -0
  31. package/build/esm/tests/provenance.js.map +1 -0
  32. package/build/esm/tests/publish.js +1 -1
  33. package/build/esm/tests/publish.js.map +1 -1
  34. package/build/esm/tests/settings.js +5 -2
  35. package/build/esm/tests/settings.js.map +1 -1
  36. package/build/features.d.ts +57 -0
  37. package/build/index.d.ts +1 -1
  38. package/build/testIds.d.ts +38 -0
  39. package/build/tests/home-detail-ux.d.ts +10 -0
  40. package/build/tests/index.d.ts +2 -0
  41. package/build/tests/provenance.d.ts +13 -0
  42. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"home-detail-ux.js","names":[],"sources":["../../../src/tests/home-detail-ux.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\nimport { maybeIt } from '../features';\nimport { RegistryConfig } from '../types';\n\n/**\n * Home and package page UX that ships with the 9.x web UI: the package\n * list toolbar, the tab in the address, the welcome guide, the install\n * box (bun and `.npmrc`), copy feedback and search grouped by origin.\n *\n * Every test is a probe (flag defaults to `false`): released lines do\n * not have these features yet.\n */\nexport function homeDetailUxTests(config: RegistryConfig) {\n const { features } = config;\n const flags = features.homeDetailUx;\n const { header, home, package: pkg, search } = config.testIds;\n\n describe('home and detail ux', () => {\n describe('with an empty registry', () => {\n beforeEach(() => {\n cy.intercept('GET', '/-/verdaccio/data/packages').as('pkgs');\n cy.visit(config.registryUrl);\n cy.wait('@pkgs');\n });\n\n maybeIt(flags.welcomeGuide)(\n 'should guide the first publish with a setup tab per package manager',\n () => {\n cy.getByTestId(home.helpCard, { timeout: 10000 }).should('be.visible');\n // the e2e contract of the old card still holds\n cy.getByTestId(home.helpCard).contains('No Package Published Yet.');\n cy.getByTestId(home.helpCard).contains(`npm adduser --registry ${config.registryUrl}`);\n cy.getByTestId(home.helpCard).contains(`npm publish --registry ${config.registryUrl}`);\n\n cy.getByTestId(`${home.helpSetupTabPrefix}npm`).should('be.visible');\n cy.getByTestId(home.helpCard).contains(`npm config set registry ${config.registryUrl}`);\n // quoted: getByTestId does not escape the dot in `.npmrc`\n cy.get(`[data-testid=\"${home.helpSetupTabPrefix}.npmrc\"]`).click();\n cy.getByTestId(home.helpCard).contains(`registry=${config.registryUrl}`);\n cy.getByTestId(home.helpUplinksNote).should('be.visible');\n }\n );\n });\n\n describe('with packages from two scopes', () => {\n const scopedPkg = '@verdaccio/ux-toolbar-fixture';\n const unscopedPkg = 'ux-toolbar-unscoped-fixture';\n const tempFolders: string[] = [];\n\n before(() => {\n if (!flags.homeToolbar) return;\n [scopedPkg, unscopedPkg].forEach((pkgName) => {\n cy.task('publishPackage', { pkgName, version: '1.0.0', unique: true }).then((r) => {\n if (r?.tempFolder) tempFolders.push(r.tempFolder);\n });\n });\n });\n\n after(() => {\n if (!flags.homeToolbar) return;\n [scopedPkg, unscopedPkg].forEach((pkgName) => cy.task('unpublishPackage', pkgName));\n cy.then(() => tempFolders.forEach((folder) => cy.task('cleanupPublished', folder)));\n });\n\n beforeEach(() => {\n cy.intercept('GET', '/-/verdaccio/data/packages').as('pkgs');\n });\n\n maybeIt(flags.homeToolbar)('should filter the list and keep the filter in ?q=', () => {\n cy.visit(config.registryUrl);\n cy.wait('@pkgs');\n cy.getByTestId(home.packageListToolbar, { timeout: 10000 }).should('be.visible');\n cy.getByTestId(pkg.title).should('have.length', 2);\n\n cy.getByTestId(home.packageListFilter).type('unscoped', { delay: 20 });\n cy.getByTestId(pkg.title).should('have.length', 1).and('contain', unscopedPkg);\n cy.location('search').should('eq', '?q=unscoped');\n\n // a reload keeps the filter: it lives in the address\n cy.reload();\n cy.getByTestId(home.packageListFilter, { timeout: 10000 }).should('have.value', 'unscoped');\n cy.getByTestId(pkg.title).should('have.length', 1);\n });\n\n maybeIt(flags.homeToolbar)('should restore the scope from ?scope=', () => {\n cy.visit(`${config.registryUrl}/?scope=@verdaccio`);\n cy.wait('@pkgs');\n cy.getByTestId(home.packageListScope, { timeout: 10000 }).should(\n 'have.value',\n '@verdaccio'\n );\n cy.getByTestId(pkg.title).should('have.length', 1).and('contain', scopedPkg);\n });\n\n maybeIt(flags.homeToolbar)(\n 'should say nothing matches instead of showing the onboarding card',\n () => {\n cy.visit(`${config.registryUrl}/?q=no-package-matches-this`);\n cy.wait('@pkgs');\n cy.getByTestId(home.packageListNoMatch, { timeout: 10000 }).should('be.visible');\n cy.getByTestId(home.helpCard).should('not.exist');\n }\n );\n });\n\n describe('with a published package', () => {\n const pkgName = '@verdaccio/ux-detail-fixture';\n const detailUrl = `${config.registryUrl}/-/web/detail/${pkgName}`;\n const needsPackage =\n flags.detailTabInUrl ||\n flags.installBunAndNpmrc ||\n flags.copyFeedback ||\n flags.searchGrouping ||\n flags.versionLink ||\n flags.settingsPublishTab;\n let tempFolder: string | null = null;\n let version = '1.0.0';\n\n before(() => {\n if (!needsPackage) return;\n cy.task('publishPackage', {\n pkgName,\n version: '1.0.0',\n dependencies: { debug: '4.0.0' },\n unique: true,\n }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n // `unique: true` makes the version 1.0.0-t<timestamp>\n version = result?.version ?? version;\n });\n });\n\n after(() => {\n if (!needsPackage) return;\n cy.task('unpublishPackage', { pkgName, tempFolder: tempFolder ?? undefined });\n cy.then(() => {\n if (tempFolder) cy.task('cleanupPublished', tempFolder);\n });\n });\n\n maybeIt(flags.settingsPublishTab)(\n 'should keep the publishing guide in the settings once packages exist',\n () => {\n cy.visit(config.registryUrl);\n cy.getByTestId(pkg.itemList, { timeout: 10000 }).should('exist');\n cy.getByTestId(header.settingsTooltip).click();\n cy.getByTestId(header.settingsPublishTab).click();\n cy.getByTestId(header.settingsPublishPanel).within(() => {\n cy.getByTestId(home.helpGuide).should('be.visible');\n // the dialog scrolls; at the default viewport the command sits below the fold\n cy.contains(`npm publish --registry ${config.registryUrl}`)\n .scrollIntoView()\n .should('be.visible');\n });\n }\n );\n\n maybeIt(flags.versionLink)('should open the version page from the home list', () => {\n cy.visit(config.registryUrl);\n cy.contains(`[data-testid=\"${pkg.itemList}\"]`, pkgName, { timeout: 10000 })\n .find(`[data-testid=\"${pkg.versionLink}\"]`)\n .click();\n // scoped names keep the literal slash in the path\n cy.location('pathname').should('eq', `/-/web/detail/${pkgName}/v/${version}`);\n cy.getByTestId(pkg.sidebar, { timeout: 10000 }).contains(version);\n });\n\n maybeIt(flags.detailTabInUrl)('should keep the selected tab in ?tab=', () => {\n cy.visit(detailUrl);\n cy.getByTestId(pkg.versionsTab, { timeout: 10000 }).click();\n cy.location('search').should('contain', 'tab=versions');\n cy.getByTestId(pkg.tagLatest).should('be.visible');\n\n cy.getByTestId(pkg.readmeTab).click();\n cy.location('search').should('not.contain', 'tab=');\n });\n\n maybeIt(flags.detailTabInUrl)('should open the tab a link points to', () => {\n cy.visit(`${detailUrl}?tab=dependencies`);\n cy.getByTestId(pkg.dependenciesTab, { timeout: 10000 }).should(\n 'have.attr',\n 'aria-selected',\n 'true'\n );\n cy.getByTestId(pkg.dependencies).contains('debug');\n });\n\n maybeIt(flags.installBunAndNpmrc)(\n 'should offer bun and the scoped .npmrc line in the install box',\n () => {\n cy.visit(detailUrl);\n cy.getByTestId(pkg.installBun, { timeout: 10000 }).contains(`bun add ${pkgName}`);\n cy.getByTestId(pkg.installNpmrc).contains(`@verdaccio:registry=${config.registryUrl}`);\n }\n );\n\n maybeIt(flags.copyFeedback)('should confirm a copy on the copy button', () => {\n cy.visit(detailUrl);\n cy.getByTestId(pkg.installNpmrcCopy, { timeout: 10000 }).click();\n cy.getByTestId(pkg.installNpmrcCopy).should('have.attr', 'aria-label', 'Copied');\n });\n\n maybeIt(flags.searchGrouping)(\n 'should list a package published here under its own search group',\n () => {\n cy.intercept('GET', '**/-/verdaccio/data/search/**').as('webSearch');\n cy.visit(config.registryUrl);\n cy.get('input[placeholder*=\"earch\"]', { timeout: 10000 }).type('ux-detail-fixture', {\n delay: 30,\n });\n cy.wait('@webSearch', { timeout: 10000 });\n cy.get('[role=\"listbox\"]', { timeout: 5000 }).within(() => {\n cy.getByTestId(`${search.groupPrefix}private`).should('be.visible');\n cy.contains('[role=\"option\"]', pkgName)\n .find(`[data-testid=\"${search.originPrefix}private\"]`)\n .should('exist');\n });\n }\n );\n });\n });\n}\n"],"mappings":";;;;;;;;;;AAYA,SAAgB,kBAAkB,QAAwB;CACxD,MAAM,EAAE,aAAa;CACrB,MAAM,QAAQ,SAAS;CACvB,MAAM,EAAE,QAAQ,MAAM,SAA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AAC,SAAS,WAAW,SAAS;IAChF,GAAG,YAAY,IAAI,YAAY,CAAC,CAAC,SAAS,uBAAuB,OAAO,aAAa;GACvF,CACF;GAEA,QAAQ,MAAM,YAAY,CAAC,CAAC,kDAAkD;IAC5E,GAAG,MAAM,SAAS;IAClB,GAAG,YAAY,IAAI,kBAAkB,EAAE,SAAS,IAAM,CAAC,CAAC,CAAC,MAAM;IAC/D,GAAG,YAAY,IAAI,gBAAgB,CAAC,CAAC,OAAO,aAAa,cAAc,QAAQ;GACjF,CAAC;GAED,QAAQ,MAAM,cAAc,CAAC,CAC3B,yEACM;IACJ,GAAG,UAAU,OAAO,+BAA+B,CAAC,CAAC,GAAG,WAAW;IACnE,GAAG,MAAM,OAAO,WAAW;IAC3B,GAAG,IAAI,iCAA+B,EAAE,SAAS,IAAM,CAAC,CAAC,CAAC,KAAK,qBAAqB,EAClF,OAAO,GACT,CAAC;IACD,GAAG,KAAK,cAAc,EAAE,SAAS,IAAM,CAAC;IACxC,GAAG,IAAI,sBAAoB,EAAE,SAAS,IAAK,CAAC,CAAC,CAAC,aAAa;KACzD,GAAG,YAAY,GAAG,OAAO,YAAY,QAAQ,CAAC,CAAC,OAAO,YAAY;KAClE,GAAG,SAAS,qBAAmB,OAAO,CAAC,CACpC,KAAK,iBAAiB,OAAO,aAAa,UAAU,CAAC,CACrD,OAAO,OAAO;IACnB,CAAC;GACH,CACF;EACF,CAAC;CACH,CAAC;AACH"}
@@ -11,4 +11,6 @@ import { i18nKeyTests } from "./i18n-keys.js";
11
11
  import { signupTests } from "./signup.js";
12
12
  import { manifestRenderingTests } from "./manifest-rendering.js";
13
13
  import { sessionTests } from "./session.js";
14
- export { changePasswordTests, detailTests, failureModeTests, homeTests, i18nKeyTests, layoutTests, manifestRenderingTests, publishTests, searchTests, sessionTests, settingsTests, signinTests, signupTests };
14
+ import { homeDetailUxTests } from "./home-detail-ux.js";
15
+ import { provenanceTests } from "./provenance.js";
16
+ export { changePasswordTests, detailTests, failureModeTests, homeDetailUxTests, homeTests, i18nKeyTests, layoutTests, manifestRenderingTests, provenanceTests, publishTests, searchTests, sessionTests, settingsTests, signinTests, signupTests };
@@ -0,0 +1,134 @@
1
+ import { maybeIt } from "../features.js";
2
+ //#region 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
+ 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
+ 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
+ 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
+ //#endregion
132
+ export { provenanceTests };
133
+
134
+ //# sourceMappingURL=provenance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provenance.js","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 });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gB,CAAC,CAAC,aAAa;KAChD,GAAG,SAAS,WAAW,EAAE,CAAC,KAAK;IACjC,CAAC;IAED,GAAG,IAAI,cAAc,CAAC,CAAC,OAAO,eAAe,CAAC;GAChD,CACF;EACF,CAAC;EAED,SAAS,qCAAqC;GAC5C,MAAM,UAAU;GAChB,IAAI,aAA4B;GAEhC,iBAAiB;IACf,GAAG,KAAK,kBAAkB;KAAE;KAAS,SAAS;KAAS,QAAQ;IAAK,CAAC,CAAC,CAAC,MAAM,WAAW;KACtF,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,QAAQ,SAAS,WAAW,cAAc,CAAC,CAAC,uCAAuC;IACjF,GAAG,MAAM,GAAG,OAAO,YAAY,gBAAgB,SAAS;IACxD,GAAG,YAAY,IAAI,OAAO,CAAC,CAAC,OAAO,YAAY;IAC/C,GAAG,YAAY,IAAI,eAAe,CAAC,CAAC,OAAO,WAAW;GACxD,CAAC;EACH,CAAC;CACH,CAAC;AACH"}
@@ -91,7 +91,7 @@ function publishTests(config) {
91
91
  cy.wait("@pkgs");
92
92
  cy.getByTestId(pkg.title).first().click();
93
93
  cy.wait("@sidebar");
94
- cy.getByTestId(pkg.keywordList).should("be.visible");
94
+ cy.getByTestId(pkg.keywordList).scrollIntoView().should("be.visible");
95
95
  cy.getByTestId(pkg.keywordList).should("contain.text", "verdaccio");
96
96
  cy.getByTestId(pkg.keywordList).should("contain.text", "e2e");
97
97
  cy.getByTestId(pkg.keywordList).should("contain.text", "test");
@@ -1 +1 @@
1
- {"version":3,"file":"publish.js","names":[],"sources":["../../../src/tests/publish.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\nimport { maybeIt } from '../features';\nimport { RegistryConfig } from '../types';\n\nexport function publishTests(config: RegistryConfig) {\n const { header, package: pkg } = config.testIds;\n const { markdownBody, loginDialog } = config.selectors;\n const { features } = config;\n /**\n * Log in once, reuse the session across tests in the requested suite.\n * `cy.session` caches cookies + localStorage keyed on the first\n * argument, so subsequent calls restore without hitting the network.\n */\n const loginOnce = (sessionName: string) => {\n cy.session(\n [sessionName, config.credentials.user],\n () => {\n cy.visit(config.registryUrl);\n cy.login(config.credentials.user, config.credentials.password, {\n loginButton: header.loginButton,\n ...loginDialog,\n });\n cy.wait('@sign');\n },\n {\n validate() {\n cy.request({\n url: `${config.registryUrl}/-/verdaccio/data/packages`,\n failOnStatusCode: false,\n })\n .its('status')\n .should('be.oneOf', [200, 304]);\n },\n cacheAcrossSpecs: true,\n }\n );\n };\n\n describe('publish', () => {\n const pkgName = '@verdaccio/pkg-scoped';\n // Single source of truth for the dependency the publish fixture\n // writes into its package.json. The dependencies-tab assertion\n // reads these back to verify the UI rendered both fields.\n const depName = 'debug';\n const depVersion = '4.0.0';\n // Per-test state so afterEach can clean up the specific publish\n // that this test created (temp folder + registry entry).\n let tempFolder: string | null = null;\n\n beforeEach(() => {\n cy.intercept('POST', '/-/verdaccio/sec/login').as('sign');\n cy.intercept('GET', '/-/verdaccio/data/packages').as('pkgs');\n cy.intercept('GET', `/-/verdaccio/data/sidebar/${pkgName}`).as('sidebar');\n cy.intercept('GET', `/-/verdaccio/data/package/readme/${pkgName}`).as('readme');\n\n // Publish a fresh copy for this test. `unique: true` appends a\n // timestamp suffix so the version is distinct per test even when\n // the registry briefly has a stale copy from a prior afterEach.\n cy.task('publishPackage', {\n pkgName,\n version: '1.0.0',\n dependencies: { [depName]: depVersion },\n unique: true,\n }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n\n loginOnce('publish-suite');\n cy.visit(config.registryUrl);\n });\n\n afterEach(() => {\n // Remove the package from the registry AND the local temp folder.\n // Run both regardless of test outcome so the next test starts\n // clean. `unpublishPackage` treats 404 as success, so a re-run\n // after a half-published state is still safe.\n cy.task('unpublishPackage', { pkgName, tempFolder: tempFolder ?? undefined });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n it('should have one published package', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).should('have.length.at.least', 1);\n });\n\n it('should navigate to page detail', () => {\n cy.wait('@pkgs');\n cy.wait(300);\n cy.getByTestId(pkg.title).first().click();\n });\n\n it('should have readme content', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@readme');\n cy.wait('@sidebar');\n cy.getByTestId(pkg.readme).should('be.visible');\n cy.get(markdownBody).should('have.length', 1);\n // publishPackage writes a README whose body contains \"e2e testing\".\n cy.contains(markdownBody, /test/);\n cy.contains(`${markdownBody} h1`, pkgName).should('be.visible');\n });\n\n it('should render the sidebar with install commands for npm, yarn, pnpm', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@sidebar');\n cy.getByTestId(pkg.sidebar).should('be.visible');\n cy.getByTestId(pkg.installList).within(() => {\n cy.getByTestId(pkg.installNpm).should('be.visible');\n cy.getByTestId(pkg.installYarn).should('be.visible');\n cy.getByTestId(pkg.installPnpm).should('be.visible');\n });\n cy.getByTestId(pkg.installNpm).should('contain.text', pkgName);\n });\n\n it('should render the sidebar keywords from the published manifest', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@sidebar');\n // publishPackage writes `keywords: ['verdaccio', 'e2e', 'test']`\n // into the generated package.json.\n cy.getByTestId(pkg.keywordList).should('be.visible');\n cy.getByTestId(pkg.keywordList).should('contain.text', 'verdaccio');\n cy.getByTestId(pkg.keywordList).should('contain.text', 'e2e');\n cy.getByTestId(pkg.keywordList).should('contain.text', 'test');\n });\n\n it('should click on dependencies tab', () => {\n cy.wait('@pkgs');\n cy.wait(300);\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@readme');\n cy.wait('@sidebar');\n cy.getByTestId(pkg.dependenciesTab).click();\n cy.wait(100);\n cy.getByTestId(pkg.dependencies).should('have.length', 1);\n\n // The dep Chip uses the dep name as its data-testid (dynamic\n // Verdaccio convention, see DependencyBlock.tsx:68), and its\n // label is `\"${name}: ${version}\"` via the `dependencies.\n // dependency-block` i18n key. Assert BOTH fields are rendered.\n cy.getByTestId(depName)\n .should('be.visible')\n .and('contain.text', depName)\n .and('contain.text', depVersion);\n\n // Also verify the Chip text matches the exact \"name: version\"\n // format so a regression in the label template would fail here\n // rather than pass via a loose substring match.\n cy.getByTestId(depName)\n .invoke('text')\n .should('match', new RegExp(`${depName}\\\\s*:\\\\s*${depVersion}`));\n });\n\n it('should click on versions tab', () => {\n cy.wait('@pkgs');\n cy.wait(300);\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@readme');\n cy.wait('@sidebar');\n cy.getByTestId(pkg.versionsTab).click();\n // With `unique: true` the version becomes `1.0.0-t<timestamp>`,\n // but \"1.0.0\" still appears as a substring — match loosely.\n cy.getByTestId(pkg.tagLatest)\n .children()\n .invoke('text')\n .should('match', /1\\.0\\.0/);\n });\n\n it('should click on uplinks tab', () => {\n cy.wait('@pkgs');\n cy.wait(300);\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@readme');\n cy.wait('@sidebar');\n cy.getByTestId(pkg.uplinksTab).click();\n cy.getByTestId(pkg.noUplinks).should('be.visible');\n });\n\n // ── Action-bar FABs: tarball download + raw viewer ─────────────\n // Both buttons live in the sidebar ActionBar. They're gated on\n // `web.showDownloadTarball` / `web.showRaw` (both default to true\n // in the ui-theme's AppConfigurationProvider) and each test is\n // also guarded by a feature flag so branches that ship a\n // different action bar can skip cleanly.\n\n maybeIt(features.publish.downloadTarball)(\n 'should fetch the tarball when the download button is clicked',\n () => {\n // The download provider hits the package manifest's dist.tarball\n // URL directly. For our published fixture the filename looks\n // like `pkg-scoped-1.0.0-t<ts>.tgz`, served from\n // `/<pkg>/-/<filename>.tgz`. Intercept before clicking.\n cy.intercept('GET', '**/pkg-scoped-*.tgz').as('tarballFetch');\n\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@sidebar');\n\n cy.getByTestId(pkg.downloadTarballBtn).should('be.visible').click();\n\n // The fetch should fire and return 200. We can't assert on the\n // actual file landing on disk — Cypress doesn't track OS-level\n // downloads — but a successful GET proves the end-to-end path\n // from click → download provider → registry.\n cy.wait('@tarballFetch', { timeout: 10000 }).its('response.statusCode').should('eq', 200);\n }\n );\n\n maybeIt(features.publish.rawViewer)(\n 'should open the raw manifest viewer when the raw button is clicked',\n () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@sidebar');\n\n // RawViewer is a full-screen MUI Dialog — initially unmounted\n // because `isOpen=false` keeps Dialog closed and Cypress won't\n // find it. Clicking the FAB flips `isOpen` to true.\n cy.getByTestId(pkg.rawBtn).should('be.visible').click();\n\n cy.getByTestId(pkg.rawViewerDialog, { timeout: 5000 }).should('be.visible');\n // The ReactJson viewer renders the package manifest — the\n // package name should appear somewhere in the serialized JSON.\n cy.getByTestId(pkg.rawViewerDialog).should('contain.text', pkgName);\n\n // Close via the X button and confirm the dialog goes away so\n // subsequent tests don't inherit an open overlay.\n cy.getByTestId(pkg.closeRawViewer).click();\n cy.getByTestId(pkg.rawViewerDialog).should('not.exist');\n }\n );\n });\n\n describe('private package tarball downloads', () => {\n const privatePkgName = '@private/tarball-fixture';\n let tempFolder: string | null = null;\n\n beforeEach(() => {\n cy.intercept('POST', '/-/verdaccio/sec/login').as('sign');\n cy.intercept('GET', '/-/verdaccio/data/packages').as('pkgs');\n cy.intercept('GET', '**/-/verdaccio/data/sidebar/@private/tarball-fixture*').as('sidebar');\n\n cy.task('publishPackage', {\n pkgName: privatePkgName,\n version: '1.0.0',\n unique: true,\n }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n\n loginOnce('private-tarball-suite');\n cy.visit(config.registryUrl);\n });\n\n afterEach(() => {\n cy.task('unpublishPackage', {\n pkgName: privatePkgName,\n tempFolder: tempFolder ?? undefined,\n });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n maybeIt(features.publish.privateDownloadTarball)(\n 'should fetch a private tarball from the home package list',\n () => {\n cy.intercept('GET', '**/tarball-fixture-*.tgz').as('privateTarballFetch');\n\n cy.wait('@pkgs');\n cy.contains(`[data-testid=\"${pkg.title}\"]`, privatePkgName)\n .should('be.visible')\n .closest(`[data-testid=\"${pkg.itemList}\"]`)\n .find(`[data-testid=\"${pkg.downloadTarball}\"]`)\n .should('be.visible')\n .click();\n\n cy.wait('@privateTarballFetch', { timeout: 10000 })\n .its('response.statusCode')\n .should('eq', 200);\n }\n );\n\n maybeIt(features.publish.privateDownloadTarball)(\n 'should fetch a private tarball from the package sidebar',\n () => {\n cy.intercept('GET', '**/tarball-fixture-*.tgz').as('privateTarballFetch');\n\n cy.wait('@pkgs');\n cy.contains(`[data-testid=\"${pkg.title}\"]`, privatePkgName).click();\n cy.wait('@sidebar');\n cy.getByTestId(pkg.downloadTarballBtn).should('be.visible').click();\n\n cy.wait('@privateTarballFetch', { timeout: 10000 })\n .its('response.statusCode')\n .should('eq', 200);\n }\n );\n });\n}\n"],"mappings":";;AAIA,SAAgB,aAAa,QAAwB;CACnD,MAAM,EAAE,QAAQ,SAAS,QAAQ,OAAO;CACxC,MAAM,EAAE,cAAc,gBAAgB,OAAO;CAC7C,MAAM,EAAE,aAAa;;;;;;CAMrB,MAAM,aAAa,gBAAwB;EACzC,GAAG,QACD,CAAC,aAAa,OAAO,YAAY,IAAI,SAC/B;GACJ,GAAG,MAAM,OAAO,WAAW;GAC3B,GAAG,MAAM,OAAO,YAAY,MAAM,OAAO,YAAY,UAAU;IAC7D,aAAa,OAAO;IACpB,GAAG;GACL,CAAC;GACD,GAAG,KAAK,OAAO;EACjB,GACA;GACE,WAAW;IACT,GAAG,QAAQ;KACT,KAAK,GAAG,OAAO,YAAY;KAC3B,kBAAkB;IACpB,CAAC,CAAC,CAC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oB;IAC1B,SAAS;IACT,YAAY,cAAc,KAAA;GAC5B,CAAC;GACD,IAAI,YACF,GAAG,KAAK,oBAAoB,UAAU;GAExC,aAAa;EACf,CAAC;EAED,QAAQ,SAAS,QAAQ,sBAAsB,CAAC,CAC9C,mEACM;GACJ,GAAG,UAAU,OAAO,0BAA0B,CAAC,CAAC,GAAG,qBAAqB;GAExE,GAAG,KAAK,OAAO;GACf,GAAG,SAAS,iBAAiB,IAAI,MAAM,KAAK,cAAc,CAAC,CACxD,OAAO,YAAY,CAAC,CACpB,QAAQ,iBAAiB,IAAI,SAAS,GAAG,CAAC,CAC1C,KAAK,iBAAiB,IAAI,gBAAgB,GAAG,CAAC,CAC9C,OAAO,YAAY,CAAC,CACpB,MAAM;GAET,GAAG,KAAK,wBAAwB,EAAE,SAAS,IAAM,CAAC,CAAC,CAChD,IAAI,qBAAqB,CAAC,CAC1B,OAAO,MAAM,GAAG;EACrB,CACF;EAEA,QAAQ,SAAS,QAAQ,sBAAsB,CAAC,CAC9C,iEACM;GACJ,GAAG,UAAU,OAAO,0BAA0B,CAAC,CAAC,GAAG,qBAAqB;GAExE,GAAG,KAAK,OAAO;GACf,GAAG,SAAS,iBAAiB,IAAI,MAAM,KAAK,cAAc,CAAC,CAAC,MAAM;GAClE,GAAG,KAAK,UAAU;GAClB,GAAG,YAAY,IAAI,kBAAkB,CAAC,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM;GAElE,GAAG,KAAK,wBAAwB,EAAE,SAAS,IAAM,CAAC,CAAC,CAChD,IAAI,qBAAqB,CAAC,CAC1B,OAAO,MAAM,GAAG;EACrB,CACF;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"publish.js","names":[],"sources":["../../../src/tests/publish.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\nimport { maybeIt } from '../features';\nimport { RegistryConfig } from '../types';\n\nexport function publishTests(config: RegistryConfig) {\n const { header, package: pkg } = config.testIds;\n const { markdownBody, loginDialog } = config.selectors;\n const { features } = config;\n /**\n * Log in once, reuse the session across tests in the requested suite.\n * `cy.session` caches cookies + localStorage keyed on the first\n * argument, so subsequent calls restore without hitting the network.\n */\n const loginOnce = (sessionName: string) => {\n cy.session(\n [sessionName, config.credentials.user],\n () => {\n cy.visit(config.registryUrl);\n cy.login(config.credentials.user, config.credentials.password, {\n loginButton: header.loginButton,\n ...loginDialog,\n });\n cy.wait('@sign');\n },\n {\n validate() {\n cy.request({\n url: `${config.registryUrl}/-/verdaccio/data/packages`,\n failOnStatusCode: false,\n })\n .its('status')\n .should('be.oneOf', [200, 304]);\n },\n cacheAcrossSpecs: true,\n }\n );\n };\n\n describe('publish', () => {\n const pkgName = '@verdaccio/pkg-scoped';\n // Single source of truth for the dependency the publish fixture\n // writes into its package.json. The dependencies-tab assertion\n // reads these back to verify the UI rendered both fields.\n const depName = 'debug';\n const depVersion = '4.0.0';\n // Per-test state so afterEach can clean up the specific publish\n // that this test created (temp folder + registry entry).\n let tempFolder: string | null = null;\n\n beforeEach(() => {\n cy.intercept('POST', '/-/verdaccio/sec/login').as('sign');\n cy.intercept('GET', '/-/verdaccio/data/packages').as('pkgs');\n cy.intercept('GET', `/-/verdaccio/data/sidebar/${pkgName}`).as('sidebar');\n cy.intercept('GET', `/-/verdaccio/data/package/readme/${pkgName}`).as('readme');\n\n // Publish a fresh copy for this test. `unique: true` appends a\n // timestamp suffix so the version is distinct per test even when\n // the registry briefly has a stale copy from a prior afterEach.\n cy.task('publishPackage', {\n pkgName,\n version: '1.0.0',\n dependencies: { [depName]: depVersion },\n unique: true,\n }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n\n loginOnce('publish-suite');\n cy.visit(config.registryUrl);\n });\n\n afterEach(() => {\n // Remove the package from the registry AND the local temp folder.\n // Run both regardless of test outcome so the next test starts\n // clean. `unpublishPackage` treats 404 as success, so a re-run\n // after a half-published state is still safe.\n cy.task('unpublishPackage', { pkgName, tempFolder: tempFolder ?? undefined });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n it('should have one published package', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).should('have.length.at.least', 1);\n });\n\n it('should navigate to page detail', () => {\n cy.wait('@pkgs');\n cy.wait(300);\n cy.getByTestId(pkg.title).first().click();\n });\n\n it('should have readme content', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@readme');\n cy.wait('@sidebar');\n cy.getByTestId(pkg.readme).should('be.visible');\n cy.get(markdownBody).should('have.length', 1);\n // publishPackage writes a README whose body contains \"e2e testing\".\n cy.contains(markdownBody, /test/);\n cy.contains(`${markdownBody} h1`, pkgName).should('be.visible');\n });\n\n it('should render the sidebar with install commands for npm, yarn, pnpm', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@sidebar');\n cy.getByTestId(pkg.sidebar).should('be.visible');\n cy.getByTestId(pkg.installList).within(() => {\n cy.getByTestId(pkg.installNpm).should('be.visible');\n cy.getByTestId(pkg.installYarn).should('be.visible');\n cy.getByTestId(pkg.installPnpm).should('be.visible');\n });\n cy.getByTestId(pkg.installNpm).should('contain.text', pkgName);\n });\n\n it('should render the sidebar keywords from the published manifest', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@sidebar');\n // publishPackage writes `keywords: ['verdaccio', 'e2e', 'test']`\n // into the generated package.json.\n // the sidebar scrolls; a taller install box can push the keywords below the fold\n cy.getByTestId(pkg.keywordList).scrollIntoView().should('be.visible');\n cy.getByTestId(pkg.keywordList).should('contain.text', 'verdaccio');\n cy.getByTestId(pkg.keywordList).should('contain.text', 'e2e');\n cy.getByTestId(pkg.keywordList).should('contain.text', 'test');\n });\n\n it('should click on dependencies tab', () => {\n cy.wait('@pkgs');\n cy.wait(300);\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@readme');\n cy.wait('@sidebar');\n cy.getByTestId(pkg.dependenciesTab).click();\n cy.wait(100);\n cy.getByTestId(pkg.dependencies).should('have.length', 1);\n\n // The dep Chip uses the dep name as its data-testid (dynamic\n // Verdaccio convention, see DependencyBlock.tsx:68), and its\n // label is `\"${name}: ${version}\"` via the `dependencies.\n // dependency-block` i18n key. Assert BOTH fields are rendered.\n cy.getByTestId(depName)\n .should('be.visible')\n .and('contain.text', depName)\n .and('contain.text', depVersion);\n\n // Also verify the Chip text matches the exact \"name: version\"\n // format so a regression in the label template would fail here\n // rather than pass via a loose substring match.\n cy.getByTestId(depName)\n .invoke('text')\n .should('match', new RegExp(`${depName}\\\\s*:\\\\s*${depVersion}`));\n });\n\n it('should click on versions tab', () => {\n cy.wait('@pkgs');\n cy.wait(300);\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@readme');\n cy.wait('@sidebar');\n cy.getByTestId(pkg.versionsTab).click();\n // With `unique: true` the version becomes `1.0.0-t<timestamp>`,\n // but \"1.0.0\" still appears as a substring — match loosely.\n cy.getByTestId(pkg.tagLatest)\n .children()\n .invoke('text')\n .should('match', /1\\.0\\.0/);\n });\n\n it('should click on uplinks tab', () => {\n cy.wait('@pkgs');\n cy.wait(300);\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@readme');\n cy.wait('@sidebar');\n cy.getByTestId(pkg.uplinksTab).click();\n cy.getByTestId(pkg.noUplinks).should('be.visible');\n });\n\n // ── Action-bar FABs: tarball download + raw viewer ─────────────\n // Both buttons live in the sidebar ActionBar. They're gated on\n // `web.showDownloadTarball` / `web.showRaw` (both default to true\n // in the ui-theme's AppConfigurationProvider) and each test is\n // also guarded by a feature flag so branches that ship a\n // different action bar can skip cleanly.\n\n maybeIt(features.publish.downloadTarball)(\n 'should fetch the tarball when the download button is clicked',\n () => {\n // The download provider hits the package manifest's dist.tarball\n // URL directly. For our published fixture the filename looks\n // like `pkg-scoped-1.0.0-t<ts>.tgz`, served from\n // `/<pkg>/-/<filename>.tgz`. Intercept before clicking.\n cy.intercept('GET', '**/pkg-scoped-*.tgz').as('tarballFetch');\n\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@sidebar');\n\n cy.getByTestId(pkg.downloadTarballBtn).should('be.visible').click();\n\n // The fetch should fire and return 200. We can't assert on the\n // actual file landing on disk — Cypress doesn't track OS-level\n // downloads — but a successful GET proves the end-to-end path\n // from click → download provider → registry.\n cy.wait('@tarballFetch', { timeout: 10000 }).its('response.statusCode').should('eq', 200);\n }\n );\n\n maybeIt(features.publish.rawViewer)(\n 'should open the raw manifest viewer when the raw button is clicked',\n () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@sidebar');\n\n // RawViewer is a full-screen MUI Dialog — initially unmounted\n // because `isOpen=false` keeps Dialog closed and Cypress won't\n // find it. Clicking the FAB flips `isOpen` to true.\n cy.getByTestId(pkg.rawBtn).should('be.visible').click();\n\n cy.getByTestId(pkg.rawViewerDialog, { timeout: 5000 }).should('be.visible');\n // The ReactJson viewer renders the package manifest — the\n // package name should appear somewhere in the serialized JSON.\n cy.getByTestId(pkg.rawViewerDialog).should('contain.text', pkgName);\n\n // Close via the X button and confirm the dialog goes away so\n // subsequent tests don't inherit an open overlay.\n cy.getByTestId(pkg.closeRawViewer).click();\n cy.getByTestId(pkg.rawViewerDialog).should('not.exist');\n }\n );\n });\n\n describe('private package tarball downloads', () => {\n const privatePkgName = '@private/tarball-fixture';\n let tempFolder: string | null = null;\n\n beforeEach(() => {\n cy.intercept('POST', '/-/verdaccio/sec/login').as('sign');\n cy.intercept('GET', '/-/verdaccio/data/packages').as('pkgs');\n cy.intercept('GET', '**/-/verdaccio/data/sidebar/@private/tarball-fixture*').as('sidebar');\n\n cy.task('publishPackage', {\n pkgName: privatePkgName,\n version: '1.0.0',\n unique: true,\n }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n\n loginOnce('private-tarball-suite');\n cy.visit(config.registryUrl);\n });\n\n afterEach(() => {\n cy.task('unpublishPackage', {\n pkgName: privatePkgName,\n tempFolder: tempFolder ?? undefined,\n });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n maybeIt(features.publish.privateDownloadTarball)(\n 'should fetch a private tarball from the home package list',\n () => {\n cy.intercept('GET', '**/tarball-fixture-*.tgz').as('privateTarballFetch');\n\n cy.wait('@pkgs');\n cy.contains(`[data-testid=\"${pkg.title}\"]`, privatePkgName)\n .should('be.visible')\n .closest(`[data-testid=\"${pkg.itemList}\"]`)\n .find(`[data-testid=\"${pkg.downloadTarball}\"]`)\n .should('be.visible')\n .click();\n\n cy.wait('@privateTarballFetch', { timeout: 10000 })\n .its('response.statusCode')\n .should('eq', 200);\n }\n );\n\n maybeIt(features.publish.privateDownloadTarball)(\n 'should fetch a private tarball from the package sidebar',\n () => {\n cy.intercept('GET', '**/tarball-fixture-*.tgz').as('privateTarballFetch');\n\n cy.wait('@pkgs');\n cy.contains(`[data-testid=\"${pkg.title}\"]`, privatePkgName).click();\n cy.wait('@sidebar');\n cy.getByTestId(pkg.downloadTarballBtn).should('be.visible').click();\n\n cy.wait('@privateTarballFetch', { timeout: 10000 })\n .its('response.statusCode')\n .should('eq', 200);\n }\n );\n });\n}\n"],"mappings":";;AAIA,SAAgB,aAAa,QAAwB;CACnD,MAAM,EAAE,QAAQ,SAAS,QAAQ,OAAO;CACxC,MAAM,EAAE,cAAc,gBAAgB,OAAO;CAC7C,MAAM,EAAE,aAAa;;;;;;CAMrB,MAAM,aAAa,gBAAwB;EACzC,GAAG,QACD,CAAC,aAAa,OAAO,YAAY,IAAI,SAC/B;GACJ,GAAG,MAAM,OAAO,WAAW;GAC3B,GAAG,MAAM,OAAO,YAAY,MAAM,OAAO,YAAY,UAAU;IAC7D,aAAa,OAAO;IACpB,GAAG;GACL,CAAC;GACD,GAAG,KAAK,OAAO;EACjB,GACA;GACE,WAAW;IACT,GAAG,QAAQ;KACT,KAAK,GAAG,OAAO,YAAY;KAC3B,kBAAkB;IACpB,CAAC,CAAC,CACC,IAAI,QAAQ,CAAC,CACb,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B,SAAS;IACT,YAAY,cAAc,KAAA;GAC5B,CAAC;GACD,IAAI,YACF,GAAG,KAAK,oBAAoB,UAAU;GAExC,aAAa;EACf,CAAC;EAED,QAAQ,SAAS,QAAQ,sBAAsB,CAAC,CAC9C,mEACM;GACJ,GAAG,UAAU,OAAO,0BAA0B,CAAC,CAAC,GAAG,qBAAqB;GAExE,GAAG,KAAK,OAAO;GACf,GAAG,SAAS,iBAAiB,IAAI,MAAM,KAAK,cAAc,CAAC,CACxD,OAAO,YAAY,CAAC,CACpB,QAAQ,iBAAiB,IAAI,SAAS,GAAG,CAAC,CAC1C,KAAK,iBAAiB,IAAI,gBAAgB,GAAG,CAAC,CAC9C,OAAO,YAAY,CAAC,CACpB,MAAM;GAET,GAAG,KAAK,wBAAwB,EAAE,SAAS,IAAM,CAAC,CAAC,CAChD,IAAI,qBAAqB,CAAC,CAC1B,OAAO,MAAM,GAAG;EACrB,CACF;EAEA,QAAQ,SAAS,QAAQ,sBAAsB,CAAC,CAC9C,iEACM;GACJ,GAAG,UAAU,OAAO,0BAA0B,CAAC,CAAC,GAAG,qBAAqB;GAExE,GAAG,KAAK,OAAO;GACf,GAAG,SAAS,iBAAiB,IAAI,MAAM,KAAK,cAAc,CAAC,CAAC,MAAM;GAClE,GAAG,KAAK,UAAU;GAClB,GAAG,YAAY,IAAI,kBAAkB,CAAC,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM;GAElE,GAAG,KAAK,wBAAwB,EAAE,SAAS,IAAM,CAAC,CAAC,CAChD,IAAI,qBAAqB,CAAC,CAC1B,OAAO,MAAM,GAAG;EACrB,CACF;CACF,CAAC;AACH"}
@@ -33,7 +33,7 @@ function settingsTests(config) {
33
33
  it("should show both Package Managers and Translations tabs", () => {
34
34
  cy.getByTestId(header.settingsTooltip).click();
35
35
  cy.get("[role=\"dialog\"]").should("be.visible");
36
- cy.get("[role=\"dialog\"] [role=\"tab\"]").should("have.length", 2);
36
+ cy.get("[role=\"dialog\"] [role=\"tab\"]").should("have.length.at.least", 2);
37
37
  cy.contains("[role=\"dialog\"] [role=\"tab\"]", "Translations").should("be.visible");
38
38
  });
39
39
  it("should switch to the Translations tab and list languages", () => {
@@ -49,7 +49,10 @@ function settingsTests(config) {
49
49
  cy.get("[role=\"dialog\"]").should("be.visible");
50
50
  cy.contains("[role=\"dialog\"] [role=\"tab\"]", "Translations").click();
51
51
  cy.contains("[role=\"dialog\"]", "Configuration").invoke("text").then((englishTitle) => {
52
- cy.contains("[role=\"dialog\"] .MuiCard-root", "German").click({ force: true });
52
+ cy.contains("[role=\"dialog\"] .MuiCard-root", "German").then(($card) => {
53
+ const $area = $card.find(".MuiCardActionArea-root");
54
+ cy.wrap($area.length ? $area : $card).click({ force: true });
55
+ });
53
56
  cy.contains("[role=\"dialog\"] [role=\"tab\"]", "Translations").should("not.exist");
54
57
  cy.contains("[role=\"dialog\"]", englishTitle).should("not.exist");
55
58
  });
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","names":[],"sources":["../../../src/tests/settings.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\nimport { maybeIt } from '../features';\nimport { RegistryConfig } from '../types';\n\n/**\n * Tests for the header Settings dialog and the Translations (language)\n * picker inside it.\n *\n * Requires `web.showSettings: true` in the registry config — the gear\n * icon only renders when the flag is on (see HeaderRight in Verdaccio's\n * ui-components package).\n *\n * Selector strategy: the language cards in LanguageSwitch do NOT have\n * data-testids, so this suite leans on:\n * - MUI's ARIA roles: `[role=\"dialog\"]`, `[role=\"tab\"]`\n * - The stable English labels \"Configuration\", \"Translations\",\n * \"English\", \"German\", and the language description text, which are\n * bundled into the ui-theme via `@verdaccio/ui-i18n`\n * - The settings trigger's testid from Verdaccio's HeaderToolTipIcon:\n * `header--tooltip-settings`\n */\nexport function settingsTests(config: RegistryConfig) {\n const { header } = config.testIds;\n const { features } = config;\n\n describe('settings & language', () => {\n beforeEach(() => {\n cy.visit(config.registryUrl);\n cy.get('body').should('be.visible');\n });\n\n it('should open the settings dialog from the header', () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n // Dialog title key: dialog.settings.title → \"Configuration\" in EN.\n cy.contains('[role=\"dialog\"]', 'Configuration').should('be.visible');\n });\n\n it('should show both Package Managers and Translations tabs', () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n cy.get('[role=\"dialog\"] [role=\"tab\"]').should('have.length', 2);\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').should('be.visible');\n });\n\n it('should switch to the Translations tab and list languages', () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').click();\n // language.description text is bundled in EN — good sentinel.\n cy.contains('[role=\"dialog\"]', /this is the configuration details for the language/i).should(\n 'be.visible'\n );\n // Sanity-check a couple of language cards are rendered.\n cy.contains('[role=\"dialog\"]', 'English').should('be.visible');\n cy.contains('[role=\"dialog\"]', 'German').should('be.visible');\n });\n\n maybeIt(features.settings.languageSwitcher)(\n 'should change the UI language when a language card is clicked',\n () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').click();\n\n // Before switching, capture the current dialog title so we can\n // assert it changes. This avoids hard-coding the German string.\n cy.contains('[role=\"dialog\"]', 'Configuration')\n .invoke('text')\n .then((englishTitle) => {\n // Click the German card. We scope to the dialog + the MUI\n // card class to avoid matching other \"German\" text.\n cy.contains('[role=\"dialog\"] .MuiCard-root', 'German').click({\n force: true,\n });\n\n // The English tab label \"Translations\" must no longer be\n // present anywhere in the dialog — strongest proof the\n // language actually switched.\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').should('not.exist');\n // And the original dialog title text should also be gone.\n cy.contains('[role=\"dialog\"]', englishTitle).should('not.exist');\n });\n }\n );\n\n it('should close the settings dialog with Escape', () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n cy.get('body').type('{esc}');\n cy.get('[role=\"dialog\"]').should('not.exist');\n });\n\n maybeIt(features.settings.localizedDates)(\n 'relative dates must follow the selected language (dayjs locale)',\n () => {\n // fresh fixture so \"published … ago\" is a relative date\n const pkgName = '@verdaccio/dates-fixture';\n let tempFolder: string | null = null;\n cy.task('publishPackage', { pkgName, version: '1.0.0', unique: true }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n\n // switch the UI to German via the settings dialog\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').click();\n cy.contains('[role=\"dialog\"] .MuiCard-root', 'German').click({ force: true });\n cy.get('body').type('{esc}');\n\n // the language persists; a fresh page load must localize dayjs too\n const sidebar = `[data-testid=\"${config.testIds.package.sidebar}\"]`;\n cy.visit(`${config.registryUrl}/-/web/detail/${pkgName}`);\n cy.get(sidebar, { timeout: 10000 }).should('be.visible');\n // dayjs de locale renders relative times as \"vor ein paar Sekunden\";\n // the released UIs kept English (\"a few seconds ago\") in every language\n cy.get(sidebar).contains(/vor /);\n cy.get(sidebar).contains(/ago\\b/).should('not.exist');\n\n cy.task('unpublishPackage', { pkgName, tempFolder: tempFolder ?? undefined });\n cy.then(() => {\n if (tempFolder) cy.task('cleanupPublished', tempFolder);\n });\n }\n );\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,SAAgB,cAAc,QAAwB;CACpD,MAAM,EAAE,WAAW,OAAO;CAC1B,MAAM,EAAE,aAAa;CAErB,SAAS,6BAA6B;EACpC,iBAAiB;GACf,GAAG,MAAM,OAAO,WAAW;GAC3B,GAAG,IAAI,MAAM,CAAC,CAAC,OAAO,YAAY;EACpC,CAAC;EAED,GAAG,yDAAyD;GAC1D,GAAG,YAAY,OAAO,eAAe,CAAC,CAAC,MAAM;GA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/tests/settings.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\nimport { maybeIt } from '../features';\nimport { RegistryConfig } from '../types';\n\n/**\n * Tests for the header Settings dialog and the Translations (language)\n * picker inside it.\n *\n * Requires `web.showSettings: true` in the registry config — the gear\n * icon only renders when the flag is on (see HeaderRight in Verdaccio's\n * ui-components package).\n *\n * Selector strategy: the language cards in LanguageSwitch do NOT have\n * data-testids, so this suite leans on:\n * - MUI's ARIA roles: `[role=\"dialog\"]`, `[role=\"tab\"]`\n * - The stable English labels \"Configuration\", \"Translations\",\n * \"English\", \"German\", and the language description text, which are\n * bundled into the ui-theme via `@verdaccio/ui-i18n`\n * - The settings trigger's testid from Verdaccio's HeaderToolTipIcon:\n * `header--tooltip-settings`\n */\nexport function settingsTests(config: RegistryConfig) {\n const { header } = config.testIds;\n const { features } = config;\n\n describe('settings & language', () => {\n beforeEach(() => {\n cy.visit(config.registryUrl);\n cy.get('body').should('be.visible');\n });\n\n it('should open the settings dialog from the header', () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n // Dialog title key: dialog.settings.title → \"Configuration\" in EN.\n cy.contains('[role=\"dialog\"]', 'Configuration').should('be.visible');\n });\n\n it('should show both Package Managers and Translations tabs', () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n // 9.x adds a \"Publishing\" tab, so count the two this test is about as a minimum\n cy.get('[role=\"dialog\"] [role=\"tab\"]').should('have.length.at.least', 2);\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').should('be.visible');\n });\n\n it('should switch to the Translations tab and list languages', () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').click();\n // language.description text is bundled in EN — good sentinel.\n cy.contains('[role=\"dialog\"]', /this is the configuration details for the language/i).should(\n 'be.visible'\n );\n // Sanity-check a couple of language cards are rendered.\n cy.contains('[role=\"dialog\"]', 'English').should('be.visible');\n cy.contains('[role=\"dialog\"]', 'German').should('be.visible');\n });\n\n maybeIt(features.settings.languageSwitcher)(\n 'should change the UI language when a language card is clicked',\n () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').click();\n\n // Before switching, capture the current dialog title so we can\n // assert it changes. This avoids hard-coding the German string.\n cy.contains('[role=\"dialog\"]', 'Configuration')\n .invoke('text')\n .then((englishTitle) => {\n // Click the German card. We scope to the dialog + the MUI\n // card class to avoid matching other \"German\" text.\n // released UIs handle the click on the card, 9.x on its CardActionArea\n cy.contains('[role=\"dialog\"] .MuiCard-root', 'German').then(($card) => {\n const $area = $card.find('.MuiCardActionArea-root');\n cy.wrap($area.length ? $area : $card).click({ force: true });\n });\n\n // The English tab label \"Translations\" must no longer be\n // present anywhere in the dialog — strongest proof the\n // language actually switched.\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').should('not.exist');\n // And the original dialog title text should also be gone.\n cy.contains('[role=\"dialog\"]', englishTitle).should('not.exist');\n });\n }\n );\n\n it('should close the settings dialog with Escape', () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n cy.get('body').type('{esc}');\n cy.get('[role=\"dialog\"]').should('not.exist');\n });\n\n maybeIt(features.settings.localizedDates)(\n 'relative dates must follow the selected language (dayjs locale)',\n () => {\n // fresh fixture so \"published … ago\" is a relative date\n const pkgName = '@verdaccio/dates-fixture';\n let tempFolder: string | null = null;\n cy.task('publishPackage', { pkgName, version: '1.0.0', unique: true }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n\n // switch the UI to German via the settings dialog\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').click();\n cy.contains('[role=\"dialog\"] .MuiCard-root', 'German').click({ force: true });\n cy.get('body').type('{esc}');\n\n // the language persists; a fresh page load must localize dayjs too\n const sidebar = `[data-testid=\"${config.testIds.package.sidebar}\"]`;\n cy.visit(`${config.registryUrl}/-/web/detail/${pkgName}`);\n cy.get(sidebar, { timeout: 10000 }).should('be.visible');\n // dayjs de locale renders relative times as \"vor ein paar Sekunden\";\n // the released UIs kept English (\"a few seconds ago\") in every language\n cy.get(sidebar).contains(/vor /);\n cy.get(sidebar).contains(/ago\\b/).should('not.exist');\n\n cy.task('unpublishPackage', { pkgName, tempFolder: tempFolder ?? undefined });\n cy.then(() => {\n if (tempFolder) cy.task('cleanupPublished', tempFolder);\n });\n }\n );\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,SAAgB,cAAc,QAAwB;CACpD,MAAM,EAAE,WAAW,OAAO;CAC1B,MAAM,EAAE,aAAa;CAErB,SAAS,6BAA6B;EACpC,iBAAiB;GACf,GAAG,MAAM,OAAO,WAAW;GAC3B,GAAG,IAAI,MAAM,CAAC,CAAC,OAAO,YAAY;EACpC,CAAC;EAED,GAAG,yDAAyD;GAC1D,GAAG,YAAY,OAAO,eAAe,CAAC,CAAC,MAAM;GAC7C,GAAG,IAAI,mBAAiB,CAAC,CAAC,OAAO,YAAY;GAE7C,GAAG,SAAS,qBAAmB,eAAe,CAAC,CAAC,OAAO,YAAY;EACrE,CAAC;EAED,GAAG,iEAAiE;GAClE,GAAG,YAAY,OAAO,eAAe,CAAC,CAAC,MAAM;GAC7C,GAAG,IAAI,mBAAiB,CAAC,CAAC,OAAO,YAAY;GAE7C,GAAG,IAAI,kCAA8B,CAAC,CAAC,OAAO,wBAAwB,CAAC;GACvE,GAAG,SAAS,oCAAgC,cAAc,CAAC,CAAC,OAAO,YAAY;EACjF,CAAC;EAED,GAAG,kEAAkE;GACnE,GAAG,YAAY,OAAO,eAAe,CAAC,CAAC,MAAM;GAC7C,GAAG,IAAI,mBAAiB,CAAC,CAAC,OAAO,Y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,QAAQ;GAAK,CAAC,CAAC,CAAC,MAAM,WAAW;IACtF,aAAa,QAAQ,cAAc;GACrC,CAAC;GAGD,GAAG,YAAY,OAAO,eAAe,CAAC,CAAC,MAAM;GAC7C,GAAG,IAAI,mBAAiB,CAAC,CAAC,OAAO,YAAY;GAC7C,GAAG,SAAS,oCAAgC,cAAc,CAAC,CAAC,MAAM;GAClE,GAAG,SAAS,mCAAiC,QAAQ,CAAC,CAAC,MAAM,EAAE,OAAO,KAAK,CAAC;GAC5E,GAAG,IAAI,MAAM,CAAC,CAAC,KAAK,OAAO;GAG3B,MAAM,UAAU,iBAAiB,OAAO,QAAQ,QAAQ,QAAQ;GAChE,GAAG,MAAM,GAAG,OAAO,YAAY,gBAAgB,SAAS;GACxD,GAAG,IAAI,SAAS,EAAE,SAAS,IAAM,CAAC,CAAC,CAAC,OAAO,YAAY;GAGvD,GAAG,IAAI,OAAO,CAAC,CAAC,SAAS,MAAM;GAC/B,GAAG,IAAI,OAAO,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,OAAO,WAAW;GAEpD,GAAG,KAAK,oBAAoB;IAAE;IAAS,YAAY,cAAc,KAAA;GAAU,CAAC;GAC5E,GAAG,WAAW;IACZ,IAAI,YAAY,GAAG,KAAK,oBAAoB,UAAU;GACxD,CAAC;EACH,CACF;CACF,CAAC;AACH"}
@@ -226,6 +226,63 @@ export interface Features {
226
226
  */
227
227
  validation: boolean;
228
228
  };
229
+ homeDetailUx: {
230
+ /**
231
+ * Whether to run the home toolbar tests: filter narrows the list and
232
+ * lives in `?q=`, `?scope=` restores the scope, no-match message.
233
+ * Ships with the 9.x home toolbar — probe, defaults to `false`.
234
+ */
235
+ homeToolbar: boolean;
236
+ /**
237
+ * Whether to assert the package page tab lives in `?tab=` (click
238
+ * writes it, a link opens it, readme removes it) — probe.
239
+ */
240
+ detailTabInUrl: boolean;
241
+ /**
242
+ * Whether to assert the step-by-step welcome card (setup tabs per
243
+ * package manager, `.npmrc` tab, uplinks note) — probe.
244
+ */
245
+ welcomeGuide: boolean;
246
+ /**
247
+ * Whether to assert the sidebar install box lists `bun` and the
248
+ * `.npmrc` registry line. Needs `bun` in `web.pkgManagers` (default
249
+ * on 9.x) — probe.
250
+ */
251
+ installBunAndNpmrc: boolean;
252
+ /**
253
+ * Whether to assert that a copy button confirms the copy (its
254
+ * accessible name switches to "Copied") — probe.
255
+ */
256
+ copyFeedback: boolean;
257
+ /**
258
+ * Whether to assert search results are grouped by origin and a
259
+ * locally published package lands in the "published here" group.
260
+ * Needs `web.showUplinks` (default true) — probe.
261
+ */
262
+ searchGrouping: boolean;
263
+ /**
264
+ * Whether to assert that the version on each home list item links
265
+ * to its version page `/-/web/detail/<name>/v/<version>` — probe.
266
+ */
267
+ versionLink: boolean;
268
+ /**
269
+ * Whether to assert the settings dialog has a "Publishing" tab with
270
+ * the welcome guide, so it stays reachable once packages exist — probe.
271
+ */
272
+ settingsPublishTab: boolean;
273
+ };
274
+ provenance: {
275
+ /**
276
+ * Whether to run the "Provenance" sidebar section tests: a version
277
+ * carrying `dist.attestations` or `dist.signatures` shows a chip
278
+ * under "Distribution" that opens a dialog with the statement type,
279
+ * the signing key ids and a link to the attestation bundle, and the
280
+ * build details are only requested when the server announces the
281
+ * endpoint (`capabilities.provenance`). Ships with 9.x
282
+ * (verdaccio/verdaccio#6447) — probe, defaults to `false`.
283
+ */
284
+ sidebarSection: boolean;
285
+ };
229
286
  changePassword: {
230
287
  /**
231
288
  * 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, detailTests, failureModeTests, i18nKeyTests, manifestRenderingTests, sessionTests, signupTests, } from './tests';
9
+ export { homeTests, signinTests, publishTests, searchTests, settingsTests, layoutTests, changePasswordTests, detailTests, failureModeTests, i18nKeyTests, manifestRenderingTests, sessionTests, signupTests, homeDetailUxTests, provenanceTests, } from './tests';
10
10
  /**
11
11
  * Build a full RegistryConfig from user-provided options with defaults.
12
12
  *
@@ -21,6 +21,20 @@ export interface TestIds {
21
21
  helpCard: string;
22
22
  /** 404 "not found" container. */
23
23
  notFound: string;
24
+ /** Filter / scope / sort bar above the package list (9.x). */
25
+ packageListToolbar: string;
26
+ /** Text filter input inside the toolbar. */
27
+ packageListFilter: string;
28
+ /** Native input of the scope select (only with more than one scope). */
29
+ packageListScope: string;
30
+ /** Message shown when the filter matches no package. */
31
+ packageListNoMatch: string;
32
+ /** Prefix of the welcome card setup tabs: `<prefix><manager>`. */
33
+ helpSetupTabPrefix: string;
34
+ /** Note on the welcome card explaining cached uplink packages. */
35
+ helpUplinksNote: string;
36
+ /** Step list of the publishing guide, in the welcome card and the settings (9.x). */
37
+ helpGuide: string;
24
38
  };
25
39
  header: {
26
40
  /** Outermost `<NavBar>` element. */
@@ -39,6 +53,10 @@ export interface TestIds {
39
53
  loginButton: string;
40
54
  /** Gear icon that opens the settings dialog. */
41
55
  settingsTooltip: string;
56
+ /** "Publishing" tab of the settings dialog (9.x). */
57
+ settingsPublishTab: string;
58
+ /** Panel of the "Publishing" tab (9.x). */
59
+ settingsPublishPanel: string;
42
60
  /** Info icon that opens the registry info dialog. */
43
61
  infoTooltip: string;
44
62
  /**
@@ -79,6 +97,8 @@ export interface TestIds {
79
97
  itemList: string;
80
98
  /** Package name link in the package list (home + search results). */
81
99
  title: string;
100
+ /** Version link of a package list item, to its version page (9.x). */
101
+ versionLink: string;
82
102
  /** Readme container on the package detail page. */
83
103
  readme: string;
84
104
  /** Sidebar container on the package detail page. */
@@ -91,6 +111,18 @@ export interface TestIds {
91
111
  installYarn: string;
92
112
  /** Individual install line for pnpm. */
93
113
  installPnpm: string;
114
+ /** Individual install line for bun (9.x). */
115
+ installBun: string;
116
+ /** `.npmrc` registry line below the install commands (9.x). */
117
+ installNpmrc: string;
118
+ /** Copy button of the `.npmrc` registry line. */
119
+ installNpmrcCopy: string;
120
+ /** Chip of the "Provenance" sidebar section that opens the provenance dialog (9.x). */
121
+ provenanceBadge: string;
122
+ /** Root of the provenance dialog (shares the registry info dialog container). */
123
+ provenanceDialog: string;
124
+ /** Tab that shows the readme. */
125
+ readmeTab: string;
94
126
  /** Keyword list below the install section. */
95
127
  keywordList: string;
96
128
  /** Tab that reveals the dependencies view. */
@@ -116,6 +148,12 @@ export interface TestIds {
116
148
  /** Close button inside the raw viewer dialog. */
117
149
  closeRawViewer: string;
118
150
  };
151
+ search: {
152
+ /** Prefix of the origin group headers: `<prefix>private|cached|remote`. */
153
+ groupPrefix: string;
154
+ /** Prefix of the origin icon on each result: `<prefix>private|...`. */
155
+ originPrefix: string;
156
+ };
119
157
  errors: {
120
158
  /**
121
159
  * Generic error page shown when a data request fails without a
@@ -0,0 +1,10 @@
1
+ import { RegistryConfig } from '../types';
2
+ /**
3
+ * Home and package page UX that ships with the 9.x web UI: the package
4
+ * list toolbar, the tab in the address, the welcome guide, the install
5
+ * box (bun and `.npmrc`), copy feedback and search grouped by origin.
6
+ *
7
+ * Every test is a probe (flag defaults to `false`): released lines do
8
+ * not have these features yet.
9
+ */
10
+ export declare function homeDetailUxTests(config: RegistryConfig): void;
@@ -11,3 +11,5 @@ export { i18nKeyTests } from './i18n-keys';
11
11
  export { signupTests } from './signup';
12
12
  export { manifestRenderingTests } from './manifest-rendering';
13
13
  export { sessionTests } from './session';
14
+ export { homeDetailUxTests } from './home-detail-ux';
15
+ export { provenanceTests } from './provenance';
@@ -0,0 +1,13 @@
1
+ import { RegistryConfig } from '../types';
2
+ /**
3
+ * "Provenance" sidebar section (9.x, verdaccio/verdaccio#6447).
4
+ *
5
+ * registry.npmjs.org attaches `dist.signatures` and `dist.attestations` to
6
+ * every version it signs; the UI shows them without verifying anything in
7
+ * the browser. The fixtures below publish those fields themselves (npm keeps
8
+ * extra `dist` fields on publish), so the suite runs offline and does not
9
+ * need an uplink. The build details come from the registry only when it
10
+ * announces the endpoint, so against this fixture the dialog ends at the
11
+ * summary.
12
+ */
13
+ export declare function provenanceTests(config: RegistryConfig): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdaccio/e2e-ui",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Cypress plugin for Verdaccio UI e2e tests — run against any registry",