@nextsparkjs/theme-default 0.1.0-beta.20 → 0.1.0-beta.21

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 (220) hide show
  1. package/package.json +1 -1
  2. package/tests/cypress/e2e/_devtools/access.bdd.md +262 -0
  3. package/tests/cypress/e2e/_devtools/access.cy.ts +171 -0
  4. package/tests/cypress/e2e/_devtools/navigation.bdd.md +261 -0
  5. package/tests/cypress/e2e/_devtools/navigation.cy.ts +157 -0
  6. package/tests/cypress/e2e/_devtools/pages.bdd.md +303 -0
  7. package/tests/cypress/e2e/_devtools/pages.cy.ts +184 -0
  8. package/tests/cypress/e2e/_docs/README.md +215 -0
  9. package/tests/cypress/e2e/_docs/tutorials/sector7-superadmin-teams.narration.json +155 -0
  10. package/tests/cypress/e2e/_docs/tutorials/sector7-superadmin.cy.ts +390 -0
  11. package/tests/cypress/e2e/_docs/tutorials/teams-system.doc.cy.ts +349 -0
  12. package/tests/cypress/e2e/_docs/tutorials/teams-system.narration.json +165 -0
  13. package/tests/cypress/e2e/_selectors/auth.cy.ts +306 -0
  14. package/tests/cypress/e2e/_selectors/billing.cy.ts +89 -0
  15. package/tests/cypress/e2e/_selectors/dashboard-mobile.cy.ts +113 -0
  16. package/tests/cypress/e2e/_selectors/dashboard-navigation.cy.ts +89 -0
  17. package/tests/cypress/e2e/_selectors/dashboard-sidebar.cy.ts +60 -0
  18. package/tests/cypress/e2e/_selectors/dashboard-topnav.cy.ts +146 -0
  19. package/tests/cypress/e2e/_selectors/devtools.cy.ts +210 -0
  20. package/tests/cypress/e2e/_selectors/global-search.cy.ts +88 -0
  21. package/tests/cypress/e2e/_selectors/pages-editor.cy.ts +179 -0
  22. package/tests/cypress/e2e/_selectors/posts-editor.cy.ts +282 -0
  23. package/tests/cypress/e2e/_selectors/public.cy.ts +112 -0
  24. package/tests/cypress/e2e/_selectors/settings-api-keys.cy.ts +228 -0
  25. package/tests/cypress/e2e/_selectors/settings-billing.cy.ts +105 -0
  26. package/tests/cypress/e2e/_selectors/settings-layout.cy.ts +119 -0
  27. package/tests/cypress/e2e/_selectors/settings-password.cy.ts +71 -0
  28. package/tests/cypress/e2e/_selectors/settings-profile.cy.ts +82 -0
  29. package/tests/cypress/e2e/_selectors/settings-teams.cy.ts +68 -0
  30. package/tests/cypress/e2e/_selectors/superadmin.cy.ts +185 -0
  31. package/tests/cypress/e2e/_selectors/tasks.cy.ts +242 -0
  32. package/tests/cypress/e2e/_selectors/taxonomies.cy.ts +126 -0
  33. package/tests/cypress/e2e/_selectors/teams.cy.ts +142 -0
  34. package/tests/cypress/e2e/_superadmin/all-teams.bdd.md +261 -0
  35. package/tests/cypress/e2e/_superadmin/all-teams.cy.ts +177 -0
  36. package/tests/cypress/e2e/_superadmin/all-users.bdd.md +406 -0
  37. package/tests/cypress/e2e/_superadmin/all-users.cy.ts +294 -0
  38. package/tests/cypress/e2e/_superadmin/dashboard.bdd.md +235 -0
  39. package/tests/cypress/e2e/_superadmin/dashboard.cy.ts +149 -0
  40. package/tests/cypress/e2e/_superadmin/subscriptions-overview.bdd.md +290 -0
  41. package/tests/cypress/e2e/_superadmin/subscriptions-overview.cy.ts +194 -0
  42. package/tests/cypress/e2e/ai/ai-usage.cy.ts +209 -0
  43. package/tests/cypress/e2e/ai/chat-api.cy.ts +107 -0
  44. package/tests/cypress/e2e/ai/guardrails.cy.ts +332 -0
  45. package/tests/cypress/e2e/api/billing/BillingAPIController.js +319 -0
  46. package/tests/cypress/e2e/api/billing/check-action.cy.ts +326 -0
  47. package/tests/cypress/e2e/api/billing/checkout.cy.ts +358 -0
  48. package/tests/cypress/e2e/api/billing/lifecycle.cy.ts +423 -0
  49. package/tests/cypress/e2e/api/billing/plans/README.md +345 -0
  50. package/tests/cypress/e2e/api/billing/plans/business.cy.ts +412 -0
  51. package/tests/cypress/e2e/api/billing/plans/downgrade.cy.ts +510 -0
  52. package/tests/cypress/e2e/api/billing/plans/fixtures/billing-plans.json +163 -0
  53. package/tests/cypress/e2e/api/billing/plans/free.cy.ts +500 -0
  54. package/tests/cypress/e2e/api/billing/plans/pro.cy.ts +497 -0
  55. package/tests/cypress/e2e/api/billing/plans/starter.cy.ts +342 -0
  56. package/tests/cypress/e2e/api/billing/portal.cy.ts +313 -0
  57. package/tests/cypress/e2e/api/devtools/registries.bdd.md +300 -0
  58. package/tests/cypress/e2e/api/devtools/registries.cy.ts +368 -0
  59. package/tests/cypress/e2e/api/entities/blocks-scope.cy.ts +396 -0
  60. package/tests/cypress/e2e/api/entities/customers-crud.cy.ts +648 -0
  61. package/tests/cypress/e2e/api/entities/customers-metas.cy.ts +839 -0
  62. package/tests/cypress/e2e/api/entities/pages-crud.cy.ts +425 -0
  63. package/tests/cypress/e2e/api/entities/pages-status.cy.ts +335 -0
  64. package/tests/cypress/e2e/api/entities/post-categories-crud.cy.ts +610 -0
  65. package/tests/cypress/e2e/api/entities/posts-crud.cy.ts +709 -0
  66. package/tests/cypress/e2e/api/entities/posts-status.cy.ts +396 -0
  67. package/tests/cypress/e2e/api/entities/tasks-crud.cy.ts +602 -0
  68. package/tests/cypress/e2e/api/entities/tasks-metas.cy.ts +878 -0
  69. package/tests/cypress/e2e/api/entities/users-crud.cy.ts +469 -0
  70. package/tests/cypress/e2e/api/entities/users-metas.cy.ts +913 -0
  71. package/tests/cypress/e2e/api/entities/users-security.cy.ts +375 -0
  72. package/tests/cypress/e2e/api/scheduled-actions/cron-endpoint.bdd.md +375 -0
  73. package/tests/cypress/e2e/api/scheduled-actions/cron-endpoint.cy.ts +346 -0
  74. package/tests/cypress/e2e/api/scheduled-actions/devtools-endpoint.bdd.md +451 -0
  75. package/tests/cypress/e2e/api/scheduled-actions/devtools-endpoint.cy.ts +447 -0
  76. package/tests/cypress/e2e/api/scheduled-actions/scheduling.bdd.md +649 -0
  77. package/tests/cypress/e2e/api/scheduled-actions/scheduling.cy.ts +333 -0
  78. package/tests/cypress/e2e/api/settings/api-keys.crud.cy.ts +923 -0
  79. package/tests/cypress/e2e/uat/auth/app-roles/developer-login.bdd.md +231 -0
  80. package/tests/cypress/e2e/uat/auth/app-roles/developer-login.cy.ts +144 -0
  81. package/tests/cypress/e2e/uat/auth/app-roles/superadmin-login.bdd.md +118 -0
  82. package/tests/cypress/e2e/uat/auth/app-roles/superadmin-login.cy.ts +84 -0
  83. package/tests/cypress/e2e/uat/auth/custom-roles/editor-login.bdd.md +288 -0
  84. package/tests/cypress/e2e/uat/auth/custom-roles/editor-login.cy.ts +188 -0
  85. package/tests/cypress/e2e/uat/auth/login-logout.bdd.md +160 -0
  86. package/tests/cypress/e2e/uat/auth/login-logout.cy.ts +116 -0
  87. package/tests/cypress/e2e/uat/auth/password-reset.bdd.md +289 -0
  88. package/tests/cypress/e2e/uat/auth/password-reset.cy.ts +200 -0
  89. package/tests/cypress/e2e/uat/auth/team-roles/admin-login.bdd.md +225 -0
  90. package/tests/cypress/e2e/uat/auth/team-roles/admin-login.cy.ts +148 -0
  91. package/tests/cypress/e2e/uat/auth/team-roles/member-login.bdd.md +251 -0
  92. package/tests/cypress/e2e/uat/auth/team-roles/member-login.cy.ts +163 -0
  93. package/tests/cypress/e2e/uat/auth/team-roles/owner-login.bdd.md +231 -0
  94. package/tests/cypress/e2e/uat/auth/team-roles/owner-login.cy.ts +141 -0
  95. package/tests/cypress/e2e/uat/billing/extended.bdd.md +273 -0
  96. package/tests/cypress/e2e/uat/billing/extended.cy.ts +209 -0
  97. package/tests/cypress/e2e/uat/billing/feature-gates.bdd.md +407 -0
  98. package/tests/cypress/e2e/uat/billing/feature-gates.cy.ts +307 -0
  99. package/tests/cypress/e2e/uat/billing/page.bdd.md +329 -0
  100. package/tests/cypress/e2e/uat/billing/page.cy.ts +250 -0
  101. package/tests/cypress/e2e/uat/billing/status.bdd.md +190 -0
  102. package/tests/cypress/e2e/uat/billing/status.cy.ts +145 -0
  103. package/tests/cypress/e2e/uat/billing/team-switch.bdd.md +156 -0
  104. package/tests/cypress/e2e/uat/billing/team-switch.cy.ts +122 -0
  105. package/tests/cypress/e2e/uat/billing/usage.bdd.md +218 -0
  106. package/tests/cypress/e2e/uat/billing/usage.cy.ts +176 -0
  107. package/tests/cypress/e2e/uat/blocks/hero.bdd.md +124 -0
  108. package/tests/cypress/e2e/uat/blocks/hero.cy.ts +56 -0
  109. package/tests/cypress/e2e/uat/devtools/api-tester.cy.ts +390 -0
  110. package/tests/cypress/e2e/uat/entities/customers/member.bdd.md +275 -0
  111. package/tests/cypress/e2e/uat/entities/customers/member.cy.ts +122 -0
  112. package/tests/cypress/e2e/uat/entities/customers/owner.bdd.md +243 -0
  113. package/tests/cypress/e2e/uat/entities/customers/owner.cy.ts +165 -0
  114. package/tests/cypress/e2e/uat/entities/pages/block-crud.bdd.md +476 -0
  115. package/tests/cypress/e2e/uat/entities/pages/block-crud.cy.ts +486 -0
  116. package/tests/cypress/e2e/uat/entities/pages/block-editor.bdd.md +460 -0
  117. package/tests/cypress/e2e/uat/entities/pages/block-editor.cy.ts +301 -0
  118. package/tests/cypress/e2e/uat/entities/pages/list.bdd.md +432 -0
  119. package/tests/cypress/e2e/uat/entities/pages/list.cy.ts +273 -0
  120. package/tests/cypress/e2e/uat/entities/pages/public-rendering.bdd.md +696 -0
  121. package/tests/cypress/e2e/uat/entities/pages/public-rendering.cy.ts +340 -0
  122. package/tests/cypress/e2e/uat/entities/posts/categories-api-aware.bdd.md +161 -0
  123. package/tests/cypress/e2e/uat/entities/posts/categories-api-aware.cy.ts +104 -0
  124. package/tests/cypress/e2e/uat/entities/posts/categories.bdd.md +375 -0
  125. package/tests/cypress/e2e/uat/entities/posts/categories.cy.ts +241 -0
  126. package/tests/cypress/e2e/uat/entities/posts/editor.bdd.md +429 -0
  127. package/tests/cypress/e2e/uat/entities/posts/editor.cy.ts +257 -0
  128. package/tests/cypress/e2e/uat/entities/posts/list.bdd.md +340 -0
  129. package/tests/cypress/e2e/uat/entities/posts/list.cy.ts +177 -0
  130. package/tests/cypress/e2e/uat/entities/posts/public.bdd.md +614 -0
  131. package/tests/cypress/e2e/uat/entities/posts/public.cy.ts +249 -0
  132. package/tests/cypress/e2e/uat/entities/tasks/member.bdd.md +222 -0
  133. package/tests/cypress/e2e/uat/entities/tasks/member.cy.ts +165 -0
  134. package/tests/cypress/e2e/uat/entities/tasks/owner.bdd.md +419 -0
  135. package/tests/cypress/e2e/uat/entities/tasks/owner.cy.ts +191 -0
  136. package/tests/cypress/e2e/uat/roles/editor-role.bdd.md +552 -0
  137. package/tests/cypress/e2e/uat/roles/editor-role.cy.ts +210 -0
  138. package/tests/cypress/e2e/uat/roles/member-restrictions.bdd.md +450 -0
  139. package/tests/cypress/e2e/uat/roles/member-restrictions.cy.ts +189 -0
  140. package/tests/cypress/e2e/uat/roles/owner-full-crud.bdd.md +530 -0
  141. package/tests/cypress/e2e/uat/roles/owner-full-crud.cy.ts +247 -0
  142. package/tests/cypress/e2e/uat/scheduled-actions/devtools-ui.bdd.md +736 -0
  143. package/tests/cypress/e2e/uat/scheduled-actions/devtools-ui.cy.ts +740 -0
  144. package/tests/cypress/e2e/uat/teams/roles-matrix.bdd.md +553 -0
  145. package/tests/cypress/e2e/uat/teams/roles-matrix.cy.ts +185 -0
  146. package/tests/cypress/e2e/uat/teams/switcher.bdd.md +1151 -0
  147. package/tests/cypress/e2e/uat/teams/switcher.cy.ts +497 -0
  148. package/tests/cypress/e2e/uat/teams/team-switcher.md +198 -0
  149. package/tests/cypress/fixtures/blocks.json +218 -0
  150. package/tests/cypress/fixtures/entities.json +78 -0
  151. package/tests/cypress/fixtures/page-builder.json +21 -0
  152. package/tests/cypress/src/components/CategoriesPOM.ts +382 -0
  153. package/tests/cypress/src/components/CustomersPOM.ts +439 -0
  154. package/tests/cypress/src/components/DevKeyringPOM.ts +160 -0
  155. package/tests/cypress/src/components/EntityForm.ts +375 -0
  156. package/tests/cypress/src/components/EntityList.ts +389 -0
  157. package/tests/cypress/src/components/PageBuilderPOM.ts +710 -0
  158. package/tests/cypress/src/components/PostEditorPOM.ts +370 -0
  159. package/tests/cypress/src/components/PostsListPOM.ts +223 -0
  160. package/tests/cypress/src/components/PublicPagePOM.ts +447 -0
  161. package/tests/cypress/src/components/PublicPostPOM.ts +146 -0
  162. package/tests/cypress/src/components/TasksPOM.ts +272 -0
  163. package/tests/cypress/src/components/TeamSwitcherPOM.ts +450 -0
  164. package/tests/cypress/src/components/index.ts +21 -0
  165. package/tests/cypress/src/controllers/ApiKeysAPIController.js +178 -0
  166. package/tests/cypress/src/controllers/BaseAPIController.js +317 -0
  167. package/tests/cypress/src/controllers/CustomerAPIController.js +251 -0
  168. package/tests/cypress/src/controllers/PagesAPIController.js +226 -0
  169. package/tests/cypress/src/controllers/PostsAPIController.js +250 -0
  170. package/tests/cypress/src/controllers/TaskAPIController.js +240 -0
  171. package/tests/cypress/src/controllers/UsersAPIController.js +242 -0
  172. package/tests/cypress/src/controllers/index.js +25 -0
  173. package/tests/cypress/src/core/AuthPOM.ts +450 -0
  174. package/tests/cypress/src/core/BasePOM.ts +86 -0
  175. package/tests/cypress/src/core/BlockEditorBasePOM.ts +576 -0
  176. package/tests/cypress/src/core/DashboardEntityPOM.ts +692 -0
  177. package/tests/cypress/src/core/index.ts +14 -0
  178. package/tests/cypress/src/entities/CustomersPOM.ts +172 -0
  179. package/tests/cypress/src/entities/PagesPOM.ts +137 -0
  180. package/tests/cypress/src/entities/PostsPOM.ts +137 -0
  181. package/tests/cypress/src/entities/TasksPOM.ts +176 -0
  182. package/tests/cypress/src/entities/index.ts +14 -0
  183. package/tests/cypress/src/features/BillingPOM.ts +385 -0
  184. package/tests/cypress/src/features/DashboardPOM.ts +245 -0
  185. package/tests/cypress/src/features/DevtoolsPOM.ts +739 -0
  186. package/tests/cypress/src/features/PageBuilderPOM.ts +263 -0
  187. package/tests/cypress/src/features/PostEditorPOM.ts +313 -0
  188. package/tests/cypress/src/features/ScheduledActionsPOM.ts +463 -0
  189. package/tests/cypress/src/features/SettingsPOM.ts +362 -0
  190. package/tests/cypress/src/features/SuperadminPOM.ts +331 -0
  191. package/tests/cypress/src/features/SuperadminTeamRolesPOM.ts +285 -0
  192. package/tests/cypress/src/features/index.ts +28 -0
  193. package/tests/cypress/src/helpers/ApiInterceptor.ts +177 -0
  194. package/tests/cypress/src/index.ts +101 -0
  195. package/tests/cypress/src/pages/dashboard/Dashboard.js +677 -0
  196. package/tests/cypress/src/pages/dashboard/DashboardPage.js +43 -0
  197. package/tests/cypress/src/pages/dashboard/DashboardStats.js +546 -0
  198. package/tests/cypress/src/pages/dashboard/index.js +6 -0
  199. package/tests/cypress/src/pages/index.js +5 -0
  200. package/tests/cypress/src/pages/public/FeaturesPage.js +28 -0
  201. package/tests/cypress/src/pages/public/LandingPage.js +69 -0
  202. package/tests/cypress/src/pages/public/PricingPage.js +33 -0
  203. package/tests/cypress/src/pages/public/index.js +6 -0
  204. package/tests/cypress/src/selectors.ts +46 -0
  205. package/tests/cypress/src/session-helpers.ts +500 -0
  206. package/tests/cypress/support/doc-commands.ts +260 -0
  207. package/tests/cypress.config.ts +150 -0
  208. package/tests/jest/components/post-header.test.tsx +377 -0
  209. package/tests/jest/config/role-config.test.ts +529 -0
  210. package/tests/jest/jest.config.ts +81 -0
  211. package/tests/jest/langchain/COVERAGE.md +372 -0
  212. package/tests/jest/langchain/guardrails.test.ts +465 -0
  213. package/tests/jest/langchain/streaming.test.ts +367 -0
  214. package/tests/jest/langchain/token-tracker.test.ts +455 -0
  215. package/tests/jest/langchain/tracer-callbacks.test.ts +881 -0
  216. package/tests/jest/langchain/tracer.test.ts +823 -0
  217. package/tests/jest/user-roles/role-helpers.test.ts +432 -0
  218. package/tests/jest/validation/categories.test.ts +429 -0
  219. package/tests/jest/validation/posts.test.ts +546 -0
  220. package/tests/tsconfig.json +15 -0
@@ -0,0 +1,189 @@
1
+ /// <reference types="cypress" />
2
+
3
+ import * as allure from 'allure-cypress'
4
+
5
+ import { CustomersPOM } from '../../../src/entities/CustomersPOM'
6
+ import { TasksPOM } from '../../../src/entities/TasksPOM'
7
+ import { loginAsDefaultMember } from '../../../src/session-helpers'
8
+
9
+ describe('Member Role - Permission Restrictions', {
10
+ tags: ['@uat', '@feat-teams', '@security', '@role-member', '@regression']
11
+ }, () => {
12
+ const customers = CustomersPOM.create()
13
+
14
+ beforeEach(() => {
15
+ allure.epic('UAT')
16
+ allure.feature('Permissions')
17
+ allure.story('Member Restrictions')
18
+ customers.setupApiIntercepts()
19
+ loginAsDefaultMember()
20
+ })
21
+
22
+ describe('UI Restrictions - Buttons Hidden/Disabled', { tags: '@smoke' }, () => {
23
+ it('PERM_UI_001: Create Customer button not visible for Member', { tags: '@smoke' }, () => {
24
+ allure.severity('critical')
25
+
26
+ customers.visitList()
27
+ customers.api.waitForList()
28
+ customers.waitForList()
29
+
30
+ // Create button should not exist for Member (no create permission)
31
+ cy.get(customers.selectors.addButton).should('not.exist')
32
+
33
+ cy.log('✅ Create button correctly hidden for Member')
34
+ })
35
+
36
+ it('PERM_UI_002: Delete Customer buttons not visible for Member', () => {
37
+ customers.visitList()
38
+ customers.api.waitForList()
39
+ customers.waitForList()
40
+
41
+ cy.get('body').then($body => {
42
+ if ($body.find(customers.selectors.rowGeneric).length > 0) {
43
+ // Delete action buttons should NOT exist for Member
44
+ cy.get(customers.selectors.rowActionDeleteGeneric).should('not.exist')
45
+ cy.log('✅ Delete buttons correctly hidden for Member')
46
+ } else {
47
+ cy.log('⚠️ No customers to check delete permission')
48
+ }
49
+ })
50
+ })
51
+
52
+ it('PERM_UI_003: Edit Customer buttons not visible for Member', () => {
53
+ // NOTE: Based on real system behavior, Member CANNOT edit customers
54
+ customers.visitList()
55
+ customers.api.waitForList()
56
+ customers.waitForList()
57
+
58
+ cy.get('body').then($body => {
59
+ if ($body.find(customers.selectors.rowGeneric).length > 0) {
60
+ // Edit action buttons should NOT exist for Member (no edit permission)
61
+ cy.get(customers.selectors.rowActionEditGeneric).should('not.exist')
62
+ cy.log('✅ Edit buttons correctly hidden for Member')
63
+ } else {
64
+ cy.log('⚠️ No customers to check edit permission')
65
+ }
66
+ })
67
+ })
68
+ })
69
+
70
+ describe('URL Access Restrictions - Permission Denied Component', () => {
71
+ it('PERM_URL_001: Direct URL to /customers/create shows Permission Denied', () => {
72
+ // Direct access to create route should show permission denied
73
+ cy.visit(`/dashboard/${customers.entitySlug}/create`)
74
+
75
+ // Check for permission denied component OR redirect
76
+ cy.get('body').then($body => {
77
+ if ($body.find('[data-cy="permission-denied"]').length > 0) {
78
+ cy.get('[data-cy="permission-denied"]').should('be.visible')
79
+ cy.log('✅ Permission Denied component shown for /create')
80
+ } else {
81
+ // App redirects to permission-denied page
82
+ cy.url().should('include', 'permission-denied')
83
+ cy.log('✅ Redirected to permission denied page')
84
+ }
85
+ })
86
+ })
87
+
88
+ it('PERM_URL_002: Delete button not visible on customer detail for Member', () => {
89
+ // NOTE: /delete URL route doesn't exist - delete is done from detail page
90
+ // We verify that the delete button is not visible on the detail page
91
+ customers.visitList()
92
+ customers.api.waitForList()
93
+
94
+ cy.get('body').then($body => {
95
+ if ($body.find(customers.selectors.rowGeneric).length > 0) {
96
+ // Click on first customer to go to detail
97
+ cy.get(customers.selectors.rowGeneric).first().click()
98
+
99
+ // Wait for detail page (without waiting for edit button since Member can't edit)
100
+ cy.url().should('match', new RegExp(`/dashboard/${customers.entitySlug}/[a-z0-9-]+`))
101
+
102
+ // Delete button should NOT exist for Member
103
+ cy.get(customers.selectors.deleteButton).should('not.exist')
104
+
105
+ cy.log('✅ Delete button correctly hidden on detail page for Member')
106
+ } else {
107
+ cy.log('⚠️ No customers to test delete restriction')
108
+ }
109
+ })
110
+ })
111
+
112
+ it('PERM_URL_003: Direct URL to /customers/[id]/edit shows Permission Denied for Member', () => {
113
+ // NOTE: Based on real system behavior, Member CANNOT edit customers
114
+ customers.visitList()
115
+ customers.api.waitForList()
116
+
117
+ cy.get('body').then($body => {
118
+ if ($body.find(customers.selectors.rowGeneric).length > 0) {
119
+ // Extract customer ID from first row
120
+ cy.get(customers.selectors.rowGeneric).first()
121
+ .invoke('attr', 'data-cy')
122
+ .then((dataCy) => {
123
+ const customerId = dataCy?.replace(`${customers.entitySlug}-row-`, '')
124
+
125
+ if (customerId) {
126
+ // Try to access edit URL directly
127
+ cy.visit(`/dashboard/${customers.entitySlug}/${customerId}/edit`)
128
+
129
+ // Should show permission denied or redirect
130
+ cy.get('body').then($body2 => {
131
+ if ($body2.find('[data-cy="permission-denied"]').length > 0) {
132
+ cy.get('[data-cy="permission-denied"]').should('be.visible')
133
+ cy.log('✅ Permission Denied shown for /edit')
134
+ } else {
135
+ // App might redirect to permission-denied page or detail view
136
+ cy.url().should('not.include', '/edit')
137
+ cy.log('✅ Redirected away from /edit (no permission)')
138
+ }
139
+ })
140
+ }
141
+ })
142
+ } else {
143
+ cy.log('⚠️ No customers to test edit URL restriction')
144
+ }
145
+ })
146
+ })
147
+
148
+ it('PERM_URL_004: Direct URL to /tasks routes is ALLOWED for Member', () => {
149
+ // Member has full access to tasks
150
+ const tasks = TasksPOM.create()
151
+ tasks.setupApiIntercepts()
152
+
153
+ cy.visit(`/dashboard/${tasks.entitySlug}/create`)
154
+
155
+ // Should NOT show permission denied
156
+ cy.get('[data-cy="permission-denied"]').should('not.exist')
157
+
158
+ // Should show task form
159
+ tasks.waitForForm()
160
+
161
+ cy.log('✅ Tasks routes correctly accessible for Member')
162
+ })
163
+ })
164
+
165
+ describe('Permission Messages - User Feedback', () => {
166
+ it('PERM_MSG_001: Permission denied message is user-friendly', () => {
167
+ cy.visit(`/dashboard/${customers.entitySlug}/create`)
168
+
169
+ cy.get('body').then($body => {
170
+ if ($body.find('[data-cy="permission-denied"]').length > 0) {
171
+ // Check for user-friendly message
172
+ cy.get('[data-cy="permission-denied"]').within(() => {
173
+ cy.contains(/permission|access|not allowed/i).should('be.visible')
174
+ })
175
+
176
+ cy.log('✅ User-friendly permission message shown')
177
+ } else {
178
+ // Redirected to permission-denied page
179
+ cy.url().should('include', 'permission-denied')
180
+ cy.log('⚠️ Redirected to permission denied page (check message there)')
181
+ }
182
+ })
183
+ })
184
+ })
185
+
186
+ after(() => {
187
+ cy.log('✅ Permission restriction tests completed')
188
+ })
189
+ })
@@ -0,0 +1,530 @@
1
+ # Owner Role - Full CRUD Permissions (Format: BDD/Gherkin - Bilingual)
2
+
3
+ > **Test File:** `owner-full-crud.cy.ts`
4
+ > **Format:** Behavior-Driven Development (BDD) with Given/When/Then
5
+ > **Languages:** English / Spanish (side-by-side)
6
+ > **Total Tests:** 10
7
+
8
+ ---
9
+
10
+ ## Feature: Owner Role Full CRUD Permissions
11
+
12
+ <table>
13
+ <tr>
14
+ <th width="50%">English</th>
15
+ <th width="50%">Español</th>
16
+ </tr>
17
+ <tr>
18
+ <td>
19
+
20
+ As an **Owner** (protected role with hierarchy level 100)
21
+ I want to **have full CRUD access to all entities**
22
+ So that **I can manage all data in my team**
23
+
24
+ **Verification Focus:** These tests confirm that the extensible roles system does not break existing Owner capabilities.
25
+ - Owner should see all CRUD buttons
26
+ - Owner should be able to perform all operations
27
+ - Owner should access all routes without restrictions
28
+
29
+ </td>
30
+ <td>
31
+
32
+ Como **Owner** (rol protegido con nivel de jerarquia 100)
33
+ Quiero **tener acceso CRUD completo a todas las entidades**
34
+ Para que **pueda gestionar todos los datos de mi equipo**
35
+
36
+ **Enfoque de Verificacion:** Estos tests confirman que el sistema de roles extensibles no rompe las capacidades existentes del Owner.
37
+ - Owner deberia ver todos los botones CRUD
38
+ - Owner deberia poder realizar todas las operaciones
39
+ - Owner deberia acceder a todas las rutas sin restricciones
40
+
41
+ </td>
42
+ </tr>
43
+ </table>
44
+
45
+ ### Background
46
+
47
+ <table>
48
+ <tr>
49
+ <th width="50%">English</th>
50
+ <th width="50%">Español</th>
51
+ </tr>
52
+ <tr>
53
+ <td>
54
+
55
+ ```gherkin
56
+ Given I am logged in as Owner (carlos.mendoza@nextspark.dev)
57
+ And the API intercepts are set up
58
+ And the application is running on Everpoint Labs team
59
+ ```
60
+
61
+ </td>
62
+ <td>
63
+
64
+ ```gherkin
65
+ Given estoy logueado como Owner (carlos.mendoza@nextspark.dev)
66
+ And los intercepts de API estan configurados
67
+ And la aplicacion esta corriendo en el equipo Everpoint Labs
68
+ ```
69
+
70
+ </td>
71
+ </tr>
72
+ </table>
73
+
74
+ ---
75
+
76
+ ## UI Access - All Buttons Visible `@smoke`
77
+
78
+ ### OWNER_CRUD_001: Owner sees Add button on customers list `@smoke`
79
+
80
+ <table>
81
+ <tr>
82
+ <th width="50%">English</th>
83
+ <th width="50%">Español</th>
84
+ </tr>
85
+ <tr>
86
+ <td>
87
+
88
+ ```gherkin
89
+ Scenario: Add button is visible for Owner role
90
+
91
+ Given I am logged in as an Owner
92
+ When I navigate to the Customers list page
93
+ And the customer list loads successfully
94
+ Then the "Add" button should be visible
95
+ ```
96
+
97
+ </td>
98
+ <td>
99
+
100
+ ```gherkin
101
+ Scenario: Boton Agregar esta visible para rol Owner
102
+
103
+ Given estoy logueado como Owner
104
+ When navego a la pagina de lista de Clientes
105
+ And la lista de clientes carga exitosamente
106
+ Then el boton "Agregar" deberia estar visible
107
+ ```
108
+
109
+ </td>
110
+ </tr>
111
+ </table>
112
+
113
+ ---
114
+
115
+ ### OWNER_CRUD_002: Owner sees row actions menu on customer rows `@smoke`
116
+
117
+ <table>
118
+ <tr>
119
+ <th width="50%">English</th>
120
+ <th width="50%">Español</th>
121
+ </tr>
122
+ <tr>
123
+ <td>
124
+
125
+ ```gherkin
126
+ Scenario: Row actions menu is visible for Owner
127
+
128
+ Given I am logged in as an Owner
129
+ When I navigate to the Customers list page
130
+ And the customer list loads successfully
131
+ And there are customers in the list
132
+ Then the row actions menu trigger should be visible on each row
133
+ ```
134
+
135
+ **Note:** Owner has edit/delete permissions, so the menu is rendered.
136
+
137
+ </td>
138
+ <td>
139
+
140
+ ```gherkin
141
+ Scenario: Menu de acciones de fila esta visible para Owner
142
+
143
+ Given estoy logueado como Owner
144
+ When navego a la pagina de lista de Clientes
145
+ And la lista de clientes carga exitosamente
146
+ And hay clientes en la lista
147
+ Then el trigger del menu de acciones deberia estar visible en cada fila
148
+ ```
149
+
150
+ **Nota:** Owner tiene permisos de editar/eliminar, por lo que se renderiza el menu.
151
+
152
+ </td>
153
+ </tr>
154
+ </table>
155
+
156
+ ---
157
+
158
+ ### OWNER_CRUD_003: Owner sees Edit and Delete options in row menu
159
+
160
+ <table>
161
+ <tr>
162
+ <th width="50%">English</th>
163
+ <th width="50%">Español</th>
164
+ </tr>
165
+ <tr>
166
+ <td>
167
+
168
+ ```gherkin
169
+ Scenario: Row menu shows Edit and Delete for Owner
170
+
171
+ Given I am logged in as an Owner
172
+ When I navigate to the Customers list page
173
+ And the customer list loads successfully
174
+ And I click on a row's actions menu
175
+ Then the "Edit" option should be visible
176
+ And the "Delete" option should be visible
177
+ ```
178
+
179
+ </td>
180
+ <td>
181
+
182
+ ```gherkin
183
+ Scenario: Menu de fila muestra Editar y Eliminar para Owner
184
+
185
+ Given estoy logueado como Owner
186
+ When navego a la pagina de lista de Clientes
187
+ And la lista de clientes carga exitosamente
188
+ And hago clic en el menu de acciones de una fila
189
+ Then la opcion "Editar" deberia estar visible
190
+ And la opcion "Eliminar" deberia estar visible
191
+ ```
192
+
193
+ </td>
194
+ </tr>
195
+ </table>
196
+
197
+ ---
198
+
199
+ ## CRUD Operations - Full Access
200
+
201
+ ### OWNER_CRUD_004: Owner can access customer create form
202
+
203
+ <table>
204
+ <tr>
205
+ <th width="50%">English</th>
206
+ <th width="50%">Español</th>
207
+ </tr>
208
+ <tr>
209
+ <td>
210
+
211
+ ```gherkin
212
+ Scenario: Owner can navigate to create form
213
+
214
+ Given I am logged in as an Owner
215
+ When I navigate to the Customers list page
216
+ And I click the "Add" button
217
+ Then I should be navigated to the create form
218
+ And the form should be visible and functional
219
+ ```
220
+
221
+ </td>
222
+ <td>
223
+
224
+ ```gherkin
225
+ Scenario: Owner puede navegar al formulario de crear
226
+
227
+ Given estoy logueado como Owner
228
+ When navego a la pagina de lista de Clientes
229
+ And hago clic en el boton "Agregar"
230
+ Then deberia navegar al formulario de creacion
231
+ And el formulario deberia estar visible y funcional
232
+ ```
233
+
234
+ </td>
235
+ </tr>
236
+ </table>
237
+
238
+ ---
239
+
240
+ ### OWNER_CRUD_005: Owner can access create form and see submit button
241
+
242
+ <table>
243
+ <tr>
244
+ <th width="50%">English</th>
245
+ <th width="50%">Español</th>
246
+ </tr>
247
+ <tr>
248
+ <td>
249
+
250
+ ```gherkin
251
+ Scenario: Owner can see all form elements on create page
252
+
253
+ Given I am logged in as an Owner
254
+ When I navigate to the create customer form
255
+ Then I should see the form fields (name, account)
256
+ And I should see the submit button
257
+ ```
258
+
259
+ **Verification:** Confirms Owner has full UI access to create functionality.
260
+
261
+ </td>
262
+ <td>
263
+
264
+ ```gherkin
265
+ Scenario: Owner puede ver todos los elementos del formulario en crear
266
+
267
+ Given estoy logueado como Owner
268
+ When navego al formulario de crear cliente
269
+ Then deberia ver los campos del formulario (name, account)
270
+ And deberia ver el boton de enviar
271
+ ```
272
+
273
+ **Verificacion:** Confirma que Owner tiene acceso UI completo a la funcionalidad de crear.
274
+
275
+ </td>
276
+ </tr>
277
+ </table>
278
+
279
+ ---
280
+
281
+ ### OWNER_CRUD_006: Owner can access customer edit form
282
+
283
+ <table>
284
+ <tr>
285
+ <th width="50%">English</th>
286
+ <th width="50%">Español</th>
287
+ </tr>
288
+ <tr>
289
+ <td>
290
+
291
+ ```gherkin
292
+ Scenario: Owner can navigate to edit form
293
+
294
+ Given I am logged in as an Owner
295
+ When I navigate to the Customers list page
296
+ And there is at least one customer in the list
297
+ And I click the Edit button on a customer row
298
+ Then I should be navigated to the edit form
299
+ And the form should be pre-filled with customer data
300
+ ```
301
+
302
+ </td>
303
+ <td>
304
+
305
+ ```gherkin
306
+ Scenario: Owner puede navegar al formulario de editar
307
+
308
+ Given estoy logueado como Owner
309
+ When navego a la pagina de lista de Clientes
310
+ And existe al menos un cliente en la lista
311
+ And hago clic en el boton Editar de una fila de cliente
312
+ Then deberia navegar al formulario de edicion
313
+ And el formulario deberia estar pre-llenado con datos del cliente
314
+ ```
315
+
316
+ </td>
317
+ </tr>
318
+ </table>
319
+
320
+ ---
321
+
322
+ ### OWNER_CRUD_007: Owner can access edit form with submit capability
323
+
324
+ <table>
325
+ <tr>
326
+ <th width="50%">English</th>
327
+ <th width="50%">Español</th>
328
+ </tr>
329
+ <tr>
330
+ <td>
331
+
332
+ ```gherkin
333
+ Scenario: Owner can see all form elements on edit page
334
+
335
+ Given I am logged in as an Owner
336
+ And there is at least one customer in the list
337
+ When I click Edit in the row menu
338
+ And the edit form loads
339
+ Then I should see the form fields
340
+ And I should see the submit button
341
+ ```
342
+
343
+ **Verification:** Confirms Owner has full UI access to edit functionality.
344
+
345
+ </td>
346
+ <td>
347
+
348
+ ```gherkin
349
+ Scenario: Owner puede ver todos los elementos del formulario en editar
350
+
351
+ Given estoy logueado como Owner
352
+ And existe al menos un cliente en la lista
353
+ When hago clic en Editar en el menu de fila
354
+ And el formulario de edicion carga
355
+ Then deberia ver los campos del formulario
356
+ And deberia ver el boton de enviar
357
+ ```
358
+
359
+ **Verificacion:** Confirma que Owner tiene acceso UI completo a la funcionalidad de editar.
360
+
361
+ </td>
362
+ </tr>
363
+ </table>
364
+
365
+ ---
366
+
367
+ ### OWNER_CRUD_008: Owner can see Delete option in row menu
368
+
369
+ <table>
370
+ <tr>
371
+ <th width="50%">English</th>
372
+ <th width="50%">Español</th>
373
+ </tr>
374
+ <tr>
375
+ <td>
376
+
377
+ ```gherkin
378
+ Scenario: Owner can see Delete option in row menu
379
+
380
+ Given I am logged in as an Owner
381
+ When I navigate to the Customers list page
382
+ And there is at least one customer in the list
383
+ And I click on a row's actions menu
384
+ Then the "Delete" option should be visible
385
+ ```
386
+
387
+ **Verification:** Confirms Owner has delete permission visibility.
388
+
389
+ </td>
390
+ <td>
391
+
392
+ ```gherkin
393
+ Scenario: Owner puede ver opcion Eliminar en menu de fila
394
+
395
+ Given estoy logueado como Owner
396
+ When navego a la pagina de lista de Clientes
397
+ And existe al menos un cliente en la lista
398
+ And hago clic en el menu de acciones de una fila
399
+ Then la opcion "Eliminar" deberia estar visible
400
+ ```
401
+
402
+ **Verificacion:** Confirma que Owner tiene visibilidad del permiso de eliminar.
403
+
404
+ </td>
405
+ </tr>
406
+ </table>
407
+
408
+ ---
409
+
410
+ ## Direct URL Access - Full Access
411
+
412
+ ### OWNER_CRUD_009: Owner can access /customers/create via URL
413
+
414
+ <table>
415
+ <tr>
416
+ <th width="50%">English</th>
417
+ <th width="50%">Español</th>
418
+ </tr>
419
+ <tr>
420
+ <td>
421
+
422
+ ```gherkin
423
+ Scenario: Owner can access create route directly
424
+
425
+ Given I am logged in as an Owner
426
+ When I navigate directly to /dashboard/customers/create
427
+ Then I should NOT see a "Permission Denied" component
428
+ And the create form should be visible
429
+ ```
430
+
431
+ </td>
432
+ <td>
433
+
434
+ ```gherkin
435
+ Scenario: Owner puede acceder a ruta crear directamente
436
+
437
+ Given estoy logueado como Owner
438
+ When navego directamente a /dashboard/customers/create
439
+ Then NO deberia ver un componente de "Permiso Denegado"
440
+ And el formulario de creacion deberia estar visible
441
+ ```
442
+
443
+ </td>
444
+ </tr>
445
+ </table>
446
+
447
+ ---
448
+
449
+ ### OWNER_CRUD_010: Owner can access /customers/[id]/edit via URL
450
+
451
+ <table>
452
+ <tr>
453
+ <th width="50%">English</th>
454
+ <th width="50%">Español</th>
455
+ </tr>
456
+ <tr>
457
+ <td>
458
+
459
+ ```gherkin
460
+ Scenario: Owner can access edit route directly
461
+
462
+ Given I am logged in as an Owner
463
+ And there is at least one customer in the list
464
+ When I extract a customer ID from the list
465
+ And I navigate directly to /dashboard/customers/{id}/edit
466
+ Then I should NOT see a "Permission Denied" component
467
+ And the edit form should be visible with customer data
468
+ ```
469
+
470
+ </td>
471
+ <td>
472
+
473
+ ```gherkin
474
+ Scenario: Owner puede acceder a ruta editar directamente
475
+
476
+ Given estoy logueado como Owner
477
+ And existe al menos un cliente en la lista
478
+ When extraigo un ID de cliente de la lista
479
+ And navego directamente a /dashboard/customers/{id}/edit
480
+ Then NO deberia ver un componente de "Permiso Denegado"
481
+ And el formulario de edicion deberia estar visible con datos del cliente
482
+ ```
483
+
484
+ </td>
485
+ </tr>
486
+ </table>
487
+
488
+ ---
489
+
490
+ ## Permission Matrix / Matriz de Permisos
491
+
492
+ | Entity / Entidad | Operation / Operación | Owner | Admin | Member | Editor | Viewer |
493
+ |------------------|----------------------|:-----:|:-----:|:------:|:------:|:------:|
494
+ | **Customers** | CREATE | **Yes** | Yes | No | No | No |
495
+ | **Customers** | READ | **Yes** | Yes | Yes | Yes | Yes |
496
+ | **Customers** | LIST | **Yes** | Yes | Yes | Yes | Yes |
497
+ | **Customers** | UPDATE | **Yes** | Yes | No | No | No |
498
+ | **Customers** | DELETE | **Yes** | Yes | No | No | No |
499
+
500
+ ---
501
+
502
+ ## UI Elements / Elementos UI
503
+
504
+ ### Permission Components
505
+
506
+ | Element | Selector | Description / Descripción |
507
+ |---------|----------|---------------------------|
508
+ | Add Button | `[data-cy="customers-add"]` | Create button (must exist for Owner) |
509
+ | Edit Button | `[data-cy^="customers-row-action-edit"]` | Edit button on rows |
510
+ | Delete Button | `[data-cy="row-action-delete"]` | Delete option in menu |
511
+ | View Button | `[data-cy="row-action-view"]` | View option in menu |
512
+ | Form | `[data-cy="customers-form"]` | Entity form |
513
+ | Permission Denied | `[data-cy="permission-denied"]` | Should NOT exist for Owner |
514
+
515
+ ---
516
+
517
+ ## Summary / Resumen
518
+
519
+ | Test ID | Block | Description / Descripción | Tags |
520
+ |---------|-------|---------------------------|------|
521
+ | OWNER_CRUD_001 | UI Access | Add button visible | `@smoke` |
522
+ | OWNER_CRUD_002 | UI Access | Row actions menu visible | `@smoke` |
523
+ | OWNER_CRUD_003 | UI Access | Edit/Delete in menu | |
524
+ | OWNER_CRUD_004 | CRUD Operations | Access create form | |
525
+ | OWNER_CRUD_005 | CRUD Operations | Create form with submit | |
526
+ | OWNER_CRUD_006 | CRUD Operations | Access edit form | |
527
+ | OWNER_CRUD_007 | CRUD Operations | Edit form with submit | |
528
+ | OWNER_CRUD_008 | CRUD Operations | Delete option visible | |
529
+ | OWNER_CRUD_009 | URL Access | Direct /create access | |
530
+ | OWNER_CRUD_010 | URL Access | Direct /edit access | |