Skip to content

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

Add E2E tests for welcome screen tutorial (#177)

Leendert de Borstd71194b3b810
diff --git a/src/AliasVault.Client/Main/Pages/Welcome.razor b/src/AliasVault.Client/Main/Pages/Welcome.razor
index 60d052746..fc9e7202f 100644
--- a/src/AliasVault.Client/Main/Pages/Welcome.razor
+++ b/src/AliasVault.Client/Main/Pages/Welcome.razor
@@ -49,7 +49,6 @@
case TutorialStep.SecurityTips:
<div class="space-y-4">
- <h3 class="text-2xl font-bold text-gray-900 dark:text-white">Privacy & Security Tips</h3>
<div class="space-y-3">
<div class="p-4 bg-gray-50 dark:bg-gray-700 rounded-lg">
<h4 class="font-semibold text-gray-900 dark:text-white">Keep Your Master Password Safe</h4>
@@ -159,8 +158,10 @@
private async Task FinishTutorial()
{
+ GlobalLoadingSpinner.Show();
await DbService.Settings.SetTutorialDoneAsync(true);
NavigationManager.NavigateTo("credentials");
+ GlobalLoadingSpinner.Hide();
}
private int GetProgressPercentage()
diff --git a/src/Tests/AliasVault.E2ETests/Tests/Client/Shard4/WelcomeScreenTests.cs b/src/Tests/AliasVault.E2ETests/Tests/Client/Shard4/WelcomeScreenTests.cs
new file mode 100644
index 000000000..5ebe36147
--- /dev/null
+++ b/src/Tests/AliasVault.E2ETests/Tests/Client/Shard4/WelcomeScreenTests.cs
@@ -0,0 +1,56 @@
+//-----------------------------------------------------------------------
+// <copyright file="WelcomeScreenTests.cs" company="lanedirt">
+// Copyright (c) lanedirt. All rights reserved.
+// Licensed under the MIT license. See LICENSE.md file in the project root for full license information.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace AliasVault.E2ETests.Tests.Client.Shard4;
+
+/// <summary>
+/// End-to-end tests for the welcome screen (tutorial) steps.
+/// </summary>
+[Parallelizable(ParallelScope.Self)]
+[Category("ClientTests")]
+[TestFixture]
+public class WelcomeScreenTests : ClientPlaywrightTest
+{
+ /// <summary>
+ /// Test if the welcome screen can be completed and the tutorial is no longer shown after that.
+ /// </summary>
+ /// <returns>Async task.</returns>
+ [Test]
+ [Order(1)]
+ public async Task WelcomeScreenTest()
+ {
+ // Click the "Continue" button
+ var continueButton = await WaitForAndGetElement("button:has-text('Continue')");
+ await continueButton.ClickAsync();
+
+ // Wait for the "How AliasVault works" step to load.
+ await WaitForUrlAsync("welcome", "How AliasVault works");
+
+ // Click the "Continue" button.
+ continueButton = await WaitForAndGetElement("button:has-text('Continue')");
+ await continueButton.ClickAsync();
+
+ // Wait for the "Privacy & Security Tips" step to load.
+ await WaitForUrlAsync("welcome", "Security Tips");
+
+ // Click on the "Get started" button.
+ var getStartedButton = await WaitForAndGetElement("button:has-text('Get started')");
+ await getStartedButton.ClickAsync();
+
+ // Wait for the credentials page to load with the placeholder text.
+ await WaitForUrlAsync("credentials", "No credentials yet");
+
+ // Verify that after hard reloading the page, the credentials page is still loaded with the placeholder text
+ // and the tutorial is no longer shown.
+ await RefreshPageAndUnlockVault();
+ await WaitForUrlAsync("credentials", "No credentials yet");
+
+ // Verify that the welcome screen is no longer shown.
+ var pageContent = await Page.TextContentAsync("body");
+ Assert.That(pageContent, Does.Not.Contain(WelcomeMessage));
+ }
+}