@rimori/playwright-testing 0.3.8 → 0.3.9-next.1
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Page, Request } from '@playwright/test';
|
|
2
2
|
import { UserInfo } from '@rimori/client';
|
|
3
|
-
import { MainPanelAction, Plugin } from '@rimori/client';
|
|
3
|
+
import { MainPanelAction, Plugin, SidebarAction } from '@rimori/client';
|
|
4
4
|
import { PluginSettings } from './SettingsStateManager';
|
|
5
5
|
import { EventPayload } from '@rimori/client';
|
|
6
6
|
import { LanguageLevel } from '@rimori/client';
|
|
@@ -215,9 +215,9 @@ export declare class RimoriTestEnvironment {
|
|
|
215
215
|
/**
|
|
216
216
|
* Triggers a side panel action event as the parent application would.
|
|
217
217
|
* This simulates how rimori-main's SidebarPluginHandler responds to plugin's 'action.requestSidebar' events.
|
|
218
|
-
* @param payload - The action payload containing
|
|
218
|
+
* @param payload - The action payload containing text, action key, and optional args
|
|
219
219
|
*/
|
|
220
|
-
triggerOnSidePanelAction: (payload:
|
|
220
|
+
triggerOnSidePanelAction: (payload: SidebarAction) => Promise<void>;
|
|
221
221
|
/**
|
|
222
222
|
* Triggers a main panel action event as the parent application would.
|
|
223
223
|
* This simulates how rimori-main's MainPluginHandler uses EventBus.respond to respond
|
|
@@ -160,7 +160,7 @@ class RimoriTestEnvironment {
|
|
|
160
160
|
/**
|
|
161
161
|
* Triggers a side panel action event as the parent application would.
|
|
162
162
|
* This simulates how rimori-main's SidebarPluginHandler responds to plugin's 'action.requestSidebar' events.
|
|
163
|
-
* @param payload - The action payload containing
|
|
163
|
+
* @param payload - The action payload containing text, action key, and optional args
|
|
164
164
|
*/
|
|
165
165
|
triggerOnSidePanelAction: async (payload) => {
|
|
166
166
|
if (!this.messageChannelSimulator) {
|
|
@@ -56,7 +56,7 @@ async function completeOnboarding(page, onboarding, e2ePluginId) {
|
|
|
56
56
|
await (0, test_1.expect)(page.getByRole('heading', { name: 'Almost there!' })).toBeVisible({ timeout: 10000 });
|
|
57
57
|
await page.waitForURL('**/dashboard', { timeout: 120000 });
|
|
58
58
|
await (0, test_1.expect)(page.getByRole('heading', { name: "Today's Mission" })).toBeVisible({ timeout: 30000 });
|
|
59
|
-
await (0, test_1.expect)(page.getByRole('
|
|
59
|
+
await (0, test_1.expect)(page.getByRole('link', { name: 'Grammar', exact: true })).toBeVisible({ timeout: 60000 });
|
|
60
60
|
await (0, test_1.expect)(page.getByRole('heading', { name: 'Getting Started: Create your first study plan' })).toBeVisible({
|
|
61
61
|
timeout: 60000,
|
|
62
62
|
});
|
|
@@ -67,8 +67,6 @@ test_1.test.describe('Demo Plugin', () => {
|
|
|
67
67
|
(0, test_1.test)('translates via side panel action event', async ({ page }) => {
|
|
68
68
|
// Set up the listener BEFORE navigating so it's ready when the plugin calls onSidePanelAction
|
|
69
69
|
await env.event.triggerOnSidePanelAction({
|
|
70
|
-
plugin_id: pluginId,
|
|
71
|
-
action_key: 'translate',
|
|
72
70
|
action: 'translate',
|
|
73
71
|
text: 'tree',
|
|
74
72
|
});
|
|
@@ -82,8 +80,6 @@ test_1.test.describe('Demo Plugin', () => {
|
|
|
82
80
|
(0, test_1.test)('translates and resets the translator', async ({ page }) => {
|
|
83
81
|
// Set up the listener BEFORE navigating so it's ready when the plugin calls onSidePanelAction
|
|
84
82
|
await env.event.triggerOnSidePanelAction({
|
|
85
|
-
plugin_id: pluginId,
|
|
86
|
-
action_key: 'translate',
|
|
87
83
|
action: 'translate',
|
|
88
84
|
text: 'tree',
|
|
89
85
|
});
|
|
@@ -105,8 +101,6 @@ test_1.test.describe('Demo Plugin', () => {
|
|
|
105
101
|
await env.ai.mockGetSteamedText('This is a tree in Swedish: träd. It is an ett word.');
|
|
106
102
|
// Set up the listener BEFORE navigating so it's ready when the plugin calls onSidePanelAction
|
|
107
103
|
await env.event.triggerOnSidePanelAction({
|
|
108
|
-
plugin_id: pluginId,
|
|
109
|
-
action_key: 'translate',
|
|
110
104
|
action: 'translate',
|
|
111
105
|
text: 'tree',
|
|
112
106
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimori/playwright-testing",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9-next.1",
|
|
4
4
|
"description": "Playwright testing utilities for Rimori plugins and workers",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@playwright/test": "^1.40.0",
|
|
29
|
-
"@rimori/client": "
|
|
29
|
+
"@rimori/client": "2.5.17-next.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@playwright/test": "^1.40.0",
|
|
33
|
-
"@rimori/client": "
|
|
33
|
+
"@rimori/client": "2.5.17-next.0",
|
|
34
34
|
"@types/node": "^20.12.7",
|
|
35
35
|
"rimraf": "^5.0.7",
|
|
36
36
|
"typescript": "^5.7.2"
|