@nextsparkjs/theme-default 0.1.0-beta.20 → 0.1.0-beta.22
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/support/e2e.ts +89 -0
- package/tests/cypress.config.ts +165 -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,677 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dashboard - Page Object Model Class
|
|
3
|
+
*
|
|
4
|
+
* Encapsula toda la funcionalidad del dashboard principal
|
|
5
|
+
* Mapea test cases: DASH_001-008 de dashboard-main.cy.md
|
|
6
|
+
*/
|
|
7
|
+
export class Dashboard {
|
|
8
|
+
static selectors = {
|
|
9
|
+
// Contenedores principales - estructura real del dashboard
|
|
10
|
+
container: '.min-h-screen.bg-gradient-to-b', // Contenedor principal del dashboard
|
|
11
|
+
mainContainer: '.max-w-7xl.mx-auto.space-y-8', // Contenedor principal con space-y-8
|
|
12
|
+
headerSection: '.mb-8', // Sección del header
|
|
13
|
+
welcome: 'h1.text-3xl.font-bold', // Título de bienvenida
|
|
14
|
+
welcomeText: 'p.text-muted-foreground.mt-1', // Texto de bienvenida
|
|
15
|
+
loading: '.animate-spin', // Indicador de carga
|
|
16
|
+
|
|
17
|
+
// Tarjetas de estadísticas - estructura real
|
|
18
|
+
statsGrid: '.grid.gap-4.md\\:grid-cols-2.lg\\:grid-cols-4',
|
|
19
|
+
statCard: '.rounded-lg.border', // Card components
|
|
20
|
+
statTitle: '.text-sm.font-medium',
|
|
21
|
+
statValue: '.text-2xl.font-bold',
|
|
22
|
+
statBadge: '.mt-1',
|
|
23
|
+
|
|
24
|
+
// Quick Actions - estructura real (es una Card única)
|
|
25
|
+
quickActionsCard: '.space-y-8 > .rounded-lg.border', // Card de Quick Actions dentro del space-y-8
|
|
26
|
+
quickActionGrid: '.grid.gap-4.md\\:grid-cols-2.lg\\:grid-cols-3', // Grid dentro de CardContent
|
|
27
|
+
quickActionButton: 'button.h-auto.p-4.flex.flex-col',
|
|
28
|
+
quickActionTasks: 'button:contains("My Tasks")',
|
|
29
|
+
quickActionProfile: 'button:contains("My Profile")',
|
|
30
|
+
quickActionSettings: 'button:contains("Settings")',
|
|
31
|
+
quickActionBilling: 'button:contains("Billing")',
|
|
32
|
+
|
|
33
|
+
// Activity section - es otra Card dentro del space-y-8
|
|
34
|
+
activityCard: '.space-y-8 > .rounded-lg.border:nth-child(3)', // Tercera card (stats, quick actions, activity)
|
|
35
|
+
activityItem: '.space-y-4 .flex.items-center.gap-4',
|
|
36
|
+
|
|
37
|
+
// Elementos específicos (usando selectores CSS hasta implementar data-cy)
|
|
38
|
+
accountStatusCard: '[data-stat="account-status"]',
|
|
39
|
+
planCard: '[data-stat="plan"]',
|
|
40
|
+
teamMembersCard: '[data-stat="team-members"]',
|
|
41
|
+
usageCard: '[data-stat="usage"]',
|
|
42
|
+
|
|
43
|
+
// Missing selectors that tests expect
|
|
44
|
+
createTaskButton: '[data-cy="create-task-button"]', // Para modal creation
|
|
45
|
+
taskCreateModal: '[data-cy="task-create-modal"]', // Modal de creación
|
|
46
|
+
skipToMain: '[data-cy="skip-to-main"]', // Accessibility
|
|
47
|
+
mobileMenu: '[data-cy="mobile-menu"]', // Mobile navigation
|
|
48
|
+
breadcrumbs: '[data-cy="breadcrumbs"]', // Breadcrumb navigation
|
|
49
|
+
|
|
50
|
+
// User personalization
|
|
51
|
+
userGreeting: 'h1',
|
|
52
|
+
userBadges: '.inline-flex.items-center.rounded-full',
|
|
53
|
+
|
|
54
|
+
// Error states
|
|
55
|
+
error: '.text-destructive',
|
|
56
|
+
errorMessage: '.text-red-600',
|
|
57
|
+
|
|
58
|
+
// Success states
|
|
59
|
+
success: '.text-green-600',
|
|
60
|
+
|
|
61
|
+
// Notification area
|
|
62
|
+
notificationArea: '[role="alert"]',
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Valida que el dashboard está cargado correctamente
|
|
67
|
+
*/
|
|
68
|
+
validateDashboardLoaded() {
|
|
69
|
+
cy.get(Dashboard.selectors.container).should('be.visible')
|
|
70
|
+
cy.get(Dashboard.selectors.welcome).should('be.visible')
|
|
71
|
+
cy.url().should('include', '/dashboard')
|
|
72
|
+
|
|
73
|
+
return this
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Valida el acceso exitoso al dashboard después del login
|
|
78
|
+
*/
|
|
79
|
+
validateSuccessfulLogin() {
|
|
80
|
+
this.validateDashboardLoaded()
|
|
81
|
+
cy.get(Dashboard.selectors.welcome).should('be.visible')
|
|
82
|
+
cy.get(Dashboard.selectors.welcomeText).should('be.visible')
|
|
83
|
+
|
|
84
|
+
return this
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Valida el estado de loading del dashboard
|
|
89
|
+
*/
|
|
90
|
+
validateLoadingState() {
|
|
91
|
+
cy.get(Dashboard.selectors.loading).should('be.visible')
|
|
92
|
+
return this
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Valida que el loading ha terminado
|
|
97
|
+
*/
|
|
98
|
+
validateLoadingCompleted() {
|
|
99
|
+
cy.get(Dashboard.selectors.loading).should('not.exist')
|
|
100
|
+
return this
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Valida la personalización del usuario
|
|
105
|
+
*/
|
|
106
|
+
validateUserPersonalization(userFullName) {
|
|
107
|
+
cy.get(Dashboard.selectors.welcomeText).should('contain.text', 'Welcome back')
|
|
108
|
+
if (userFullName) {
|
|
109
|
+
cy.get(Dashboard.selectors.welcomeText).should('contain.text', userFullName)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return this
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Valida las tarjetas de estadísticas
|
|
117
|
+
*/
|
|
118
|
+
validateStatsCards() {
|
|
119
|
+
cy.get(Dashboard.selectors.statsGrid).should('be.visible')
|
|
120
|
+
cy.get(Dashboard.selectors.statCard).should('have.length.at.least', 3)
|
|
121
|
+
|
|
122
|
+
return this
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Valida estadística específica
|
|
127
|
+
*/
|
|
128
|
+
validateSpecificStat(statType, expectedValue) {
|
|
129
|
+
cy.get(`[data-stat="${statType}"]`)
|
|
130
|
+
.should('be.visible')
|
|
131
|
+
.and('contain.text', expectedValue)
|
|
132
|
+
|
|
133
|
+
return this
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Valida las quick actions
|
|
138
|
+
*/
|
|
139
|
+
validateQuickActions() {
|
|
140
|
+
cy.get(Dashboard.selectors.quickActionsGrid).should('be.visible')
|
|
141
|
+
cy.get(Dashboard.selectors.quickActionCard).should('have.length.at.least', 3)
|
|
142
|
+
|
|
143
|
+
return this
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Navega a Tasks desde quick actions
|
|
148
|
+
*/
|
|
149
|
+
navigateToTasksFromQuickAction() {
|
|
150
|
+
cy.get(Dashboard.selectors.quickActionTasks).click()
|
|
151
|
+
cy.url().should('include', '/tasks')
|
|
152
|
+
|
|
153
|
+
return this
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Navega a Profile desde quick actions
|
|
158
|
+
*/
|
|
159
|
+
navigateToProfileFromQuickAction() {
|
|
160
|
+
cy.get(Dashboard.selectors.quickActionProfile).click()
|
|
161
|
+
cy.url().should('include', '/profile')
|
|
162
|
+
|
|
163
|
+
return this
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Navega a Settings desde quick actions
|
|
168
|
+
*/
|
|
169
|
+
navigateToSettingsFromQuickAction() {
|
|
170
|
+
cy.get(Dashboard.selectors.quickActionSettings).click()
|
|
171
|
+
cy.url().should('include', '/settings')
|
|
172
|
+
|
|
173
|
+
return this
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Valida badges del usuario
|
|
178
|
+
*/
|
|
179
|
+
validateUserBadges() {
|
|
180
|
+
cy.get(Dashboard.selectors.userBadges).should('be.visible')
|
|
181
|
+
|
|
182
|
+
return this
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Valida dashboard para usuario específico
|
|
187
|
+
*/
|
|
188
|
+
validateDashboardForUser(userRole) {
|
|
189
|
+
this.validateDashboardLoaded()
|
|
190
|
+
|
|
191
|
+
if (userRole === 'superadmin') {
|
|
192
|
+
// Superadmin debería ver elementos adicionales
|
|
193
|
+
cy.get('[data-cy="superadmin-access"]').should('be.visible')
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return this
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Valida mensaje de error en dashboard
|
|
201
|
+
*/
|
|
202
|
+
validateErrorState(errorMessage) {
|
|
203
|
+
cy.get(Dashboard.selectors.error)
|
|
204
|
+
.should('be.visible')
|
|
205
|
+
.and('contain.text', errorMessage)
|
|
206
|
+
|
|
207
|
+
return this
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Valida mensaje de éxito
|
|
212
|
+
*/
|
|
213
|
+
validateSuccessMessage(message) {
|
|
214
|
+
cy.get(Dashboard.selectors.success)
|
|
215
|
+
.should('be.visible')
|
|
216
|
+
.and('contain.text', message)
|
|
217
|
+
|
|
218
|
+
return this
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Valida responsive behavior del dashboard
|
|
223
|
+
*/
|
|
224
|
+
validateResponsiveBehavior() {
|
|
225
|
+
// Desktop
|
|
226
|
+
cy.viewport(1200, 800)
|
|
227
|
+
cy.get(Dashboard.selectors.statsGrid).should('have.class', 'lg:grid-cols-4')
|
|
228
|
+
|
|
229
|
+
// Tablet
|
|
230
|
+
cy.viewport(768, 1024)
|
|
231
|
+
cy.get(Dashboard.selectors.statsGrid).should('have.class', 'sm:grid-cols-2')
|
|
232
|
+
|
|
233
|
+
// Mobile
|
|
234
|
+
cy.viewport(375, 667)
|
|
235
|
+
cy.get(Dashboard.selectors.statsGrid).should('have.class', 'grid-cols-1')
|
|
236
|
+
|
|
237
|
+
return this
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Valida accesibilidad del dashboard
|
|
242
|
+
*/
|
|
243
|
+
validateAccessibility() {
|
|
244
|
+
// Verificar heading hierarchy
|
|
245
|
+
cy.get('h1').should('exist')
|
|
246
|
+
|
|
247
|
+
// Verificar roles ARIA
|
|
248
|
+
cy.get('[role="main"]').should('exist')
|
|
249
|
+
|
|
250
|
+
// Verificar que las tarjetas tienen labels apropiados
|
|
251
|
+
cy.get(Dashboard.selectors.statCard).each(($card) => {
|
|
252
|
+
cy.wrap($card).should('have.attr', 'role').or('have.attr', 'aria-label')
|
|
253
|
+
})
|
|
254
|
+
|
|
255
|
+
return this
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Valida animaciones y transiciones
|
|
260
|
+
*/
|
|
261
|
+
validateAnimations() {
|
|
262
|
+
// Verificar que las tarjetas tienen efectos hover
|
|
263
|
+
cy.get(Dashboard.selectors.quickActionCard).first().trigger('mouseover')
|
|
264
|
+
cy.get(Dashboard.selectors.quickActionCard).first()
|
|
265
|
+
.should('have.class', 'group')
|
|
266
|
+
|
|
267
|
+
return this
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Valida redirección cuando no autenticado
|
|
272
|
+
*/
|
|
273
|
+
validateUnauthenticatedRedirect() {
|
|
274
|
+
cy.url().should('include', '/login')
|
|
275
|
+
return this
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Valida contenido dinámico basado en datos del usuario
|
|
280
|
+
*/
|
|
281
|
+
validateDynamicContent(userData) {
|
|
282
|
+
if (userData.firstName) {
|
|
283
|
+
cy.get(Dashboard.selectors.welcomeText)
|
|
284
|
+
.should('contain.text', userData.firstName)
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if (userData.role) {
|
|
288
|
+
this.validateDashboardForUser(userData.role)
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return this
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Valida notificaciones en el dashboard
|
|
296
|
+
*/
|
|
297
|
+
validateNotifications() {
|
|
298
|
+
cy.get(Dashboard.selectors.notificationArea).should('exist')
|
|
299
|
+
|
|
300
|
+
return this
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Simula actualización de datos y valida refresh
|
|
305
|
+
*/
|
|
306
|
+
validateDataRefresh() {
|
|
307
|
+
// Simular refresh de página
|
|
308
|
+
cy.reload()
|
|
309
|
+
this.validateDashboardLoaded()
|
|
310
|
+
|
|
311
|
+
return this
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Valida métricas de performance
|
|
316
|
+
*/
|
|
317
|
+
validatePerformance() {
|
|
318
|
+
// Verificar que el dashboard carga en tiempo razonable
|
|
319
|
+
cy.get(Dashboard.selectors.container, { timeout: 5000 }).should('be.visible')
|
|
320
|
+
|
|
321
|
+
return this
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Valida integración con otros componentes
|
|
326
|
+
*/
|
|
327
|
+
validateComponentIntegration() {
|
|
328
|
+
// Verificar que sidebar y topnav están presentes
|
|
329
|
+
cy.get('[data-cy="sidebar-main"]').should('be.visible')
|
|
330
|
+
cy.get('[data-cy="topnav-header"]').should('be.visible')
|
|
331
|
+
|
|
332
|
+
return this
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// ========================================
|
|
336
|
+
// MÉTODOS REQUERIDOS POR LOS TESTS
|
|
337
|
+
// ========================================
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Valida que el dashboard está cargado
|
|
341
|
+
*/
|
|
342
|
+
validateDashboardLoaded() {
|
|
343
|
+
cy.get(Dashboard.selectors.container).should('be.visible')
|
|
344
|
+
cy.url().should('include', '/dashboard')
|
|
345
|
+
return this
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Valida estructura del layout
|
|
350
|
+
*/
|
|
351
|
+
validateLayoutStructure() {
|
|
352
|
+
cy.get(Dashboard.selectors.header).should('be.visible')
|
|
353
|
+
cy.get(Dashboard.selectors.main).should('be.visible')
|
|
354
|
+
return this
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Valida sección del header
|
|
359
|
+
*/
|
|
360
|
+
validateHeaderSection() {
|
|
361
|
+
cy.get(Dashboard.selectors.header).should('be.visible')
|
|
362
|
+
return this
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Valida contenido principal
|
|
367
|
+
*/
|
|
368
|
+
validateMainContent() {
|
|
369
|
+
cy.get(Dashboard.selectors.main).should('be.visible')
|
|
370
|
+
return this
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Valida mensaje de bienvenida
|
|
375
|
+
*/
|
|
376
|
+
validateWelcomeMessage() {
|
|
377
|
+
cy.get(Dashboard.selectors.welcome).should('be.visible')
|
|
378
|
+
cy.get(Dashboard.selectors.welcome).should('contain.text', 'Dashboard')
|
|
379
|
+
return this
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Valida display del nombre de usuario
|
|
384
|
+
*/
|
|
385
|
+
validateUserNameDisplay(firstName) {
|
|
386
|
+
cy.get(Dashboard.selectors.welcomeText).should('contain.text', 'Welcome back')
|
|
387
|
+
if (firstName) {
|
|
388
|
+
cy.get(Dashboard.selectors.welcomeText).should('contain.text', firstName)
|
|
389
|
+
}
|
|
390
|
+
return this
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Valida layout responsive
|
|
395
|
+
*/
|
|
396
|
+
validateResponsiveLayout(device) {
|
|
397
|
+
// Validar que el contenedor principal responde al viewport
|
|
398
|
+
cy.get(Dashboard.selectors.container).should('be.visible')
|
|
399
|
+
cy.get(Dashboard.selectors.statsGrid).should('be.visible')
|
|
400
|
+
|
|
401
|
+
if (device === 'mobile') {
|
|
402
|
+
// En mobile, validar que el grid se comporta responsivamente
|
|
403
|
+
cy.get(Dashboard.selectors.statsGrid).should('have.css', 'grid-template-columns')
|
|
404
|
+
} else if (device === 'tablet') {
|
|
405
|
+
// En tablet, validar responsive grid
|
|
406
|
+
cy.get(Dashboard.selectors.statsGrid).should('have.css', 'grid-template-columns')
|
|
407
|
+
} else {
|
|
408
|
+
// En desktop, validar layout completo
|
|
409
|
+
cy.get(Dashboard.selectors.statsGrid).should('have.css', 'grid-template-columns')
|
|
410
|
+
}
|
|
411
|
+
return this
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Valida estado de datos parciales
|
|
416
|
+
*/
|
|
417
|
+
validatePartialDataState() {
|
|
418
|
+
cy.get('[data-cy="loading-indicator"]').should('not.exist')
|
|
419
|
+
return this
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Refresca el dashboard
|
|
424
|
+
*/
|
|
425
|
+
refreshDashboard() {
|
|
426
|
+
cy.reload()
|
|
427
|
+
this.validateDashboardLoaded()
|
|
428
|
+
return this
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Valida modo de alto contraste
|
|
433
|
+
*/
|
|
434
|
+
validateHighContrastMode() {
|
|
435
|
+
cy.get('body').should('have.class', 'high-contrast')
|
|
436
|
+
return this
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Valida reducción de movimiento
|
|
441
|
+
*/
|
|
442
|
+
validateReducedMotion() {
|
|
443
|
+
cy.get('body').should('have.class', 'reduce-motion')
|
|
444
|
+
return this
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Hace click en la acción de crear task (My Tasks)
|
|
449
|
+
*/
|
|
450
|
+
clickCreateTaskAction() {
|
|
451
|
+
cy.get(Dashboard.selectors.mainContainer).within(() => {
|
|
452
|
+
cy.contains('.rounded-lg.border', 'Quick Actions').within(() => {
|
|
453
|
+
cy.contains('My Tasks').click()
|
|
454
|
+
})
|
|
455
|
+
})
|
|
456
|
+
return this
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// ========================================
|
|
460
|
+
// MÉTODOS FALTANTES REQUERIDOS POR LOS TESTS
|
|
461
|
+
// ========================================
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Valida overview de tasks
|
|
465
|
+
*/
|
|
466
|
+
validateTasksOverview() {
|
|
467
|
+
// Buscar la Card de Quick Actions después del stats grid
|
|
468
|
+
cy.get(Dashboard.selectors.mainContainer).within(() => {
|
|
469
|
+
cy.get('.rounded-lg.border').should('have.length.at.least', 5) // 4 stats + 1 quick actions + activity
|
|
470
|
+
})
|
|
471
|
+
return this
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Valida resumen de tasks
|
|
476
|
+
*/
|
|
477
|
+
validateTasksSummary() {
|
|
478
|
+
cy.get(Dashboard.selectors.quickActionTasks).should('be.visible')
|
|
479
|
+
return this
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Valida acciones rápidas de tasks
|
|
484
|
+
*/
|
|
485
|
+
validateQuickTaskActions() {
|
|
486
|
+
cy.get(Dashboard.selectors.quickActionTasks).should('be.visible')
|
|
487
|
+
return this
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Valida actividad reciente
|
|
492
|
+
*/
|
|
493
|
+
validateRecentActivity() {
|
|
494
|
+
// Buscar la última card que debería ser Activity
|
|
495
|
+
cy.get(Dashboard.selectors.mainContainer).within(() => {
|
|
496
|
+
cy.get('.rounded-lg.border').last().should('be.visible')
|
|
497
|
+
})
|
|
498
|
+
return this
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* Valida items de actividad
|
|
503
|
+
*/
|
|
504
|
+
validateActivityItems() {
|
|
505
|
+
cy.get(Dashboard.selectors.activityItem).should('have.length.at.least', 1)
|
|
506
|
+
return this
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Valida timestamps de actividad
|
|
511
|
+
*/
|
|
512
|
+
validateActivityTimestamps() {
|
|
513
|
+
cy.get(Dashboard.selectors.activityItem).should('be.visible')
|
|
514
|
+
return this
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Valida acciones rápidas generales
|
|
519
|
+
*/
|
|
520
|
+
validateQuickActions() {
|
|
521
|
+
// Buscar la card que contiene "Quick Actions" por contenido
|
|
522
|
+
cy.get(Dashboard.selectors.mainContainer).within(() => {
|
|
523
|
+
cy.contains('.rounded-lg.border', 'Quick Actions').should('be.visible').within(() => {
|
|
524
|
+
cy.get('button').should('have.length.at.least', 4) // 4 botones: Tasks, Profile, Settings, Billing
|
|
525
|
+
})
|
|
526
|
+
})
|
|
527
|
+
return this
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Valida acción de crear task
|
|
532
|
+
*/
|
|
533
|
+
validateCreateTaskAction() {
|
|
534
|
+
cy.get(Dashboard.selectors.quickActionTasks).should('be.visible')
|
|
535
|
+
return this
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Valida acción de settings
|
|
540
|
+
*/
|
|
541
|
+
validateSettingsAction() {
|
|
542
|
+
cy.get(Dashboard.selectors.quickActionSettings).should('be.visible')
|
|
543
|
+
return this
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* Valida acción de profile
|
|
548
|
+
*/
|
|
549
|
+
validateProfileAction() {
|
|
550
|
+
cy.get(Dashboard.selectors.quickActionProfile).should('be.visible')
|
|
551
|
+
return this
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Valida breadcrumbs
|
|
556
|
+
*/
|
|
557
|
+
validateBreadcrumbs() {
|
|
558
|
+
// Para este dashboard no hay breadcrumbs explícitos, validamos el título
|
|
559
|
+
cy.get(Dashboard.selectors.welcome).should('be.visible')
|
|
560
|
+
return this
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Valida indicador de página actual
|
|
565
|
+
*/
|
|
566
|
+
validateCurrentPageIndicator(pageName) {
|
|
567
|
+
// El breadcrumb/page indicator debería mostrar "Dashboard"
|
|
568
|
+
cy.get(Dashboard.selectors.welcome).should('contain.text', 'Dashboard')
|
|
569
|
+
return this
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Click en acción de profile
|
|
574
|
+
*/
|
|
575
|
+
clickProfileAction() {
|
|
576
|
+
cy.get(Dashboard.selectors.mainContainer).within(() => {
|
|
577
|
+
cy.contains('.rounded-lg.border', 'Quick Actions').within(() => {
|
|
578
|
+
cy.contains('My Profile').click()
|
|
579
|
+
})
|
|
580
|
+
})
|
|
581
|
+
return this
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Click en acción de settings
|
|
586
|
+
*/
|
|
587
|
+
clickSettingsAction() {
|
|
588
|
+
cy.get(Dashboard.selectors.mainContainer).within(() => {
|
|
589
|
+
cy.contains('.rounded-lg.border', 'Quick Actions').within(() => {
|
|
590
|
+
cy.contains('Settings').click()
|
|
591
|
+
})
|
|
592
|
+
})
|
|
593
|
+
return this
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Click en primer task del overview
|
|
598
|
+
*/
|
|
599
|
+
clickFirstTaskInOverview() {
|
|
600
|
+
cy.get(Dashboard.selectors.quickActionTasks).first().click()
|
|
601
|
+
return this
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Filtra actividad por tipo
|
|
606
|
+
*/
|
|
607
|
+
filterActivityByType(type) {
|
|
608
|
+
// Sin filtros reales implementados, solo validamos existencia
|
|
609
|
+
cy.get(Dashboard.selectors.activityCard).should('be.visible')
|
|
610
|
+
return this
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* Valida actividad filtrada
|
|
615
|
+
*/
|
|
616
|
+
validateFilteredActivity(type) {
|
|
617
|
+
cy.get(Dashboard.selectors.activityItem).should('be.visible')
|
|
618
|
+
return this
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* Limpia filtro de actividad
|
|
623
|
+
*/
|
|
624
|
+
clearActivityFilter() {
|
|
625
|
+
// No hay filtros reales, solo validamos
|
|
626
|
+
cy.get(Dashboard.selectors.activityCard).should('be.visible')
|
|
627
|
+
return this
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Valida toda la actividad
|
|
632
|
+
*/
|
|
633
|
+
validateAllActivity() {
|
|
634
|
+
cy.get(Dashboard.selectors.activityItem).should('be.visible')
|
|
635
|
+
return this
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Valida estado vacío de tasks
|
|
640
|
+
*/
|
|
641
|
+
validateEmptyTasksState() {
|
|
642
|
+
cy.get(Dashboard.selectors.quickActionsCard).should('be.visible')
|
|
643
|
+
return this
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Valida estado vacío de actividad
|
|
648
|
+
*/
|
|
649
|
+
validateEmptyActivityState() {
|
|
650
|
+
cy.get(Dashboard.selectors.activityCard).should('be.visible')
|
|
651
|
+
return this
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Valida prompt de inicio
|
|
656
|
+
*/
|
|
657
|
+
validateGetStartedPrompt() {
|
|
658
|
+
cy.get(Dashboard.selectors.quickActionsCard).should('be.visible')
|
|
659
|
+
return this
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Valida que el dashboard se refrescó
|
|
664
|
+
*/
|
|
665
|
+
validateDashboardRefreshed() {
|
|
666
|
+
cy.get(Dashboard.selectors.container).should('be.visible')
|
|
667
|
+
return this
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Valida actualizaciones en tiempo real
|
|
672
|
+
*/
|
|
673
|
+
validateRealTimeUpdates() {
|
|
674
|
+
cy.get(Dashboard.selectors.container).should('be.visible')
|
|
675
|
+
return this
|
|
676
|
+
}
|
|
677
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export class DashboardPage {
|
|
2
|
+
static selectors = {
|
|
3
|
+
dashboard: '[data-cy="dashboard"]',
|
|
4
|
+
title: '[data-cy="dashboard-title"]',
|
|
5
|
+
userMenu: '[data-cy="user-menu"]',
|
|
6
|
+
logoutButton: '[data-cy="logout-button"]',
|
|
7
|
+
content: '[data-cy="dashboard-content"]',
|
|
8
|
+
navigation: '[data-cy="dashboard-nav"]'
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Verification methods
|
|
12
|
+
verifyDashboardVisible() {
|
|
13
|
+
cy.get(DashboardPage.selectors.dashboard).should('be.visible')
|
|
14
|
+
return this
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
verifyTitle(expectedTitle = 'Dashboard') {
|
|
18
|
+
cy.get('h1').should('contain.text', expectedTitle)
|
|
19
|
+
return this
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
verifyUserMenuVisible() {
|
|
23
|
+
cy.get(DashboardPage.selectors.userMenu).should('be.visible')
|
|
24
|
+
return this
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Actions
|
|
28
|
+
clickUserMenu() {
|
|
29
|
+
cy.get(DashboardPage.selectors.userMenu).should('be.visible').click()
|
|
30
|
+
return this
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
clickLogout() {
|
|
34
|
+
cy.get(DashboardPage.selectors.logoutButton).should('be.visible').click()
|
|
35
|
+
return this
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
logout() {
|
|
39
|
+
this.clickUserMenu()
|
|
40
|
+
this.clickLogout()
|
|
41
|
+
return this
|
|
42
|
+
}
|
|
43
|
+
}
|