@rimori/playwright-testing 0.3.15 → 0.3.16-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.
|
@@ -138,6 +138,8 @@ class RimoriE2ETestEnvironment {
|
|
|
138
138
|
return;
|
|
139
139
|
if (logMessage.includes('i18next is maintained'))
|
|
140
140
|
return;
|
|
141
|
+
if (logMessage.includes('i18next is made possible'))
|
|
142
|
+
return;
|
|
141
143
|
console.log(`[browser:${logLevel}] [${user}]`, logMessage);
|
|
142
144
|
});
|
|
143
145
|
}
|
|
@@ -567,9 +567,8 @@ class RimoriTestEnvironment {
|
|
|
567
567
|
this.page.route(`${pluginUrl}/locales/**`, async (route) => {
|
|
568
568
|
const request = route.request();
|
|
569
569
|
const url = new URL(request.url());
|
|
570
|
-
const devServerUrl = `http://${url.host}
|
|
570
|
+
const devServerUrl = `http://${url.host}${url.pathname}`;
|
|
571
571
|
// console.log('Fetching locales from: ' + devServerUrl);
|
|
572
|
-
// throw new Error('Test: ' + devServerUrl);
|
|
573
572
|
try {
|
|
574
573
|
// Fetch from the dev server
|
|
575
574
|
const response = await fetch(devServerUrl);
|
|
@@ -616,10 +615,6 @@ class RimoriTestEnvironment {
|
|
|
616
615
|
// These are registered AFTER any test-level mocks so they act as low-priority fallbacks.
|
|
617
616
|
// POST /ai/session — required by event.request() and any AI call (session.ensure())
|
|
618
617
|
this.addBackendRoute('/ai/session', { session_token_id: 'test-session-token' }, { method: 'POST' });
|
|
619
|
-
// POST /ai/llm — fallback empty stream for Avatar conversations and other background AI calls
|
|
620
|
-
this.addBackendRoute('/ai/llm', '', { method: 'POST', isStreaming: true });
|
|
621
|
-
// POST /voice/tts — fallback empty response for AudioPlayer (test env has no real audio)
|
|
622
|
-
this.addBackendRoute('/voice/tts', {}, { method: 'POST' });
|
|
623
618
|
// POST /knowledge/for-topic — fallback for daily-plan knowledge lookups
|
|
624
619
|
this.addBackendRoute('/knowledge/for-topic', { id: 'test-knowledge-id' }, { method: 'POST' });
|
|
625
620
|
// Initialize MessageChannelSimulator to simulate parent-iframe communication
|
|
@@ -33,8 +33,6 @@ export declare class SettingsStateManager {
|
|
|
33
33
|
/**
|
|
34
34
|
* Manually set settings (useful for test setup).
|
|
35
35
|
* Accepts either a full PluginSettings row (with `id`, `plugin_id`, `settings`, etc.)
|
|
36
|
-
* or a plain inner-settings object (e.g. `{ skillAssessmentCompletedAt: '...' }`).
|
|
37
|
-
* If an inner-settings object is detected it is automatically wrapped in the proper row structure.
|
|
38
36
|
*/
|
|
39
37
|
setSettings(settings: PluginSettings | null): void;
|
|
40
38
|
/**
|
|
@@ -61,32 +61,9 @@ class SettingsStateManager {
|
|
|
61
61
|
/**
|
|
62
62
|
* Manually set settings (useful for test setup).
|
|
63
63
|
* Accepts either a full PluginSettings row (with `id`, `plugin_id`, `settings`, etc.)
|
|
64
|
-
* or a plain inner-settings object (e.g. `{ skillAssessmentCompletedAt: '...' }`).
|
|
65
|
-
* If an inner-settings object is detected it is automatically wrapped in the proper row structure.
|
|
66
64
|
*/
|
|
67
65
|
setSettings(settings) {
|
|
68
|
-
|
|
69
|
-
this.settings = null;
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
// Detect a full PluginSettings row vs a plain inner-settings object.
|
|
73
|
-
// A full row has at least one of these known structural keys.
|
|
74
|
-
const isFullRow = 'id' in settings ||
|
|
75
|
-
'plugin_id' in settings ||
|
|
76
|
-
'guild_id' in settings ||
|
|
77
|
-
'settings' in settings ||
|
|
78
|
-
'is_guild_setting' in settings ||
|
|
79
|
-
'user_id' in settings;
|
|
80
|
-
if (isFullRow) {
|
|
81
|
-
this.settings = settings;
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
// Treat as inner settings — wrap in the existing row structure
|
|
85
|
-
this.settings = {
|
|
86
|
-
...(this.settings ?? {}),
|
|
87
|
-
settings: settings,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
66
|
+
this.settings = settings;
|
|
90
67
|
}
|
|
91
68
|
/**
|
|
92
69
|
* Check if settings exist
|
|
@@ -35,8 +35,23 @@ async function createExerciseViaDialog(page, exercise) {
|
|
|
35
35
|
const descInput = dialog.locator('textarea#exercise-description');
|
|
36
36
|
await descInput.fill(exercise.description);
|
|
37
37
|
}
|
|
38
|
-
//
|
|
39
|
-
|
|
38
|
+
// Explicitly set dates using local timezone to avoid UTC date drift in the deployed rimori-main
|
|
39
|
+
// (rimori-main initialises dates with toISOString() which returns UTC, causing "Next" to be
|
|
40
|
+
// disabled when the local clock is past UTC midnight but the UTC date is still "yesterday").
|
|
41
|
+
const localDateStr = (d) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
|
|
42
|
+
const todayStr = localDateStr(new Date());
|
|
43
|
+
const weekLaterStr = localDateStr(new Date(Date.now() + 7 * 24 * 60 * 60 * 1000));
|
|
44
|
+
const startDateInput = dialog.locator('input#start-date');
|
|
45
|
+
if (await startDateInput.count() > 0) {
|
|
46
|
+
await startDateInput.fill(todayStr);
|
|
47
|
+
}
|
|
48
|
+
const endDateInput = dialog.locator('input#end-date');
|
|
49
|
+
if (await endDateInput.count() > 0) {
|
|
50
|
+
await endDateInput.fill(weekLaterStr);
|
|
51
|
+
}
|
|
52
|
+
const nextBtn = dialog.getByRole('button', { name: 'Next' });
|
|
53
|
+
await (0, test_1.expect)(nextBtn).toBeEnabled({ timeout: 5000 });
|
|
54
|
+
await nextBtn.click();
|
|
40
55
|
// Step 3: Fill in action parameters
|
|
41
56
|
if (exercise.parameters) {
|
|
42
57
|
for (const [key, value] of Object.entries(exercise.parameters)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimori/playwright-testing",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.16-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.22-next.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@playwright/test": "^1.40.0",
|
|
33
|
-
"@rimori/client": "
|
|
33
|
+
"@rimori/client": "2.5.22-next.0",
|
|
34
34
|
"@types/node": "^20.12.7",
|
|
35
35
|
"rimraf": "^5.0.7",
|
|
36
36
|
"typescript": "^5.7.2"
|