@rimori/playwright-testing 0.3.33 → 0.3.34
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/dist/core/RimoriE2ETestEnvironment.js +2 -2
- package/dist/harness/dist2.js +1 -1
- package/dist/harness/dist3.js +4 -4
- package/dist/harness/hostInit.js +1 -1
- package/dist/harness/localSharedImportMap.js +1 -1
- package/dist/helpers/e2e/onboarding.d.ts +7 -10
- package/dist/helpers/e2e/onboarding.js +42 -47
- package/package.json +3 -1
|
@@ -2,18 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.completeOnboarding = completeOnboarding;
|
|
4
4
|
const test_1 = require("@playwright/test");
|
|
5
|
+
// Maps a learning-reason key to the option label rendered by the studyplan
|
|
6
|
+
// goal-discovery MotivationStep (plugins/studyplan goal-discovery).
|
|
5
7
|
const learningReasonMap = {
|
|
6
|
-
work: 'For
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
citizenship: 'For citizenship or residency',
|
|
14
|
-
other: 'Other reason',
|
|
15
|
-
speaking: 'What is your main motivation to learn Swedish?',
|
|
8
|
+
work: 'For work',
|
|
9
|
+
friends: 'To connect with people',
|
|
10
|
+
study: 'For studies',
|
|
11
|
+
living: 'I live here',
|
|
12
|
+
culture: 'Love the culture',
|
|
13
|
+
growth: 'Personal growth',
|
|
14
|
+
other: 'Something else',
|
|
16
15
|
};
|
|
16
|
+
// Walks "onboarding 2.0": the rimori-main IntroStep ("Start the journey")
|
|
17
|
+
// followed by the studyplan goal-discovery flow, which is rendered inline via
|
|
18
|
+
// module federation on the same /onboarding route (NOT an iframe). MeetBuddy
|
|
19
|
+
// generates the plan with real AI before "Start learning" becomes clickable.
|
|
17
20
|
async function completeOnboarding(page, onboarding, e2ePluginId) {
|
|
18
21
|
console.log(`[E2E] Onboarding user`);
|
|
19
22
|
console.log(`[E2E] E2E plugin ID: ${e2ePluginId}`);
|
|
@@ -28,44 +31,36 @@ async function completeOnboarding(page, onboarding, e2ePluginId) {
|
|
|
28
31
|
console.log('[E2E] User already onboarded, skipping onboarding steps');
|
|
29
32
|
return;
|
|
30
33
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
await
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
await page.
|
|
38
|
-
|
|
39
|
-
await (0, test_1.expect)(
|
|
40
|
-
await
|
|
41
|
-
await interestsTextarea.fill(onboarding.interests);
|
|
42
|
-
await page.waitForTimeout(1000);
|
|
43
|
-
const interestsContinue = page.getByRole('button', { name: /continue/i });
|
|
44
|
-
await (0, test_1.expect)(interestsContinue).toBeEnabled({ timeout: 10000 });
|
|
45
|
-
await interestsContinue.click();
|
|
46
|
-
// Step 3: Location
|
|
47
|
-
const countrySelect = page.getByLabel('Country');
|
|
48
|
-
await (0, test_1.expect)(countrySelect).toBeVisible({ timeout: 10000 });
|
|
49
|
-
await countrySelect.selectOption(onboarding.target_country);
|
|
50
|
-
await page.getByLabel('City (optional)').selectOption(onboarding.target_city);
|
|
34
|
+
// Step 0: Intro — single CTA that saves defaults and swaps to goal-discovery.
|
|
35
|
+
const startJourney = page.getByRole('button', { name: 'Start the journey' });
|
|
36
|
+
await (0, test_1.expect)(startJourney).toBeVisible({ timeout: 10000 });
|
|
37
|
+
await startJourney.click();
|
|
38
|
+
// Step 1: Motivation (radio select, auto-advances after selection)
|
|
39
|
+
await (0, test_1.expect)(page.getByText('Why are you learning Swedish?')).toBeVisible({ timeout: 30000 });
|
|
40
|
+
await page.getByText(learningReasonMap[onboarding.learning_reason]).click();
|
|
41
|
+
// Step 2: Profession (textarea + continue)
|
|
42
|
+
await (0, test_1.expect)(page.getByText('What is your profession or career goal?')).toBeVisible({ timeout: 10000 });
|
|
43
|
+
await page.getByPlaceholder(/sports teacher/i).fill(onboarding.profession);
|
|
51
44
|
await page.getByRole('button', { name: 'Continue' }).click();
|
|
52
|
-
// Step
|
|
53
|
-
|
|
54
|
-
await page.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
await
|
|
61
|
-
|
|
62
|
-
await
|
|
45
|
+
// Step 3: Certificate (auto-advances) — pick "not aiming for a certificate"
|
|
46
|
+
await (0, test_1.expect)(page.getByText('Are you preparing for a Swedish certificate?')).toBeVisible({ timeout: 10000 });
|
|
47
|
+
await page.getByRole('button', { name: "I'm not aiming for a certificate" }).click();
|
|
48
|
+
// Step 4: Interests (textarea + continue)
|
|
49
|
+
await (0, test_1.expect)(page.getByText('What are your interests?')).toBeVisible({ timeout: 10000 });
|
|
50
|
+
await page.getByPlaceholder(/cooking/i).fill(onboarding.interests);
|
|
51
|
+
await page.getByRole('button', { name: 'Continue' }).click();
|
|
52
|
+
// Step 5: Proud of (textarea + continue)
|
|
53
|
+
await (0, test_1.expect)(page.getByText('What do you want to be proud of in 3 months?')).toBeVisible({ timeout: 10000 });
|
|
54
|
+
await page.getByPlaceholder(/Swedish colleagues/i).fill(onboarding.proud_of);
|
|
55
|
+
await page.getByRole('button', { name: 'Continue' }).click();
|
|
56
|
+
// Step 6: Time commitment — defaults are valid, just continue
|
|
57
|
+
await (0, test_1.expect)(page.getByText('How much time do you want to invest')).toBeVisible({ timeout: 10000 });
|
|
58
|
+
await page.getByRole('button', { name: 'Continue' }).click();
|
|
59
|
+
// Step 7: Meet buddy — wait out real AI plan generation, then start learning.
|
|
60
|
+
const startLearning = page.getByRole('button', { name: 'Start learning' });
|
|
61
|
+
await (0, test_1.expect)(startLearning).toBeEnabled({ timeout: 240000 });
|
|
62
|
+
await startLearning.click();
|
|
63
|
+
// Completion: triggerComplete marks onboarding done and hard-redirects to /dashboard.
|
|
63
64
|
await page.waitForURL('**/dashboard', { timeout: 120000 });
|
|
64
65
|
await (0, test_1.expect)(page.getByRole('heading', { name: "Today's Mission" })).toBeVisible({ timeout: 30000 });
|
|
65
|
-
//navbar should get shown
|
|
66
|
-
await (0, test_1.expect)(page.getByRole('link', { name: 'Grammar', exact: true })).toBeVisible({ timeout: 60000 });
|
|
67
|
-
//support sidepanel should be open
|
|
68
|
-
await (0, test_1.expect)(page.locator('#sidebar').getByText('Getting Started', { exact: true })).toBeVisible({
|
|
69
|
-
timeout: 250000,
|
|
70
|
-
});
|
|
71
66
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimori/playwright-testing",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.34",
|
|
4
4
|
"description": "Playwright testing utilities for Rimori plugins and workers",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -30,10 +30,12 @@
|
|
|
30
30
|
"@types/react-dom": "^19.0.0",
|
|
31
31
|
"@vitejs/plugin-react": "^6.0.0",
|
|
32
32
|
"eslint": "^10.0.0",
|
|
33
|
+
"globals": "^16.4.0",
|
|
33
34
|
"react": "^19.1.0",
|
|
34
35
|
"react-dom": "^19.1.0",
|
|
35
36
|
"rimraf": "^5.0.7",
|
|
36
37
|
"typescript": "^5.7.2",
|
|
38
|
+
"typescript-eslint": "^8.46.0",
|
|
37
39
|
"vite": "^8.0.0",
|
|
38
40
|
"zod": "^3.23.8"
|
|
39
41
|
},
|