Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Add welcome tutorial (#2413)

Leendert de Borst12d0f6fef225
diff --git a/apps/web/playwright.config.ts b/apps/web/playwright.config.ts
index d30b38313..7ef2d2466 100644
--- a/apps/web/playwright.config.ts
+++ b/apps/web/playwright.config.ts
@@ -22,8 +22,10 @@ export default defineConfig({
// Checks the API is reachable and applies the test server settings.
globalSetup: './tests/global-setup.ts',
- // Every test registers its own account, so all tests run in parallel, also within a file except
- // when a test file is marked as serial explicitly.
+ /*
+ * Every test registers its own account, so all tests run in parallel, also within a file except
+ * when a test file is marked as serial explicitly.
+ */
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx
index edf345c45..972216791 100644
--- a/apps/web/src/App.tsx
+++ b/apps/web/src/App.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom';
+import { BrowserRouter, Route, Routes } from 'react-router-dom';
import AuthLayout from '@/layouts/AuthLayout';
import MainLayout from '@/layouts/MainLayout';
@@ -27,6 +27,7 @@ import Enable2Fa from '@/pages/settings/security/Enable2Fa';
import SecuritySettings from '@/pages/settings/security/Security';
import StorageInsights from '@/pages/settings/StorageInsights';
import Sync from '@/pages/sync/Sync';
+import Welcome from '@/pages/Welcome';
/**
* The route table.
@@ -58,7 +59,7 @@ const App: React.FC = () => (
<Route path="/items/:manifestId/:id/edit" element={<ItemAddEdit />} />
<Route path="/items/:manifestId/:id" element={<ItemView />} />
<Route path="/emails" element={<EmailsHome />} />
- <Route path="/welcome" element={<Navigate to="/items" replace />} />
+ <Route path="/welcome" element={<Welcome />} />
<Route path="/settings/general" element={<GeneralSettings />} />
<Route path="/settings/security" element={<SecuritySettings />} />
<Route path="/settings/security/change-password" element={<ChangePassword />} />
diff --git a/apps/web/src/components/settings/importexport/ImportServiceCard.tsx b/apps/web/src/components/settings/importexport/ImportServiceCard.tsx
index b9de46f54..802615da1 100644
--- a/apps/web/src/components/settings/importexport/ImportServiceCard.tsx
+++ b/apps/web/src/components/settings/importexport/ImportServiceCard.tsx
@@ -594,7 +594,7 @@ const ImportServiceCard: React.FC<ImportServiceCardProps> = ({ serviceName, desc
<p className="text-xs text-orange-800 dark:text-orange-200">{t(`${tk}.DecryptionPasswordHint`)}</p>
</div>
<div className="flex justify-end mt-6 space-x-2">
- <Button onClick={handlePreviousStep} color="secondary">{t(`${tk}.BackButton`)}</Button>
+ <Button onClick={handlePreviousStep} color="secondary" arrow="back">{t(`${tk}.BackButton`)}</Button>
<Button onClick={() => void handleDecryptFile()} color="primary" isDisabled={decryptionPassword.trim().length === 0}>{t(`${tk}.DecryptAndContinueButton`)}</Button>
</div>
</>
@@ -699,8 +699,8 @@ const ImportServiceCard: React.FC<ImportServiceCardProps> = ({ serviceName, desc
</div>
)}
<div className="flex justify-end mt-6 space-x-2">
- <Button onClick={handlePreviousStep} color="secondary">{t(`${tk}.BackButton`)}</Button>
- {importedCredentials.length > 0 && <Button onClick={handleNextStep} color="primary">{t(`${tk}.NextButton`)}</Button>}
+ <Button onClick={handlePreviousStep} color="secondary" arrow="back">{t(`${tk}.BackButton`)}</Button>
+ {importedCredentials.length > 0 && <Button onClick={handleNextStep} color="primary" arrow="forward">{t(`${tk}.NextButton`)}</Button>}
</div>
</>
);
@@ -743,7 +743,7 @@ const ImportServiceCard: React.FC<ImportServiceCardProps> = ({ serviceName, desc
)}
</div>
<div className="flex justify-end mt-6 space-x-2">
- <Button onClick={handlePreviousStep} color="secondary">{t(`${tk}.BackButton`)}</Button>
+ <Button onClick={handlePreviousStep} color="secondary" arrow="back">{t(`${tk}.BackButton`)}</Button>
<Button onClick={() => void handleModalConfirm()} color="primary">{t(`${tk}.ImportButton`)}</Button>
</div>
</>
diff --git a/apps/web/src/components/shared/Button.tsx b/apps/web/src/components/shared/Button.tsx
index d84dca77f..d7e506867 100644
--- a/apps/web/src/components/shared/Button.tsx
+++ b/apps/web/src/components/shared/Button.tsx
@@ -3,6 +3,9 @@ import React from 'react';
/** Button colors. */
export type ButtonColor = 'primary' | 'secondary' | 'danger' | 'success';
+/** Direction of the arrow a button can show: forward after the label, back before it. */
+export type ButtonArrowDirection = 'forward' | 'back';
+
type ButtonProps = {
children: React.ReactNode;
onClick?: () => void;
@@ -12,6 +15,7 @@ type ButtonProps = {
additionalClasses?: string;
display?: 'inline' | 'flex';
id?: string;
+ arrow?: ButtonArrowDirection;
};
/** Base classes shared by every button-styled element. */
@@ -35,15 +39,40 @@ export const getButtonColorClasses = (color: ButtonColor): string => {
}
};
+/**
+ * A small arrow icon for a button that moves through a process.
+ */
+export const ButtonArrow: React.FC<{ direction: ButtonArrowDirection }> = ({ direction }) => (
+ <svg className="w-4 h-4 flex-shrink-0 opacity-80" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d={direction === 'forward' ? 'M14 5l7 7m0 0l-7 7m7-7H3' : 'M10 19l-7-7m0 0l7-7m-7 7h18'} />
+ </svg>
+);
+
+/**
+ * Button label with an optional arrow, forward after the label and back before it.
+ */
+export const ButtonLabel: React.FC<{ children: React.ReactNode; arrow?: ButtonArrowDirection }> = ({ children, arrow }) => {
+ if (!arrow) {
+ return <>{children}</>;
+ }
+ return (
+ <span className="inline-flex items-center justify-center gap-2">
+ {arrow === 'back' && <ButtonArrow direction="back" />}
+ <span>{children}</span>
+ {arrow === 'forward' && <ButtonArrow direction="forward" />}
+ </span>
+ );
+};
+
/**
* Generic button.
*/
-const Button: React.FC<ButtonProps> = ({ children, onClick, isDisabled = false, type = 'button', color = 'primary', additionalClasses = '', display = 'inline', id }) => {
+const Button: React.FC<ButtonProps> = ({ children, onClick, isDisabled = false, type = 'button', color = 'primary', additionalClasses = '', display = 'inline', id, arrow }) => {
const classes = `${display} ${BUTTON_BASE_CLASSES} ${getButtonColorClasses(color)} ${isDisabled ? DISABLED_CLASSES : ''} ${additionalClasses}`.trim();
return (
<button type={type} id={id} onClick={isDisabled ? undefined : onClick} disabled={isDisabled} className={classes}>
- {children}
+ <ButtonLabel arrow={arrow}>{children}</ButtonLabel>
</button>
);
};
diff --git a/apps/web/src/pages/Welcome.tsx b/apps/web/src/pages/Welcome.tsx
new file mode 100644
index 000000000..4c8ef9588
--- /dev/null
+++ b/apps/web/src/pages/Welcome.tsx
@@ -0,0 +1,187 @@
+import React, { useEffect, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import { useNavigate } from 'react-router-dom';
+
+import { ButtonLabel } from '@/components/shared/Button';
+import { useDb } from '@/context/DbContext';
+import { useLoading } from '@/context/LoadingContext';
+import { usePageTitle } from '@/hooks/usePageTitle';
+import { useVaultMutate } from '@/hooks/useVaultMutate';
+import { type AppInfo, BROWSER_EXTENSIONS, MOBILE_APPS } from '@/utils/AppDownloads';
+
+/** The tutorial steps, in order. */
+const STEPS = ['welcome', 'howAliasVaultWorks', 'tips', 'createFirstIdentity'] as const;
+type TutorialStep = typeof STEPS[number];
+
+/**
+ * A download tile for one browser extension or mobile app.
+ */
+const AppTile: React.FC<{ app: AppInfo; unavailableLabel: string }> = ({ app, unavailableLabel }) => (app.isAvailable ? (
+ <a href={app.downloadUrl} target="_blank" rel="noreferrer" className="flex flex-col items-center p-3 rounded-lg bg-gray-200 dark:bg-gray-600 hover:bg-gray-300 dark:hover:bg-gray-500 transition-colors">
+ <img src={app.iconPath} alt={app.name} className="w-8 h-8 mb-2" />
+ <span className="text-xs text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300">{app.name}</span>
+ </a>
+) : (
+ <div className="flex flex-col items-center p-3 rounded-lg bg-gray-200 dark:bg-gray-600">
+ <img src={app.iconPath} alt={app.name} className="w-8 h-8 mb-2 opacity-50" />
+ <span className="text-xs text-gray-500 dark:text-gray-400">{unavailableLabel}</span>
+ </div>
+));
+
+/**
+ * The tutorial shown to a new user with an empty vault, right after creating the account.
+ */
+const Welcome: React.FC = () => {
+ const { t } = useTranslation();
+ const navigate = useNavigate();
+ const dbContext = useDb();
+ const { showLoading, hideLoading } = useLoading();
+ const { executeVaultMutationInBackground } = useVaultMutate();
+ const tk = 'pages.main.welcome';
+ usePageTitle(t(`${tk}.TutorialStepTitle`));
+
+ const [step, setStep] = useState<TutorialStep>('welcome');
+ const stepIndex = STEPS.indexOf(step);
+ const progressPercentage = Math.floor(stepIndex * 100 / (STEPS.length - 1));
+
+ useEffect(() => {
+ if (dbContext.sqliteClient?.settings.getSetting('TutorialDone', 'False').toLowerCase() === 'true') {
+ navigate('/', { replace: true });
+ }
+ }, [dbContext.sqliteClient, navigate]);
+
+ /**
+ * The title of a step.
+ */
+ const stepTitle = (): string => {
+ switch (step) {
+ case 'welcome': return t(`${tk}.WelcomeStepTitle`);
+ case 'howAliasVaultWorks': return t(`${tk}.HowAliasVaultWorksStepTitle`);
+ case 'tips': return t(`${tk}.TipsStepTitle`);
+ default: return t(`${tk}.GetStartedStepTitle`);
+ }
+ };
+
+ /**
+ * One step forward.
+ */
+ const goNext = (): void => {
+ setStep(STEPS[Math.min(stepIndex + 1, STEPS.length - 1)]);
+ window.scrollTo({ top: 0 });
+ };
+
+ /**
+ * Mark the tutorial as done in the vault and continue to the items page.
+ */
+ const finishTutorial = async (): Promise<void> => {
+ const client = dbContext.sqliteClient;
+ if (!client) {
+ return;
+ }
+ showLoading(t(`${tk}.FinishingTutorialMessage`));
+ try {
+ await executeVaultMutationInBackground(async () => {
+ client.settings.updateSetting('TutorialDone', 'True');
+ });
+ navigate('/items');
+ } catch (error) {
+ console.error('[Welcome] Failed to finish the tutorial:', error);
+ } finally {
+ hideLoading();
+ }
+ };
+
+ return (
+ <div className="bg-gray-100 dark:bg-gray-900 flex flex-col lg:items-center lg:justify-center pb-16">
+ <div className="w-full mt-4 lg:mt-16 mx-auto lg:max-w-4xl lg:bg-white lg:dark:bg-gray-800 lg:shadow-xl lg:rounded-lg lg:overflow-hidden flex flex-col">
+ <div className="flex flex-col flex-grow">
+ <div className="flex-grow p-6 pt-4 lg:pt-6 lg:pb-4">
+ <div className="flex justify-between items-center mb-4">
+ <div className="flex-grow text-center">
+ <h2 className="text-xl font-semibold text-gray-900 dark:text-white">{stepTitle()}</h2>
+ </div>
+ </div>
+
+ {progressPercentage > 0 && (
+ <div className="w-full bg-gray-200 rounded-full h-2.5 mb-4 dark:bg-gray-700 mt-4">
+ <div className="bg-primary-600 h-2.5 rounded-full" style={{ width: `${progressPercentage}%` }}></div>
+ </div>
+ )}
+
+ {step === 'welcome' && (
+ <div className="space-y-4">
+ <p className="flex items-start gap-2 text-gray-600 dark:text-gray-400">
+ <svg className="w-5 h-5 mt-0.5 flex-shrink-0 text-green-600 dark:text-green-400" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
+ <path fillRule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clipRule="evenodd" />
+ </svg>
+ <span>{t(`${tk}.WelcomeMessage`)}</span>
+ </p>
+ </div>
+ )}
+
+ {step === 'howAliasVaultWorks' && (
+ <div className="space-y-4">
+ <p className="text-gray-600 dark:text-gray-400">{t(`${tk}.HowItWorksIntro`)}</p>
+ <ol className="list-decimal list-inside space-y-2 text-gray-600 dark:text-gray-400">
+ <li>{t(`${tk}.HowItWorksStep1`)}</li>
+ <li>{t(`${tk}.HowItWorksStep2`)}</li>
+ <li>{t(`${tk}.HowItWorksStep3`)}</li>
+ <li>{t(`${tk}.HowItWorksStep4`)}</li>
+ </ol>
+ </div>
+ )}
+
+ {step === 'tips' && (
+ <div className="space-y-4">
+ <div className="space-y-3">
+ <div className="p-4 bg-gray-50 dark:bg-gray-700 rounded-lg">
+ <h4 className="font-semibold text-gray-900 dark:text-white">{t(`${tk}.MasterPasswordTipTitle`)}</h4>
+ <p className="text-gray-600 dark:text-gray-400">{t(`${tk}.MasterPasswordTipContent`)}</p>
+ </div>
+ <div className="p-4 bg-gray-50 dark:bg-gray-700 rounded-lg">
+ <h4 className="font-semibold text-gray-900 dark:text-white">{t(`${tk}.TwoFactorTipTitle`)}</h4>
+ <p className="text-gray-600 dark:text-gray-400">{t(`${tk}.TwoFactorTipContent`)}</p>
+ </div>
+ <div className="p-4 bg-gray-50 dark:bg-gray-700 rounded-lg">
+ <h4 className="font-semibold text-gray-900 dark:text-white">{t(`${tk}.ExtensionsAppsTipTitle`)}</h4>
+ <p className="text-gray-600 dark:text-gray-400 mb-4">{t(`${tk}.ExtensionsAppsTipContent`)}</p>
+ <div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 gap-3">
+ {BROWSER_EXTENSIONS.map(app => <AppTile key={app.name} app={app} unavailableLabel={t(`${tk}.ComingSoonLabel`)} />)}
+ {MOBILE_APPS.map(app => <AppTile key={app.name} app={app} unavailableLabel={`${app.name} ${t(`${tk}.SoonSuffix`)}`} />)}
+ </div>
+ </div>
+ </div>
+ </div>
+ )}
+
+ {step === 'createFirstIdentity' && (
+ <div className="space-y-4">
+ <h3 className="text-2xl font-bold text-gray-900 dark:text-white">{t(`${tk}.ReadyToStartTitle`)}</h3>
+ <p className="text-gray-600 dark:text-gray-400">{t(`${tk}.ReadyToStartMessage`)}</p>
+ <div className="mt-4">
+ <button type="button" onClick={() => navigate('/items/create')} className="w-full bg-primary-600 hover:bg-primary-700 text-white font-semibold py-3 px-4 rounded-lg transition duration-300">
+ {t(`${tk}.CreateFirstIdentityButton`)}
+ </button>
+ </div>
+ </div>
+ )}
+ </div>
+
+ <div className="fixed lg:relative bottom-0 left-0 right-0 p-4 bg-gray-100 dark:bg-gray-900 border-t border-gray-200 dark:border-gray-700 lg:bg-transparent lg:dark:bg-transparent lg:border-0">
+ {step !== 'tips' ? (
+ <button type="button" onClick={goNext} className="w-full py-3 px-4 bg-primary-600 hover:bg-primary-700 text-white font-semibold rounded-lg transition duration-300">
+ <ButtonLabel arrow="forward">{t(`${tk}.ContinueButton`)}</ButtonLabel>
+ </button>
+ ) : (
+ <button type="button" onClick={() => void finishTutorial()} className="w-full py-3 px-4 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-lg transition duration-300">
+ {t(`${tk}.GetStartedButton`)}
+ </button>
+ )}
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+};
+
+export default Welcome;
diff --git a/apps/web/src/pages/auth/Setup.tsx b/apps/web/src/pages/auth/Setup.tsx
index 818481bc1..8f248f1ca 100644
--- a/apps/web/src/pages/auth/Setup.tsx
+++ b/apps/web/src/pages/auth/Setup.tsx
@@ -4,6 +4,7 @@ import { useNavigate } from 'react-router-dom';
import LanguageSwitcher from '@/components/auth/LanguageSwitcher';
import { CreatingStep, PasswordStep, TermsAndConditionsStep, UsernameStep } from '@/components/auth/setup/SetupSteps';
+import { ButtonLabel } from '@/components/shared/Button';
import { getAppConfig } from '@/config/AppConfig';
import { usePageTitle } from '@/hooks/usePageTitle';
@@ -118,7 +119,7 @@ const Setup: React.FC = () => {
</button>
) : step !== 'creating' && (
<button type="button" onClick={goNext} disabled={!isNextEnabled} className={`w-full py-3 px-4 bg-primary-600 hover:bg-primary-700 text-white font-semibold rounded-lg transition duration-300 ease-in-out ${isNextEnabled ? '' : 'opacity-50 cursor-not-allowed'}`}>
- {t(`${tk}.ContinueButton`)}
+ <ButtonLabel arrow="forward">{t(`${tk}.ContinueButton`)}</ButtonLabel>
</button>
)}
</div>
diff --git a/apps/web/src/pages/items/Home.tsx b/apps/web/src/pages/items/Home.tsx
index 7f1f847d0..e63f1862c 100644
--- a/apps/web/src/pages/items/Home.tsx
+++ b/apps/web/src/pages/items/Home.tsx
@@ -139,6 +139,10 @@ const ItemsHome: React.FC = () => {
setVisibleItemCount(BATCH_SIZE);
try {
const vaultItems: Item[] = client.items.getAll();
+ if (vaultItems.length === 0 && !folderRef && client.settings.getSetting('TutorialDone', 'False').toLowerCase() !== 'true') {
+ navigate('/welcome');
+ return;
+ }
setItems(vaultItems.map(toItemListEntry));
setAllFolders(client.folders.getAll());
setRecentlyDeletedCount(client.items.getRecentlyDeletedCount());
@@ -153,7 +157,7 @@ const ItemsHome: React.FC = () => {
} finally {
setIsLoading(false);
}
- }, [dbContext.sqliteClient, notifications, syncTableSortWithSortOrder, t]);
+ }, [dbContext.sqliteClient, folderRef, navigate, notifications, syncTableSortWithSortOrder, t]);
useEffect(() => {
loadItems();
diff --git a/apps/web/src/pages/settings/Apps.tsx b/apps/web/src/pages/settings/Apps.tsx
index b0a4f60a5..38555a530 100644
--- a/apps/web/src/pages/settings/Apps.tsx
+++ b/apps/web/src/pages/settings/Apps.tsx
@@ -5,31 +5,7 @@ import Card from '@/components/shared/Card';
import PageContent from '@/components/shared/PageContent';
import PageHeader from '@/components/shared/PageHeader';
import { usePageTitle } from '@/hooks/usePageTitle';
-
-/**
- * A downloadable client (the shared BrowserExtensionInfo / MobileAppInfo).
- */
-type AppInfo = {
- name: string;
- iconPath: string;
- downloadUrl: string;
- isAvailable: boolean;
-};
-
-/** The browser extensions, in the order of the shared constants. */
-const BROWSER_EXTENSIONS: AppInfo[] = [
- { name: 'Google Chrome', iconPath: '/img/browser-icons/chrome.svg', downloadUrl: 'https://chromewebstore.google.com/detail/aliasvault/bmoggiinmnodjphdjnmpcnlleamkfedj', isAvailable: true },
- { name: 'Firefox', iconPath: '/img/browser-icons/firefox.svg', downloadUrl: 'https://addons.mozilla.org/en-US/firefox/addon/aliasvault/', isAvailable: true },
- { name: 'Safari', iconPath: '/img/browser-icons/safari.svg', downloadUrl: 'https://apps.apple.com/app/6743163173', isAvailable: true },
- { name: 'Microsoft Edge', iconPath: '/img/browser-icons/edge.svg', downloadUrl: 'https://microsoftedge.microsoft.com/addons/detail/aliasvault/kabaanafahnjkfkplbnllebdmppdemfo', isAvailable: true },
- { name: 'Brave', iconPath: '/img/browser-icons/brave.svg', downloadUrl: 'https://chromewebstore.google.com/detail/aliasvault/bmoggiinmnodjphdjnmpcnlleamkfedj', isAvailable: true },
-];
-
-/** The mobile apps. */
-const MOBILE_APPS: AppInfo[] = [
- { name: 'iOS', iconPath: '/img/mobile-icons/ios.svg', downloadUrl: 'https://apps.apple.com/app/id6745490915', isAvailable: true },
- { name: 'Android', iconPath: '/img/mobile-icons/android.svg', downloadUrl: 'https://play.google.com/store/apps/details?id=net.aliasvault.app', isAvailable: true },
-];
+import { type AppInfo, BROWSER_EXTENSIONS, MOBILE_APPS } from '@/utils/AppDownloads';
/**
* A row for one app with its install or download link.
diff --git a/apps/web/src/utils/AppDownloads.ts b/apps/web/src/utils/AppDownloads.ts
new file mode 100644
index 000000000..8bbaf8bcc
--- /dev/null
+++ b/apps/web/src/utils/AppDownloads.ts
@@ -0,0 +1,24 @@
+/**
+ * A downloadable client (the shared BrowserExtensionInfo / MobileAppInfo).
+ */
+export type AppInfo = {
+ name: string;
+ iconPath: string;
+ downloadUrl: string;
+ isAvailable: boolean;
+};
+
+/** The browser extensions, in the order of the shared constants. */
+export const BROWSER_EXTENSIONS: AppInfo[] = [
+ { name: 'Google Chrome', iconPath: '/img/browser-icons/chrome.svg', downloadUrl: 'https://chromewebstore.google.com/detail/aliasvault/bmoggiinmnodjphdjnmpcnlleamkfedj', isAvailable: true },
+ { name: 'Firefox', iconPath: '/img/browser-icons/firefox.svg', downloadUrl: 'https://addons.mozilla.org/en-US/firefox/addon/aliasvault/', isAvailable: true },
+ { name: 'Safari', iconPath: '/img/browser-icons/safari.svg', downloadUrl: 'https://apps.apple.com/app/6743163173', isAvailable: true },
+ { name: 'Microsoft Edge', iconPath: '/img/browser-icons/edge.svg', downloadUrl: 'https://microsoftedge.microsoft.com/addons/detail/aliasvault/kabaanafahnjkfkplbnllebdmppdemfo', isAvailable: true },
+ { name: 'Brave', iconPath: '/img/browser-icons/brave.svg', downloadUrl: 'https://chromewebstore.google.com/detail/aliasvault/bmoggiinmnodjphdjnmpcnlleamkfedj', isAvailable: true },
+];
+
+/** The mobile apps. */
+export const MOBILE_APPS: AppInfo[] = [
+ { name: 'iOS', iconPath: '/img/mobile-icons/ios.svg', downloadUrl: 'https://apps.apple.com/app/id6745490915', isAvailable: true },
+ { name: 'Android', iconPath: '/img/mobile-icons/android.svg', downloadUrl: 'https://play.google.com/store/apps/details?id=net.aliasvault.app', isAvailable: true },
+];
diff --git a/apps/web/tests/e2e/01-registration.spec.ts b/apps/web/tests/e2e/01-registration.spec.ts
index 9286ae331..22c8b1b20 100644
--- a/apps/web/tests/e2e/01-registration.spec.ts
+++ b/apps/web/tests/e2e/01-registration.spec.ts
@@ -29,6 +29,12 @@ test.describe('1. Registration', () => {
await page.locator('#password').fill(credentials.password);
await page.locator('#confirmPassword').fill(credentials.password);
await page.getByRole('button', { name: 'Create Account' }).click();
+ });
+
+ await test.step('the welcome tutorial confirms the new vault', async () => {
+ await expect(page).toHaveURL(/\/welcome$/);
+ await expect(page.getByText('Your vault has been successfully created!')).toBeVisible();
+ await app.finishTutorial();
await app.expectVaultOpen(credentials.username);
});
diff --git a/apps/web/tests/fixtures/WebApp.ts b/apps/web/tests/fixtures/WebApp.ts
index 26f447a28..215844138 100644
--- a/apps/web/tests/fixtures/WebApp.ts
+++ b/apps/web/tests/fixtures/WebApp.ts
@@ -27,7 +27,7 @@ export class WebApp {
}
/**
- * Log in from the start page and wait for the vault.
+ * Log in from the start page and wait for the vault, finishing the tutorial an empty new vault opens with.
*/
public async login(username: string, password: string): Promise<void> {
await this.openStart();
@@ -35,9 +35,23 @@ export class WebApp {
await expect(this.page).toHaveURL(/\/user\/login$/);
await this.submitLogin(username, password);
+ await expect(this.page).toHaveURL(/\/(items|welcome)$/);
+ if (this.page.url().endsWith('/welcome')) {
+ await this.finishTutorial();
+ }
await this.expectVaultOpen(username);
}
+ /**
+ * Click through the welcome tutorial; it marks the tutorial as done and continues to the items page.
+ */
+ public async finishTutorial(): Promise<void> {
+ await expect(this.page).toHaveURL(/\/welcome$/);
+ await this.page.getByRole('button', { name: 'Continue' }).click();
+ await this.page.getByRole('button', { name: 'Continue' }).click();
+ await this.page.getByRole('button', { name: 'Get Started' }).click();
+ }
+
/**
* Fill in and submit the login form on the current page, without waiting for the result.
*/