Add end-to-end tests for REST API and UI components#89
Conversation
* feat(dashboard): add default dashboard with metrics, chart and quick send * feat(dashboard): add default dashboard with metrics, chart and quick send * feat(dashboard): add default dashboard with metrics, chart and quick send * feat(dashboard): add default dashboard with metrics, chart and quick send * feat(dashboard): add default dashboard with metrics, chart and quick send * Composer.lock file added * feat(settings): migrate settings page to plugin-ui schema-driven components Replace the hand-rolled React settings UI with the schema-driven <Settings> component from @wedevs/plugin-ui, backed by BaseSettingsRESTController from wedevs/wp-kit. Preserves full backward compatibility with the existing texty_settings wp_option structure and gateway credential validation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(settings): add filter for third-party gateways and order prop for sorting - Add `texty_settings_schema` filter in get_settings_schema() to allow third-party plugins to register gateway sections and fields - Add `order()` method to GatewayInterface (default 10, Fake returns 99) - Add `priority` prop to all gateway sections in schema - Sort gateway dropdown options by order, then alphabetically Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: make order() optional, only override in Fake gateway Remove order() from GatewayInterface and default-10 gateways. Only Fake overrides it (returns 99). get_gateway_options() already falls back to 10 via method_exists() check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(settings): set gateway_selection section priority to 9 Ensures the gateway selector section always appears above gateway credential sections (priority 10) regardless of sort order. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Feat/revemp design layout (#75) * feat(menu): enhance admin menu registration with capability checks and dynamic submenus * feat(settings): update package dependencies and add TypeScript configuration * feat: integrate Tailwind CSS and update styles - Added Tailwind CSS as a dependency and configured PostCSS. - Created a new base Tailwind CSS file for global styles. - Removed legacy CSS styles from app.css and migrated to Tailwind utility classes. - Updated Header component to utilize Tailwind for layout and styling. - Adjusted index.js to import the new base Tailwind CSS file instead of plugin UI styles. - Refactored SCSS styles to use Tailwind utilities and Sass color functions for better maintainability. - Updated package.json to include new dependencies for Tailwind and PostCSS. * feat: migrate to React Router v7 and refactor App structure * refactor: update package dependencies and improve header component - Changed dependency for @wedevs/plugin-ui from GitHub to local file reference. - Enhanced base-tailwind.css with improved import statements and added button styles. - Refactored Header component to utilize new icons and dropdown menu for help items. - Updated TypeScript definitions to include support_url and feature_request_url. - Added watch options in webpack.config.js to ignore dist folder during rebuilds. * Add frontend development guidelines and update project documentation - Introduced SKILL.md for frontend development rules and conventions, covering React, TypeScript, Tailwind, and more. - Created CLAUDE.md to provide guidance for working with the Texty SMS notification plugin, detailing architecture, common commands, and feature addition processes. - Updated .gitignore to exclude seed files. * refactor: restructure dashboard components and remove unused files - Deleted HelpResources, StatCard, VolumeChart, and Dashboard components. - Introduced QuickSendCard and StatCards components for better modularity. - Updated Dashboard to utilize new components and improved data fetching logic. - Enhanced VolumeAnalytics for better data visualization. - Refactored routing to point to new dashboard structure. - Updated type definitions for better TypeScript support. - Adjusted imports to use the new plugin UI components. * docs: update code review and backend development guidelines to enforce class import standards * feat: enhance layout components and improve routing structure with new hooks and skeletons Co-authored-by: Copilot <copilot@github.com> * feat: add backButtonLabel prop to layout components and update routing documentation * feat: add error handling components with ErrorBoundary and NotFound pages Co-authored-by: Copilot <copilot@github.com> * feat: add ErrorBoundary and NotFound components for improved error handling * feat: update verification commands guidance for frontend edits and clarify user-triggered actions * feat: bridge plugin-ui theme tokens into Tailwind utility names for improved styling * feat: update submenu item identifiers to use 'path' instead of 'id' for improved clarity * feat: Update PHPCS configuration and enhance Tailwind CSS styles for improved layout consistency Co-authored-by: Copilot <copilot@github.com> * feat: Introduce GatewayStatus component and update dashboard to utilize new status display * feat: Add PhoneField component and AppLayout for enhanced form functionality * Update AppLayout.tsx * feat: Implement dashboard components and hooks for enhanced user experience * Use @wordpress/element for runtime React imports * feat: Enhance routing with lazy loading and suspense for improved performance * feat: Remove unused toastify styles to streamline CSS * Defensive handling of null recipients/values * feat: update API class registration and enhance version handling in Header component * feat(Menu): update submenu path handling to support external URLs --------- Co-authored-by: Copilot <copilot@github.com> --------- Co-authored-by: SHAMIM <111671483+Shamim-97@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Kamruzzaman <kzamanbn@gmail.com> Co-authored-by: Copilot <copilot@github.com>
* feat(dashboard): add default dashboard with metrics, chart and quick send * feat(dashboard): add default dashboard with metrics, chart and quick send * feat(dashboard): add default dashboard with metrics, chart and quick send * feat(dashboard): add default dashboard with metrics, chart and quick send * feat(dashboard): add default dashboard with metrics, chart and quick send * Composer.lock file added * feat(settings): migrate settings page to plugin-ui schema-driven components Replace the hand-rolled React settings UI with the schema-driven <Settings> component from @wedevs/plugin-ui, backed by BaseSettingsRESTController from wedevs/wp-kit. Preserves full backward compatibility with the existing texty_settings wp_option structure and gateway credential validation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(settings): add filter for third-party gateways and order prop for sorting - Add `texty_settings_schema` filter in get_settings_schema() to allow third-party plugins to register gateway sections and fields - Add `order()` method to GatewayInterface (default 10, Fake returns 99) - Add `priority` prop to all gateway sections in schema - Sort gateway dropdown options by order, then alphabetically Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: make order() optional, only override in Fake gateway Remove order() from GatewayInterface and default-10 gateways. Only Fake overrides it (returns 99). get_gateway_options() already falls back to 10 via method_exists() check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(settings): set gateway_selection section priority to 9 Ensures the gateway selector section always appears above gateway credential sections (priority 10) regardless of sort order. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(menu): enhance admin menu registration with capability checks and dynamic submenus * feat(settings): update package dependencies and add TypeScript configuration * feat: integrate Tailwind CSS and update styles - Added Tailwind CSS as a dependency and configured PostCSS. - Created a new base Tailwind CSS file for global styles. - Removed legacy CSS styles from app.css and migrated to Tailwind utility classes. - Updated Header component to utilize Tailwind for layout and styling. - Adjusted index.js to import the new base Tailwind CSS file instead of plugin UI styles. - Refactored SCSS styles to use Tailwind utilities and Sass color functions for better maintainability. - Updated package.json to include new dependencies for Tailwind and PostCSS. * feat: migrate to React Router v7 and refactor App structure * refactor: update package dependencies and improve header component - Changed dependency for @wedevs/plugin-ui from GitHub to local file reference. - Enhanced base-tailwind.css with improved import statements and added button styles. - Refactored Header component to utilize new icons and dropdown menu for help items. - Updated TypeScript definitions to include support_url and feature_request_url. - Added watch options in webpack.config.js to ignore dist folder during rebuilds. * Add frontend development guidelines and update project documentation - Introduced SKILL.md for frontend development rules and conventions, covering React, TypeScript, Tailwind, and more. - Created CLAUDE.md to provide guidance for working with the Texty SMS notification plugin, detailing architecture, common commands, and feature addition processes. - Updated .gitignore to exclude seed files. * refactor: restructure dashboard components and remove unused files - Deleted HelpResources, StatCard, VolumeChart, and Dashboard components. - Introduced QuickSendCard and StatCards components for better modularity. - Updated Dashboard to utilize new components and improved data fetching logic. - Enhanced VolumeAnalytics for better data visualization. - Refactored routing to point to new dashboard structure. - Updated type definitions for better TypeScript support. - Adjusted imports to use the new plugin UI components. * docs: update code review and backend development guidelines to enforce class import standards * feat: enhance layout components and improve routing structure with new hooks and skeletons Co-authored-by: Copilot <copilot@github.com> * feat: add backButtonLabel prop to layout components and update routing documentation * feat: add error handling components with ErrorBoundary and NotFound pages Co-authored-by: Copilot <copilot@github.com> * feat: add ErrorBoundary and NotFound components for improved error handling * feat: update verification commands guidance for frontend edits and clarify user-triggered actions * feat: bridge plugin-ui theme tokens into Tailwind utility names for improved styling * feat: update submenu item identifiers to use 'path' instead of 'id' for improved clarity * feat: Update PHPCS configuration and enhance Tailwind CSS styles for improved layout consistency Co-authored-by: Copilot <copilot@github.com> * feat: Introduce GatewayStatus component and update dashboard to utilize new status display * feat: Add PhoneField component and AppLayout for enhanced form functionality * Update AppLayout.tsx * Refactor gateway settings management - Removed the old SettingsPage component and replaced it with a new GatewayConfiguration component that handles gateway settings. - Introduced new components for the gateway detail pane, sidebar, header, and section to improve modularity and readability. - Implemented a loading skeleton for better user experience during data fetching. - Updated routing to reflect the new structure, replacing the old settings page with the new gateway configuration page. * feat: Implement dashboard components and hooks for enhanced user experience * Use @wordpress/element for runtime React imports * Use @wordpress/element for runtime React imports * feat: Enhance routing with lazy loading and suspense for improved performance * feat: Remove unused toastify styles to streamline CSS * Defensive handling of null recipients/values * feat: Notifications management UI (user events, integrations, settings) (#77) * feat: Implement notifications management with user events, integrations, and settings components * Use @wordpress/element for runtime React imports * Feature notifications settings (#79) * feature notifications settings * feature notifications settings * remove STOP settings * STOP feature remove * Feat/logs (#78) * feat: add SMS logs feature with REST API and UI components - Introduced a new Logs API endpoint for fetching SMS logs. - Added Logs class to handle REST routes and data retrieval. - Created UI components for displaying logs, including LogDetailDialog and StatusBadge. - Implemented hooks for managing logs data and filters. - Updated database schema to include notification context, message, and response fields. - Registered new routes in the application for accessing logs. - Enhanced SmsStat model to support new fields and methods for logs. - Added migration scripts for database updates related to logs. * Add migration notices and REST endpoints Wire up wp-kit migration + admin-notice integration: register MigrationRESTController and NoticeRESTController under texty/v1, add a NoticeProvider (includes AJAX handler 'texty_run_migration') that surfaces a non-dismissible "Update database" admin notice, and register MigrationHooks to keep db_version in sync. Add a Notices React component and render it in AppLayout; expose rest_url, ajax_url and nonce in the localized script and update the Texty global TS types. Instantiate the migrations bootstrap during plugin init via a migrations() accessor (migrations are not auto-applied on boot; users must click the admin notice to trigger the upgrade). Error handling/logging retained for upgrade failures. * feat: update default logs perPage to 30 for improved data display * feat: log full notification context to SmsStat on send Every `texty_after_send_sms` event now writes the new columns added in the 2.0.0 migration (notification_id, notification_group, message, response) so live rows match the structure the SMS Logs UI and the seeder produce. - Notifications registry gains a small set_active/get_active/clear_active stash. Notification::send and WC\\Base::send wrap their gateway send loop in set_active() + try/finally + clear_active() so the after-send hook can read which notification fired the SMS without threading context through the gateway pipeline. - Dispatcher::log_sms reads the active notification, pulls get_id() / get_group(), and persists them alongside the final message body. The response column gets a normalized shape via encode_response(): WP_Error is unpacked into {code, message, data}; arrays/objects pass through. - Plivo's message_uuid (which the SDK returns as ["uuid"]) is now flattened to its first element so reference_id stays scalar. - log_sms bails early if DataLayerFactory::make_store returns null, preventing a fatal when the store isn't initialized. * refactor(migrations): delegate V_2_0_0 schema sync to Install::create_tables * feat(Menu): update submenu path handling to support external URLs * feat: update API class registration and enhance version handling in Header component * fix: restore parent signature compat for WC\Base::send() Notification::send() declares ': bool' return type, but WC\Base overrode it with no return type and bare 'return;' on early exits, producing a fatal at autoload time. Align the override to ': bool' and return true/false in each path. Also restore a missing '/**' docblock opener above migrations() in texty.php that slipped through the merge resolution and caused a parse error. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: SHAMIM <111671483+Shamim-97@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: SHAMIM <111671483+Shamim-97@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: SHAMIM <111671483+Shamim-97@users.noreply.github.com> Co-authored-by: Md Mahbub Rabbani <mahbub.rucse@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Copilot <copilot@github.com>
- Changed the dependency for @wedevs/plugin-ui from a local file reference to a GitHub repository. - Removed the pot2json script from package.json as it is no longer needed. - Cleaned up the dependencies by removing the po2json package.
* feat: add Playwright end-to-end testing setup with configuration and initial tests * feat: add TypeScript configuration for tests and update dependencies * refactor: remove old notifications, settings, tools, and settings page components * Add Playwright e2e tests for Texty admin Add a suite of Playwright end-to-end tests for the Texty admin SPA and REST API: dashboard, gateway, logs, notifications, routing, and REST API smoke tests. Introduce test helpers (tests/e2e/helpers/texty.ts) for navigating hash routes, waiting for API responses and obtaining REST nonces. Update playwright.config.ts to disable fullyParallel, set workers to 2 and enable ignoreHTTPSErrors to improve stability in CI/local runs. Improve tests/e2e/texty-admin.spec.ts to capture console/page errors during SPA mount and provide clearer failure logging. * style: improve CSS resets and clean up LogDetailDialog component * ci: skip deleted and non-PHP files in phpcs workflow Filter PR file list to existing *.php files before invoking phpcs. Prevents "file does not exist" errors when a PR deletes files and the resulting empty checkstyle output breaks cs2pr XML parsing.
…plugin dependency
…GroupSettings component
…d SMS logs, expanded REST API, and compliance controls
…ast notifications and notification settings schema
… phone number handling in UI components
…in gateway classes; enhance log date formatting in UI
- Implemented e2e tests for REST gateway connection and lifecycle, validating Twilio and Clickatell integrations. - Created tests for logs export functionality, ensuring CSV format and authentication checks. - Added contract tests for logs and metrics endpoints, verifying response structure and filtering capabilities. - Developed tests for notification settings, ensuring proper round-trip functionality and data sanitization. - Implemented UI tests for dashboard, gateway, logs, and notifications, validating user interactions and visibility of elements.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (29)
📝 WalkthroughWalkthroughAdds a complete Playwright E2E test suite for the Texty SMS WordPress plugin. Includes a GitHub Actions workflow with a WordPress version matrix, a shared helper client, global auth setup with interstitial handling, REST contract specs for all ChangesTexty Playwright E2E suite
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… local Docker env vars - Add the list reporter so each test result streams to the terminal live; previously only the html reporter ran, leaving the console near-silent. - Add the github reporter under CI for inline PR annotations. - Read BASE_URL/HEADLESS (local Docker .env) with WP_BASE_URL fallback so local runs and the CI workflow both work. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
get_items() called $item->get_product()->get_name() directly, but get_product() returns false for line items whose product has since been deleted, throwing "Call to a member function get_name() on false" and aborting the woocommerce_order_status_changed hook — so no order SMS (admin or customer) was sent for affected orders. Fall back to the line-item name stored on the order when the product is unavailable.
Logs::get_item() passed an int to BaseDataStore::read(), whose signature is read( ModelInterface &$model ) — a TypeError fataling (HTTP 500) on every single-log request. read() also throws on not-found rather than returning false, so the intended 404 branch was unreachable. Query by the id column instead: it returns the same raw row shape present_row() already consumes for the listing, and an empty set (not an exception) on not-found, restoring the 404 path.
The CI run failed 6 Playwright tests that pass locally only because the
dev site already has state. On a fresh wp-env there is no active gateway
(so the dashboard renders its connect-a-gateway state instead of the stat
cards / quick-send card) and the logs table is empty, and WP shows the
Appsero opt-in admin notice whose <p class="description"> ("…environment
details…") satisfied broad page-wide getByText locators with a hidden node.
- e2e.yml: after wp-env start, seed the WP_DEBUG-only, credential-less
`fake` gateway and one log row via the real send pipeline so the
data-dependent UI specs run against a configured install. Also rewrite
GitHub SSH git URLs to HTTPS before npm ci (defensive; the @wedevs/
plugin-ui dep is pinned to git+ssh in the lockfile).
- logs.spec.ts / ui-logs.spec.ts: scope the table/empty-state and status
filter locators to #texty-app so WP-admin chrome can't match them, and
assert the real empty copy ("No logs yet") and column labels.
Verified against a fresh wp-env (WordPress latest): 125 passed, 2 skipped.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary by CodeRabbit
Tests
Documentation
Chores