@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.
- package/package.json +1 -1
- package/tests/cypress/e2e/_devtools/access.bdd.md +262 -0
- package/tests/cypress/e2e/_devtools/access.cy.ts +171 -0
- package/tests/cypress/e2e/_devtools/navigation.bdd.md +261 -0
- package/tests/cypress/e2e/_devtools/navigation.cy.ts +157 -0
- package/tests/cypress/e2e/_devtools/pages.bdd.md +303 -0
- package/tests/cypress/e2e/_devtools/pages.cy.ts +184 -0
- package/tests/cypress/e2e/_docs/README.md +215 -0
- package/tests/cypress/e2e/_docs/tutorials/sector7-superadmin-teams.narration.json +155 -0
- package/tests/cypress/e2e/_docs/tutorials/sector7-superadmin.cy.ts +390 -0
- package/tests/cypress/e2e/_docs/tutorials/teams-system.doc.cy.ts +349 -0
- package/tests/cypress/e2e/_docs/tutorials/teams-system.narration.json +165 -0
- package/tests/cypress/e2e/_selectors/auth.cy.ts +306 -0
- package/tests/cypress/e2e/_selectors/billing.cy.ts +89 -0
- package/tests/cypress/e2e/_selectors/dashboard-mobile.cy.ts +113 -0
- package/tests/cypress/e2e/_selectors/dashboard-navigation.cy.ts +89 -0
- package/tests/cypress/e2e/_selectors/dashboard-sidebar.cy.ts +60 -0
- package/tests/cypress/e2e/_selectors/dashboard-topnav.cy.ts +146 -0
- package/tests/cypress/e2e/_selectors/devtools.cy.ts +210 -0
- package/tests/cypress/e2e/_selectors/global-search.cy.ts +88 -0
- package/tests/cypress/e2e/_selectors/pages-editor.cy.ts +179 -0
- package/tests/cypress/e2e/_selectors/posts-editor.cy.ts +282 -0
- package/tests/cypress/e2e/_selectors/public.cy.ts +112 -0
- package/tests/cypress/e2e/_selectors/settings-api-keys.cy.ts +228 -0
- package/tests/cypress/e2e/_selectors/settings-billing.cy.ts +105 -0
- package/tests/cypress/e2e/_selectors/settings-layout.cy.ts +119 -0
- package/tests/cypress/e2e/_selectors/settings-password.cy.ts +71 -0
- package/tests/cypress/e2e/_selectors/settings-profile.cy.ts +82 -0
- package/tests/cypress/e2e/_selectors/settings-teams.cy.ts +68 -0
- package/tests/cypress/e2e/_selectors/superadmin.cy.ts +185 -0
- package/tests/cypress/e2e/_selectors/tasks.cy.ts +242 -0
- package/tests/cypress/e2e/_selectors/taxonomies.cy.ts +126 -0
- package/tests/cypress/e2e/_selectors/teams.cy.ts +142 -0
- package/tests/cypress/e2e/_superadmin/all-teams.bdd.md +261 -0
- package/tests/cypress/e2e/_superadmin/all-teams.cy.ts +177 -0
- package/tests/cypress/e2e/_superadmin/all-users.bdd.md +406 -0
- package/tests/cypress/e2e/_superadmin/all-users.cy.ts +294 -0
- package/tests/cypress/e2e/_superadmin/dashboard.bdd.md +235 -0
- package/tests/cypress/e2e/_superadmin/dashboard.cy.ts +149 -0
- package/tests/cypress/e2e/_superadmin/subscriptions-overview.bdd.md +290 -0
- package/tests/cypress/e2e/_superadmin/subscriptions-overview.cy.ts +194 -0
- package/tests/cypress/e2e/ai/ai-usage.cy.ts +209 -0
- package/tests/cypress/e2e/ai/chat-api.cy.ts +107 -0
- package/tests/cypress/e2e/ai/guardrails.cy.ts +332 -0
- package/tests/cypress/e2e/api/billing/BillingAPIController.js +319 -0
- package/tests/cypress/e2e/api/billing/check-action.cy.ts +326 -0
- package/tests/cypress/e2e/api/billing/checkout.cy.ts +358 -0
- package/tests/cypress/e2e/api/billing/lifecycle.cy.ts +423 -0
- package/tests/cypress/e2e/api/billing/plans/README.md +345 -0
- package/tests/cypress/e2e/api/billing/plans/business.cy.ts +412 -0
- package/tests/cypress/e2e/api/billing/plans/downgrade.cy.ts +510 -0
- package/tests/cypress/e2e/api/billing/plans/fixtures/billing-plans.json +163 -0
- package/tests/cypress/e2e/api/billing/plans/free.cy.ts +500 -0
- package/tests/cypress/e2e/api/billing/plans/pro.cy.ts +497 -0
- package/tests/cypress/e2e/api/billing/plans/starter.cy.ts +342 -0
- package/tests/cypress/e2e/api/billing/portal.cy.ts +313 -0
- package/tests/cypress/e2e/api/devtools/registries.bdd.md +300 -0
- package/tests/cypress/e2e/api/devtools/registries.cy.ts +368 -0
- package/tests/cypress/e2e/api/entities/blocks-scope.cy.ts +396 -0
- package/tests/cypress/e2e/api/entities/customers-crud.cy.ts +648 -0
- package/tests/cypress/e2e/api/entities/customers-metas.cy.ts +839 -0
- package/tests/cypress/e2e/api/entities/pages-crud.cy.ts +425 -0
- package/tests/cypress/e2e/api/entities/pages-status.cy.ts +335 -0
- package/tests/cypress/e2e/api/entities/post-categories-crud.cy.ts +610 -0
- package/tests/cypress/e2e/api/entities/posts-crud.cy.ts +709 -0
- package/tests/cypress/e2e/api/entities/posts-status.cy.ts +396 -0
- package/tests/cypress/e2e/api/entities/tasks-crud.cy.ts +602 -0
- package/tests/cypress/e2e/api/entities/tasks-metas.cy.ts +878 -0
- package/tests/cypress/e2e/api/entities/users-crud.cy.ts +469 -0
- package/tests/cypress/e2e/api/entities/users-metas.cy.ts +913 -0
- package/tests/cypress/e2e/api/entities/users-security.cy.ts +375 -0
- package/tests/cypress/e2e/api/scheduled-actions/cron-endpoint.bdd.md +375 -0
- package/tests/cypress/e2e/api/scheduled-actions/cron-endpoint.cy.ts +346 -0
- package/tests/cypress/e2e/api/scheduled-actions/devtools-endpoint.bdd.md +451 -0
- package/tests/cypress/e2e/api/scheduled-actions/devtools-endpoint.cy.ts +447 -0
- package/tests/cypress/e2e/api/scheduled-actions/scheduling.bdd.md +649 -0
- package/tests/cypress/e2e/api/scheduled-actions/scheduling.cy.ts +333 -0
- package/tests/cypress/e2e/api/settings/api-keys.crud.cy.ts +923 -0
- package/tests/cypress/e2e/uat/auth/app-roles/developer-login.bdd.md +231 -0
- package/tests/cypress/e2e/uat/auth/app-roles/developer-login.cy.ts +144 -0
- package/tests/cypress/e2e/uat/auth/app-roles/superadmin-login.bdd.md +118 -0
- package/tests/cypress/e2e/uat/auth/app-roles/superadmin-login.cy.ts +84 -0
- package/tests/cypress/e2e/uat/auth/custom-roles/editor-login.bdd.md +288 -0
- package/tests/cypress/e2e/uat/auth/custom-roles/editor-login.cy.ts +188 -0
- package/tests/cypress/e2e/uat/auth/login-logout.bdd.md +160 -0
- package/tests/cypress/e2e/uat/auth/login-logout.cy.ts +116 -0
- package/tests/cypress/e2e/uat/auth/password-reset.bdd.md +289 -0
- package/tests/cypress/e2e/uat/auth/password-reset.cy.ts +200 -0
- package/tests/cypress/e2e/uat/auth/team-roles/admin-login.bdd.md +225 -0
- package/tests/cypress/e2e/uat/auth/team-roles/admin-login.cy.ts +148 -0
- package/tests/cypress/e2e/uat/auth/team-roles/member-login.bdd.md +251 -0
- package/tests/cypress/e2e/uat/auth/team-roles/member-login.cy.ts +163 -0
- package/tests/cypress/e2e/uat/auth/team-roles/owner-login.bdd.md +231 -0
- package/tests/cypress/e2e/uat/auth/team-roles/owner-login.cy.ts +141 -0
- package/tests/cypress/e2e/uat/billing/extended.bdd.md +273 -0
- package/tests/cypress/e2e/uat/billing/extended.cy.ts +209 -0
- package/tests/cypress/e2e/uat/billing/feature-gates.bdd.md +407 -0
- package/tests/cypress/e2e/uat/billing/feature-gates.cy.ts +307 -0
- package/tests/cypress/e2e/uat/billing/page.bdd.md +329 -0
- package/tests/cypress/e2e/uat/billing/page.cy.ts +250 -0
- package/tests/cypress/e2e/uat/billing/status.bdd.md +190 -0
- package/tests/cypress/e2e/uat/billing/status.cy.ts +145 -0
- package/tests/cypress/e2e/uat/billing/team-switch.bdd.md +156 -0
- package/tests/cypress/e2e/uat/billing/team-switch.cy.ts +122 -0
- package/tests/cypress/e2e/uat/billing/usage.bdd.md +218 -0
- package/tests/cypress/e2e/uat/billing/usage.cy.ts +176 -0
- package/tests/cypress/e2e/uat/blocks/hero.bdd.md +124 -0
- package/tests/cypress/e2e/uat/blocks/hero.cy.ts +56 -0
- package/tests/cypress/e2e/uat/devtools/api-tester.cy.ts +390 -0
- package/tests/cypress/e2e/uat/entities/customers/member.bdd.md +275 -0
- package/tests/cypress/e2e/uat/entities/customers/member.cy.ts +122 -0
- package/tests/cypress/e2e/uat/entities/customers/owner.bdd.md +243 -0
- package/tests/cypress/e2e/uat/entities/customers/owner.cy.ts +165 -0
- package/tests/cypress/e2e/uat/entities/pages/block-crud.bdd.md +476 -0
- package/tests/cypress/e2e/uat/entities/pages/block-crud.cy.ts +486 -0
- package/tests/cypress/e2e/uat/entities/pages/block-editor.bdd.md +460 -0
- package/tests/cypress/e2e/uat/entities/pages/block-editor.cy.ts +301 -0
- package/tests/cypress/e2e/uat/entities/pages/list.bdd.md +432 -0
- package/tests/cypress/e2e/uat/entities/pages/list.cy.ts +273 -0
- package/tests/cypress/e2e/uat/entities/pages/public-rendering.bdd.md +696 -0
- package/tests/cypress/e2e/uat/entities/pages/public-rendering.cy.ts +340 -0
- package/tests/cypress/e2e/uat/entities/posts/categories-api-aware.bdd.md +161 -0
- package/tests/cypress/e2e/uat/entities/posts/categories-api-aware.cy.ts +104 -0
- package/tests/cypress/e2e/uat/entities/posts/categories.bdd.md +375 -0
- package/tests/cypress/e2e/uat/entities/posts/categories.cy.ts +241 -0
- package/tests/cypress/e2e/uat/entities/posts/editor.bdd.md +429 -0
- package/tests/cypress/e2e/uat/entities/posts/editor.cy.ts +257 -0
- package/tests/cypress/e2e/uat/entities/posts/list.bdd.md +340 -0
- package/tests/cypress/e2e/uat/entities/posts/list.cy.ts +177 -0
- package/tests/cypress/e2e/uat/entities/posts/public.bdd.md +614 -0
- package/tests/cypress/e2e/uat/entities/posts/public.cy.ts +249 -0
- package/tests/cypress/e2e/uat/entities/tasks/member.bdd.md +222 -0
- package/tests/cypress/e2e/uat/entities/tasks/member.cy.ts +165 -0
- package/tests/cypress/e2e/uat/entities/tasks/owner.bdd.md +419 -0
- package/tests/cypress/e2e/uat/entities/tasks/owner.cy.ts +191 -0
- package/tests/cypress/e2e/uat/roles/editor-role.bdd.md +552 -0
- package/tests/cypress/e2e/uat/roles/editor-role.cy.ts +210 -0
- package/tests/cypress/e2e/uat/roles/member-restrictions.bdd.md +450 -0
- package/tests/cypress/e2e/uat/roles/member-restrictions.cy.ts +189 -0
- package/tests/cypress/e2e/uat/roles/owner-full-crud.bdd.md +530 -0
- package/tests/cypress/e2e/uat/roles/owner-full-crud.cy.ts +247 -0
- package/tests/cypress/e2e/uat/scheduled-actions/devtools-ui.bdd.md +736 -0
- package/tests/cypress/e2e/uat/scheduled-actions/devtools-ui.cy.ts +740 -0
- package/tests/cypress/e2e/uat/teams/roles-matrix.bdd.md +553 -0
- package/tests/cypress/e2e/uat/teams/roles-matrix.cy.ts +185 -0
- package/tests/cypress/e2e/uat/teams/switcher.bdd.md +1151 -0
- package/tests/cypress/e2e/uat/teams/switcher.cy.ts +497 -0
- package/tests/cypress/e2e/uat/teams/team-switcher.md +198 -0
- package/tests/cypress/fixtures/blocks.json +218 -0
- package/tests/cypress/fixtures/entities.json +78 -0
- package/tests/cypress/fixtures/page-builder.json +21 -0
- package/tests/cypress/src/components/CategoriesPOM.ts +382 -0
- package/tests/cypress/src/components/CustomersPOM.ts +439 -0
- package/tests/cypress/src/components/DevKeyringPOM.ts +160 -0
- package/tests/cypress/src/components/EntityForm.ts +375 -0
- package/tests/cypress/src/components/EntityList.ts +389 -0
- package/tests/cypress/src/components/PageBuilderPOM.ts +710 -0
- package/tests/cypress/src/components/PostEditorPOM.ts +370 -0
- package/tests/cypress/src/components/PostsListPOM.ts +223 -0
- package/tests/cypress/src/components/PublicPagePOM.ts +447 -0
- package/tests/cypress/src/components/PublicPostPOM.ts +146 -0
- package/tests/cypress/src/components/TasksPOM.ts +272 -0
- package/tests/cypress/src/components/TeamSwitcherPOM.ts +450 -0
- package/tests/cypress/src/components/index.ts +21 -0
- package/tests/cypress/src/controllers/ApiKeysAPIController.js +178 -0
- package/tests/cypress/src/controllers/BaseAPIController.js +317 -0
- package/tests/cypress/src/controllers/CustomerAPIController.js +251 -0
- package/tests/cypress/src/controllers/PagesAPIController.js +226 -0
- package/tests/cypress/src/controllers/PostsAPIController.js +250 -0
- package/tests/cypress/src/controllers/TaskAPIController.js +240 -0
- package/tests/cypress/src/controllers/UsersAPIController.js +242 -0
- package/tests/cypress/src/controllers/index.js +25 -0
- package/tests/cypress/src/core/AuthPOM.ts +450 -0
- package/tests/cypress/src/core/BasePOM.ts +86 -0
- package/tests/cypress/src/core/BlockEditorBasePOM.ts +576 -0
- package/tests/cypress/src/core/DashboardEntityPOM.ts +692 -0
- package/tests/cypress/src/core/index.ts +14 -0
- package/tests/cypress/src/entities/CustomersPOM.ts +172 -0
- package/tests/cypress/src/entities/PagesPOM.ts +137 -0
- package/tests/cypress/src/entities/PostsPOM.ts +137 -0
- package/tests/cypress/src/entities/TasksPOM.ts +176 -0
- package/tests/cypress/src/entities/index.ts +14 -0
- package/tests/cypress/src/features/BillingPOM.ts +385 -0
- package/tests/cypress/src/features/DashboardPOM.ts +245 -0
- package/tests/cypress/src/features/DevtoolsPOM.ts +739 -0
- package/tests/cypress/src/features/PageBuilderPOM.ts +263 -0
- package/tests/cypress/src/features/PostEditorPOM.ts +313 -0
- package/tests/cypress/src/features/ScheduledActionsPOM.ts +463 -0
- package/tests/cypress/src/features/SettingsPOM.ts +362 -0
- package/tests/cypress/src/features/SuperadminPOM.ts +331 -0
- package/tests/cypress/src/features/SuperadminTeamRolesPOM.ts +285 -0
- package/tests/cypress/src/features/index.ts +28 -0
- package/tests/cypress/src/helpers/ApiInterceptor.ts +177 -0
- package/tests/cypress/src/index.ts +101 -0
- package/tests/cypress/src/pages/dashboard/Dashboard.js +677 -0
- package/tests/cypress/src/pages/dashboard/DashboardPage.js +43 -0
- package/tests/cypress/src/pages/dashboard/DashboardStats.js +546 -0
- package/tests/cypress/src/pages/dashboard/index.js +6 -0
- package/tests/cypress/src/pages/index.js +5 -0
- package/tests/cypress/src/pages/public/FeaturesPage.js +28 -0
- package/tests/cypress/src/pages/public/LandingPage.js +69 -0
- package/tests/cypress/src/pages/public/PricingPage.js +33 -0
- package/tests/cypress/src/pages/public/index.js +6 -0
- package/tests/cypress/src/selectors.ts +46 -0
- package/tests/cypress/src/session-helpers.ts +500 -0
- package/tests/cypress/support/doc-commands.ts +260 -0
- package/tests/cypress.config.ts +150 -0
- package/tests/jest/components/post-header.test.tsx +377 -0
- package/tests/jest/config/role-config.test.ts +529 -0
- package/tests/jest/jest.config.ts +81 -0
- package/tests/jest/langchain/COVERAGE.md +372 -0
- package/tests/jest/langchain/guardrails.test.ts +465 -0
- package/tests/jest/langchain/streaming.test.ts +367 -0
- package/tests/jest/langchain/token-tracker.test.ts +455 -0
- package/tests/jest/langchain/tracer-callbacks.test.ts +881 -0
- package/tests/jest/langchain/tracer.test.ts +823 -0
- package/tests/jest/user-roles/role-helpers.test.ts +432 -0
- package/tests/jest/validation/categories.test.ts +429 -0
- package/tests/jest/validation/posts.test.ts +546 -0
- package/tests/tsconfig.json +15 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/// <reference types="cypress" />
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Billing API - Pro Plan Tests
|
|
6
|
+
*
|
|
7
|
+
* BDD: Feature: Pro Plan Features
|
|
8
|
+
* As a user with a Pro plan
|
|
9
|
+
* I want to access professional features
|
|
10
|
+
* So that I can scale my growing business
|
|
11
|
+
*
|
|
12
|
+
* Tests for:
|
|
13
|
+
* - Realtime analytics access
|
|
14
|
+
* - Webhooks access
|
|
15
|
+
* - Custom branding access
|
|
16
|
+
* - Task automation access
|
|
17
|
+
* - Priority support access
|
|
18
|
+
* - Limits (15 members, 1000 tasks, 500 customers, 10 webhooks)
|
|
19
|
+
* - SSO blocked (requires Business)
|
|
20
|
+
* - Customer import blocked (requires Business)
|
|
21
|
+
*
|
|
22
|
+
* Session: 2025-12-20-subscriptions-system-v2
|
|
23
|
+
* Phase: 9 (api-tester)
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import * as allure from 'allure-cypress'
|
|
27
|
+
|
|
28
|
+
const BillingAPIController = require('../BillingAPIController.js')
|
|
29
|
+
import billingPlans from './fixtures/billing-plans.json'
|
|
30
|
+
|
|
31
|
+
describe('Billing API - Pro Plan Features', () => {
|
|
32
|
+
let billingAPI: any
|
|
33
|
+
|
|
34
|
+
// Test data from fixtures
|
|
35
|
+
const PRO_PLAN = billingPlans.plans.pro
|
|
36
|
+
const TEST_TEAM = billingPlans.testTeams.pro
|
|
37
|
+
const SUPERADMIN = billingPlans.testCredentials.superadmin
|
|
38
|
+
const BASE_URL = Cypress.config('baseUrl') || 'http://localhost:5173'
|
|
39
|
+
|
|
40
|
+
before(() => {
|
|
41
|
+
billingAPI = new BillingAPIController(BASE_URL, SUPERADMIN.apiKey, TEST_TEAM.teamId)
|
|
42
|
+
cy.log('BillingAPIController initialized for Pro Plan tests')
|
|
43
|
+
cy.log(`Team: ${TEST_TEAM.description}`)
|
|
44
|
+
cy.log(`Team ID: ${TEST_TEAM.teamId}`)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
beforeEach(() => {
|
|
48
|
+
allure.epic('Billing')
|
|
49
|
+
allure.feature('Pro Plan')
|
|
50
|
+
allure.owner('qa-automation')
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
// ============================================================
|
|
54
|
+
// TEST GROUP 1: Subscription Verification
|
|
55
|
+
// ============================================================
|
|
56
|
+
describe('Subscription Verification', () => {
|
|
57
|
+
it('PRO_001: Should have Pro plan subscription active', () => {
|
|
58
|
+
allure.story('Subscription Status')
|
|
59
|
+
allure.severity('critical')
|
|
60
|
+
allure.description(`
|
|
61
|
+
Scenario: Pro plan subscription is active
|
|
62
|
+
Given I am authenticated as a user with Pro plan
|
|
63
|
+
Then my team should have the Pro subscription active
|
|
64
|
+
And the plan slug should be "pro"
|
|
65
|
+
`)
|
|
66
|
+
|
|
67
|
+
billingAPI.getSubscription(TEST_TEAM.teamId).then((response: any) => {
|
|
68
|
+
billingAPI.validateSubscriptionResponse(response, {
|
|
69
|
+
status: 'active',
|
|
70
|
+
planSlug: 'pro'
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
cy.log('Pro plan subscription verified')
|
|
74
|
+
cy.log(`Plan: ${response.body.data.subscription.plan.name}`)
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
it('PRO_002: Pro plan should include all expected features', () => {
|
|
79
|
+
allure.story('Feature List')
|
|
80
|
+
allure.severity('normal')
|
|
81
|
+
allure.description(`
|
|
82
|
+
Scenario: Pro plan has all expected features
|
|
83
|
+
When I check my subscription details
|
|
84
|
+
Then the plan should include realtime_analytics, webhooks, custom_branding, task_automation
|
|
85
|
+
`)
|
|
86
|
+
|
|
87
|
+
billingAPI.getSubscription(TEST_TEAM.teamId).then((response: any) => {
|
|
88
|
+
const features = response.body.data.subscription.plan.features
|
|
89
|
+
|
|
90
|
+
PRO_PLAN.features.forEach((feature: string) => {
|
|
91
|
+
expect(features).to.include(feature)
|
|
92
|
+
cy.log(`Feature included: ${feature}`)
|
|
93
|
+
})
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
// ============================================================
|
|
99
|
+
// TEST GROUP 2: Allowed Features
|
|
100
|
+
// ============================================================
|
|
101
|
+
describe('Allowed Features', () => {
|
|
102
|
+
it('PRO_010: Should allow advanced_analytics feature', () => {
|
|
103
|
+
allure.story('Analytics Features')
|
|
104
|
+
allure.severity('critical')
|
|
105
|
+
allure.description(`
|
|
106
|
+
Scenario: Pro plan includes advanced analytics
|
|
107
|
+
When I check action "analytics.view_advanced"
|
|
108
|
+
Then the action should be allowed
|
|
109
|
+
`)
|
|
110
|
+
|
|
111
|
+
billingAPI.checkAction('analytics.view_advanced').then((response: any) => {
|
|
112
|
+
billingAPI.validateActionAllowed(response)
|
|
113
|
+
|
|
114
|
+
cy.log('advanced_analytics allowed for Pro plan')
|
|
115
|
+
})
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
it('PRO_011: Should allow realtime_analytics feature', () => {
|
|
119
|
+
allure.story('Analytics Features')
|
|
120
|
+
allure.severity('critical')
|
|
121
|
+
allure.description(`
|
|
122
|
+
Scenario: Pro plan includes realtime analytics
|
|
123
|
+
When I check action "analytics.view_realtime"
|
|
124
|
+
Then the action should be allowed
|
|
125
|
+
`)
|
|
126
|
+
|
|
127
|
+
billingAPI.checkAction('analytics.view_realtime').then((response: any) => {
|
|
128
|
+
billingAPI.validateActionAllowed(response)
|
|
129
|
+
|
|
130
|
+
cy.log('realtime_analytics allowed for Pro plan')
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
it('PRO_012: Should allow webhooks creation', () => {
|
|
135
|
+
allure.story('API Features')
|
|
136
|
+
allure.severity('critical')
|
|
137
|
+
allure.description(`
|
|
138
|
+
Scenario: Pro plan includes webhooks
|
|
139
|
+
When I check action "webhooks.create"
|
|
140
|
+
Then the action should be allowed (if within quota)
|
|
141
|
+
`)
|
|
142
|
+
|
|
143
|
+
// First check quota
|
|
144
|
+
billingAPI.getUsage(TEST_TEAM.teamId, 'webhooks_count').then((usageResponse: any) => {
|
|
145
|
+
const current = usageResponse.body.data.current
|
|
146
|
+
const max = usageResponse.body.data.max
|
|
147
|
+
|
|
148
|
+
billingAPI.checkAction('webhooks.create').then((response: any) => {
|
|
149
|
+
if (current < max) {
|
|
150
|
+
billingAPI.validateActionAllowed(response)
|
|
151
|
+
cy.log('webhooks.create allowed for Pro plan')
|
|
152
|
+
} else {
|
|
153
|
+
// Quota exceeded, but feature is included
|
|
154
|
+
expect(response.body.data.reason).to.eq('quota_exceeded')
|
|
155
|
+
cy.log('webhooks.create blocked by quota, but feature is included')
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
})
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
it('PRO_013: Should allow custom_branding feature', () => {
|
|
162
|
+
allure.story('Customization Features')
|
|
163
|
+
allure.severity('normal')
|
|
164
|
+
allure.description(`
|
|
165
|
+
Scenario: Pro plan includes custom branding
|
|
166
|
+
When I check action "branding.customize"
|
|
167
|
+
Then the action should be allowed
|
|
168
|
+
`)
|
|
169
|
+
|
|
170
|
+
billingAPI.checkAction('branding.customize').then((response: any) => {
|
|
171
|
+
billingAPI.validateActionAllowed(response)
|
|
172
|
+
|
|
173
|
+
cy.log('custom_branding allowed for Pro plan')
|
|
174
|
+
})
|
|
175
|
+
})
|
|
176
|
+
|
|
177
|
+
it('PRO_014: Should allow task_automation feature', () => {
|
|
178
|
+
allure.story('Domain Features')
|
|
179
|
+
allure.severity('critical')
|
|
180
|
+
allure.description(`
|
|
181
|
+
Scenario: Pro plan includes task automation
|
|
182
|
+
When I check action "tasks.automate"
|
|
183
|
+
Then the action should be allowed
|
|
184
|
+
`)
|
|
185
|
+
|
|
186
|
+
billingAPI.checkAction('tasks.automate').then((response: any) => {
|
|
187
|
+
billingAPI.validateActionAllowed(response)
|
|
188
|
+
|
|
189
|
+
cy.log('task_automation allowed for Pro plan')
|
|
190
|
+
})
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
it('PRO_015: Should allow priority_support feature', () => {
|
|
194
|
+
allure.story('Support Features')
|
|
195
|
+
allure.severity('normal')
|
|
196
|
+
allure.description(`
|
|
197
|
+
Scenario: Pro plan includes priority support
|
|
198
|
+
When I check action "support.priority_access"
|
|
199
|
+
Then the action should be allowed
|
|
200
|
+
`)
|
|
201
|
+
|
|
202
|
+
billingAPI.checkAction('support.priority_access').then((response: any) => {
|
|
203
|
+
billingAPI.validateActionAllowed(response)
|
|
204
|
+
|
|
205
|
+
cy.log('priority_support allowed for Pro plan')
|
|
206
|
+
})
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
it('PRO_016: Should allow api_access feature', () => {
|
|
210
|
+
allure.story('API Features')
|
|
211
|
+
allure.severity('normal')
|
|
212
|
+
allure.description(`
|
|
213
|
+
Scenario: Pro plan includes API access
|
|
214
|
+
When I check action "api.generate_key"
|
|
215
|
+
Then the action should be allowed
|
|
216
|
+
`)
|
|
217
|
+
|
|
218
|
+
billingAPI.checkAction('api.generate_key').then((response: any) => {
|
|
219
|
+
billingAPI.validateActionAllowed(response)
|
|
220
|
+
|
|
221
|
+
cy.log('api_access allowed for Pro plan')
|
|
222
|
+
})
|
|
223
|
+
})
|
|
224
|
+
|
|
225
|
+
it('PRO_017: Should allow guest_access feature', () => {
|
|
226
|
+
allure.story('Collaboration Features')
|
|
227
|
+
allure.severity('normal')
|
|
228
|
+
allure.description(`
|
|
229
|
+
Scenario: Pro plan includes guest access
|
|
230
|
+
When I check action "team.invite_guest"
|
|
231
|
+
Then the action should be allowed
|
|
232
|
+
`)
|
|
233
|
+
|
|
234
|
+
billingAPI.checkAction('team.invite_guest').then((response: any) => {
|
|
235
|
+
billingAPI.validateActionAllowed(response)
|
|
236
|
+
|
|
237
|
+
cy.log('guest_access allowed for Pro plan')
|
|
238
|
+
})
|
|
239
|
+
})
|
|
240
|
+
})
|
|
241
|
+
|
|
242
|
+
// ============================================================
|
|
243
|
+
// TEST GROUP 3: Blocked Features (Business only)
|
|
244
|
+
// ============================================================
|
|
245
|
+
describe('Blocked Features (require Business)', () => {
|
|
246
|
+
it('PRO_020: Should block SSO configuration (Business feature)', () => {
|
|
247
|
+
allure.story('Feature Blocking')
|
|
248
|
+
allure.severity('critical')
|
|
249
|
+
allure.description(`
|
|
250
|
+
Scenario: Pro plan does NOT include SSO
|
|
251
|
+
When I check action "auth.configure_sso"
|
|
252
|
+
Then the action should be denied
|
|
253
|
+
And the reason should be "feature_not_in_plan"
|
|
254
|
+
`)
|
|
255
|
+
|
|
256
|
+
billingAPI.checkAction('auth.configure_sso').then((response: any) => {
|
|
257
|
+
billingAPI.validateActionDenied(response, 'feature_not_in_plan')
|
|
258
|
+
|
|
259
|
+
cy.log('SSO correctly blocked for Pro plan (requires Business)')
|
|
260
|
+
})
|
|
261
|
+
})
|
|
262
|
+
|
|
263
|
+
it('PRO_021: Should block customer_import (Business feature)', () => {
|
|
264
|
+
allure.story('Feature Blocking')
|
|
265
|
+
allure.severity('critical')
|
|
266
|
+
allure.description(`
|
|
267
|
+
Scenario: Pro plan does NOT include customer import
|
|
268
|
+
When I check action "customers.bulk_import"
|
|
269
|
+
Then the action should be denied
|
|
270
|
+
And the reason should be "feature_not_in_plan"
|
|
271
|
+
`)
|
|
272
|
+
|
|
273
|
+
billingAPI.checkAction('customers.bulk_import').then((response: any) => {
|
|
274
|
+
billingAPI.validateActionDenied(response, 'feature_not_in_plan')
|
|
275
|
+
|
|
276
|
+
cy.log('customer_import correctly blocked for Pro plan')
|
|
277
|
+
})
|
|
278
|
+
})
|
|
279
|
+
|
|
280
|
+
it('PRO_022: Should block recurring_tasks (Business feature)', () => {
|
|
281
|
+
allure.story('Feature Blocking')
|
|
282
|
+
allure.severity('normal')
|
|
283
|
+
allure.description(`
|
|
284
|
+
Scenario: Pro plan does NOT include recurring tasks
|
|
285
|
+
When I check action "tasks.create_recurring"
|
|
286
|
+
Then the action should be denied
|
|
287
|
+
And the reason should be "feature_not_in_plan"
|
|
288
|
+
`)
|
|
289
|
+
|
|
290
|
+
billingAPI.checkAction('tasks.create_recurring').then((response: any) => {
|
|
291
|
+
billingAPI.validateActionDenied(response, 'feature_not_in_plan')
|
|
292
|
+
|
|
293
|
+
cy.log('recurring_tasks correctly blocked for Pro plan')
|
|
294
|
+
})
|
|
295
|
+
})
|
|
296
|
+
|
|
297
|
+
it('PRO_023: Should block audit_logs (Business feature)', () => {
|
|
298
|
+
allure.story('Feature Blocking')
|
|
299
|
+
allure.severity('normal')
|
|
300
|
+
allure.description(`
|
|
301
|
+
Scenario: Pro plan does NOT include audit logs
|
|
302
|
+
When I check action "security.view_audit_logs"
|
|
303
|
+
Then the action should be denied
|
|
304
|
+
And the reason should be "feature_not_in_plan"
|
|
305
|
+
`)
|
|
306
|
+
|
|
307
|
+
billingAPI.checkAction('security.view_audit_logs').then((response: any) => {
|
|
308
|
+
billingAPI.validateActionDenied(response, 'feature_not_in_plan')
|
|
309
|
+
|
|
310
|
+
cy.log('audit_logs correctly blocked for Pro plan')
|
|
311
|
+
})
|
|
312
|
+
})
|
|
313
|
+
})
|
|
314
|
+
|
|
315
|
+
// ============================================================
|
|
316
|
+
// TEST GROUP 4: Quota Limits
|
|
317
|
+
// ============================================================
|
|
318
|
+
describe('Quota Limits', () => {
|
|
319
|
+
it('PRO_030: Should have team_members limit of 15', () => {
|
|
320
|
+
allure.story('Team Members Limit')
|
|
321
|
+
allure.severity('critical')
|
|
322
|
+
allure.description(`
|
|
323
|
+
Scenario: Pro plan limits - 15 team members
|
|
324
|
+
When I check usage for "team_members"
|
|
325
|
+
Then the max should be ${PRO_PLAN.limits.team_members}
|
|
326
|
+
`)
|
|
327
|
+
|
|
328
|
+
billingAPI.getUsage(TEST_TEAM.teamId, 'team_members').then((response: any) => {
|
|
329
|
+
billingAPI.validateUsageResponse(response, {
|
|
330
|
+
max: PRO_PLAN.limits.team_members
|
|
331
|
+
})
|
|
332
|
+
|
|
333
|
+
cy.log(`Team members limit: ${response.body.data.max}`)
|
|
334
|
+
cy.log(`Current usage: ${response.body.data.current}/${response.body.data.max}`)
|
|
335
|
+
})
|
|
336
|
+
})
|
|
337
|
+
|
|
338
|
+
it('PRO_031: Should have tasks limit of 1000', () => {
|
|
339
|
+
allure.story('Tasks Limit')
|
|
340
|
+
allure.severity('critical')
|
|
341
|
+
allure.description(`
|
|
342
|
+
Scenario: Pro plan limits - 1000 tasks
|
|
343
|
+
When I check usage for "tasks"
|
|
344
|
+
Then the max should be ${PRO_PLAN.limits.tasks}
|
|
345
|
+
`)
|
|
346
|
+
|
|
347
|
+
billingAPI.getUsage(TEST_TEAM.teamId, 'tasks').then((response: any) => {
|
|
348
|
+
billingAPI.validateUsageResponse(response, {
|
|
349
|
+
max: PRO_PLAN.limits.tasks
|
|
350
|
+
})
|
|
351
|
+
|
|
352
|
+
cy.log(`Tasks limit: ${response.body.data.max}`)
|
|
353
|
+
cy.log(`Current usage: ${response.body.data.current}/${response.body.data.max}`)
|
|
354
|
+
})
|
|
355
|
+
})
|
|
356
|
+
|
|
357
|
+
it('PRO_032: Should have customers limit of 500', () => {
|
|
358
|
+
allure.story('Customers Limit')
|
|
359
|
+
allure.severity('critical')
|
|
360
|
+
allure.description(`
|
|
361
|
+
Scenario: Pro plan limits - 500 customers
|
|
362
|
+
When I check usage for "customers"
|
|
363
|
+
Then the max should be ${PRO_PLAN.limits.customers}
|
|
364
|
+
`)
|
|
365
|
+
|
|
366
|
+
billingAPI.getUsage(TEST_TEAM.teamId, 'customers').then((response: any) => {
|
|
367
|
+
billingAPI.validateUsageResponse(response, {
|
|
368
|
+
max: PRO_PLAN.limits.customers
|
|
369
|
+
})
|
|
370
|
+
|
|
371
|
+
cy.log(`Customers limit: ${response.body.data.max}`)
|
|
372
|
+
cy.log(`Current usage: ${response.body.data.current}/${response.body.data.max}`)
|
|
373
|
+
})
|
|
374
|
+
})
|
|
375
|
+
|
|
376
|
+
it('PRO_033: Should have webhooks_count limit of 10', () => {
|
|
377
|
+
allure.story('Webhooks Limit')
|
|
378
|
+
allure.severity('normal')
|
|
379
|
+
allure.description(`
|
|
380
|
+
Scenario: Pro plan limits - 10 webhooks
|
|
381
|
+
When I check usage for "webhooks_count"
|
|
382
|
+
Then the max should be ${PRO_PLAN.limits.webhooks_count}
|
|
383
|
+
`)
|
|
384
|
+
|
|
385
|
+
billingAPI.getUsage(TEST_TEAM.teamId, 'webhooks_count').then((response: any) => {
|
|
386
|
+
billingAPI.validateUsageResponse(response, {
|
|
387
|
+
max: PRO_PLAN.limits.webhooks_count
|
|
388
|
+
})
|
|
389
|
+
|
|
390
|
+
cy.log(`Webhooks limit: ${response.body.data.max}`)
|
|
391
|
+
cy.log(`Current usage: ${response.body.data.current}/${response.body.data.max}`)
|
|
392
|
+
})
|
|
393
|
+
})
|
|
394
|
+
|
|
395
|
+
it('PRO_034: Should have api_calls limit of 100000', () => {
|
|
396
|
+
allure.story('API Calls Limit')
|
|
397
|
+
allure.severity('normal')
|
|
398
|
+
allure.description(`
|
|
399
|
+
Scenario: Pro plan limits - 100,000 API calls per month
|
|
400
|
+
When I check usage for "api_calls"
|
|
401
|
+
Then the max should be ${PRO_PLAN.limits.api_calls}
|
|
402
|
+
`)
|
|
403
|
+
|
|
404
|
+
billingAPI.getUsage(TEST_TEAM.teamId, 'api_calls').then((response: any) => {
|
|
405
|
+
billingAPI.validateUsageResponse(response, {
|
|
406
|
+
max: PRO_PLAN.limits.api_calls
|
|
407
|
+
})
|
|
408
|
+
|
|
409
|
+
cy.log(`API calls limit: ${response.body.data.max}`)
|
|
410
|
+
cy.log(`Current usage: ${response.body.data.current}/${response.body.data.max}`)
|
|
411
|
+
})
|
|
412
|
+
})
|
|
413
|
+
|
|
414
|
+
it('PRO_035: Should have storage_gb limit of 50', () => {
|
|
415
|
+
allure.story('Storage Limit')
|
|
416
|
+
allure.severity('normal')
|
|
417
|
+
allure.description(`
|
|
418
|
+
Scenario: Pro plan limits - 50GB storage
|
|
419
|
+
When I check usage for "storage_gb"
|
|
420
|
+
Then the max should be ${PRO_PLAN.limits.storage_gb}
|
|
421
|
+
`)
|
|
422
|
+
|
|
423
|
+
billingAPI.getUsage(TEST_TEAM.teamId, 'storage_gb').then((response: any) => {
|
|
424
|
+
billingAPI.validateUsageResponse(response, {
|
|
425
|
+
max: PRO_PLAN.limits.storage_gb
|
|
426
|
+
})
|
|
427
|
+
|
|
428
|
+
cy.log(`Storage limit: ${response.body.data.max}GB`)
|
|
429
|
+
})
|
|
430
|
+
})
|
|
431
|
+
})
|
|
432
|
+
|
|
433
|
+
// ============================================================
|
|
434
|
+
// TEST GROUP 5: Integration Tests
|
|
435
|
+
// ============================================================
|
|
436
|
+
describe('Integration', () => {
|
|
437
|
+
it('PRO_100: Should correctly enforce all Pro plan features and limits', () => {
|
|
438
|
+
allure.story('Complete Validation')
|
|
439
|
+
allure.severity('critical')
|
|
440
|
+
allure.description(`
|
|
441
|
+
Integration test that validates all Pro plan features:
|
|
442
|
+
- Subscription is active with pro plan
|
|
443
|
+
- All Pro features are allowed
|
|
444
|
+
- Business features are blocked
|
|
445
|
+
- All limits are correctly configured
|
|
446
|
+
`)
|
|
447
|
+
|
|
448
|
+
// 1. Verify subscription
|
|
449
|
+
billingAPI.getSubscription(TEST_TEAM.teamId).then((subResponse: any) => {
|
|
450
|
+
billingAPI.validateSubscriptionResponse(subResponse, {
|
|
451
|
+
status: 'active',
|
|
452
|
+
planSlug: 'pro'
|
|
453
|
+
})
|
|
454
|
+
cy.log('1. Subscription verified: Pro plan active')
|
|
455
|
+
})
|
|
456
|
+
|
|
457
|
+
// 2. Verify key allowed features
|
|
458
|
+
const allowedActions = [
|
|
459
|
+
'analytics.view_advanced',
|
|
460
|
+
'analytics.view_realtime',
|
|
461
|
+
'tasks.automate',
|
|
462
|
+
'branding.customize'
|
|
463
|
+
]
|
|
464
|
+
|
|
465
|
+
allowedActions.forEach((action) => {
|
|
466
|
+
billingAPI.checkAction(action).then((response: any) => {
|
|
467
|
+
billingAPI.validateActionAllowed(response)
|
|
468
|
+
cy.log(`2. ${action} correctly allowed`)
|
|
469
|
+
})
|
|
470
|
+
})
|
|
471
|
+
|
|
472
|
+
// 3. Verify key blocked features
|
|
473
|
+
const blockedActions = [
|
|
474
|
+
'auth.configure_sso',
|
|
475
|
+
'customers.bulk_import'
|
|
476
|
+
]
|
|
477
|
+
|
|
478
|
+
blockedActions.forEach((action) => {
|
|
479
|
+
billingAPI.checkAction(action).then((response: any) => {
|
|
480
|
+
expect(response.body.data.allowed).to.be.false
|
|
481
|
+
cy.log(`3. ${action} correctly blocked`)
|
|
482
|
+
})
|
|
483
|
+
})
|
|
484
|
+
|
|
485
|
+
// 4. Verify limits match plan config
|
|
486
|
+
const limitsToCheck = ['tasks', 'customers', 'team_members', 'webhooks_count']
|
|
487
|
+
limitsToCheck.forEach((limit) => {
|
|
488
|
+
billingAPI.getUsage(TEST_TEAM.teamId, limit).then((response: any) => {
|
|
489
|
+
expect(response.body.data.max).to.eq(PRO_PLAN.limits[limit])
|
|
490
|
+
cy.log(`4. ${limit} limit verified: ${response.body.data.max}`)
|
|
491
|
+
})
|
|
492
|
+
})
|
|
493
|
+
|
|
494
|
+
cy.log('Integration test completed successfully')
|
|
495
|
+
})
|
|
496
|
+
})
|
|
497
|
+
})
|