+
@@ -280,12 +281,14 @@ import InfiniteScroll from "../components/InfiniteScroll.vue";
import QuickNav from "../components/QuickNav.vue";
import OnboardingDialog from "../components/OnboardingDialog.vue";
import ProjectIcon from "../components/ProjectIcon.vue";
+import NextStepBanner from "../components/NextStepBanner.vue";
import TopMessage from "../components/TopMessage.vue";
import RegistrationNotice from "../components/RegistrationNotice.vue";
import { Contact } from "../db/tables/contacts";
import { didInfo, getHeaders, getPlanFromCache } from "../libs/endorserServer";
import { OfferSummaryRecord, PlanData } from "../interfaces/records";
import { OnboardPage, iconForUnitCode } from "../libs/util";
+import { shouldOpenWelcome } from "../libs/onboarding";
import { logger } from "../utils/logger";
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify";
@@ -323,6 +326,7 @@ import { UNNAMED_PROJECT } from "@/constants/entities";
EntityIcon,
InfiniteScroll,
QuickNav,
+ NextStepBanner,
OnboardingDialog,
ProjectIcon,
TopMessage,
@@ -432,7 +436,7 @@ export default class ProjectsView extends Vue {
*/
private async checkOnboardingStatus() {
const settings = await this.$accountSettings();
- if (!settings.finishedOnboarding) {
+ if (shouldOpenWelcome(settings)) {
(this.$refs.onboardingDialog as OnboardingDialog).open(
OnboardPage.Create,
);
diff --git a/test-playwright/00-noid-tests.spec.ts b/test-playwright/00-noid-tests.spec.ts
index 44604515..25450a4b 100644
--- a/test-playwright/00-noid-tests.spec.ts
+++ b/test-playwright/00-noid-tests.spec.ts
@@ -62,21 +62,21 @@
* @example Checking activity feed
* ```typescript
* await page.goto('./');
- * await page.getByTestId('closeOnboardingAndFinish').click();
+ * await closeOnboardingIfShown(page);
* await expect(page.locator('ul#listLatestActivity li:nth-child(10)'))
* .toBeVisible();
* ```
*/
import { test, expect } from '@playwright/test';
-import { generateNewEthrUser, importUser, deleteContact, switchToUser } from './testUtils';
+import { generateNewEthrUser, importUser, deleteContact, switchToUser, closeOnboardingIfShown } from './testUtils';
import { NOTIFY_CONTACT_INVALID_DID } from '../src/constants/notifications';
import { UNNAMED_ENTITY_NAME } from '../src/constants/entities';
test('Check activity feed - check that server is running', async ({ page }) => {
// Load app homepage
await page.goto('./');
- await page.getByTestId('closeOnboardingAndFinish').click();
+ await closeOnboardingIfShown(page);
// Check that initial 10 activities have been loaded
await expect(page.locator('ul#listLatestActivity li:nth-child(10)')).toBeVisible();
@@ -136,7 +136,7 @@ test('Check ID generation', async ({ page }) => {
test('Check setting name & sharing info', async ({ page }) => {
// Load homepage to trigger ID generation (?)
await page.goto('./');
- await page.getByTestId('closeOnboardingAndFinish').click();
+ await closeOnboardingIfShown(page);
// Wait for dialog to be hidden or removed - try multiple approaches
try {
// First try: wait for overlay to disappear
@@ -243,7 +243,7 @@ test('Check User 0 can register a random person', async ({ page }) => {
await switchToUser(page, 'did:ethr:0x0000694B58C2cC69658993A90D3840C560f2F51F');
await page.goto('./');
- await page.getByTestId('closeOnboardingAndFinish').click();
+ await closeOnboardingIfShown(page);
// Wait for dialog to be hidden or removed - try multiple approaches
try {
// First try: wait for overlay to disappear
diff --git a/test-playwright/30-record-gift.spec.ts b/test-playwright/30-record-gift.spec.ts
index 23a82b8d..760b425d 100644
--- a/test-playwright/30-record-gift.spec.ts
+++ b/test-playwright/30-record-gift.spec.ts
@@ -80,7 +80,7 @@
*/
import { test, expect } from '@playwright/test';
import { UNNAMED_ENTITY_NAME } from '../src/constants/entities';
-import { importUser, retryWaitForLoadState, retryWaitForSelector, retryClick, getNetworkIdleTimeout, getElementWaitTimeout } from './testUtils';
+import { importUser, retryWaitForLoadState, retryWaitForSelector, retryClick, getNetworkIdleTimeout, getElementWaitTimeout, closeOnboardingIfShown } from './testUtils';
test('Record something given', async ({ page }) => {
// Generate a random string of a few characters
@@ -100,7 +100,7 @@ test('Record something given', async ({ page }) => {
// Record something given
await page.goto('./');
- await page.getByTestId('closeOnboardingAndFinish').click();
+ await closeOnboardingIfShown(page);
// Simple dialog handling - just wait for it to be gone
await page.waitForFunction(() => {
diff --git a/test-playwright/33-record-gift-x10.spec.ts b/test-playwright/33-record-gift-x10.spec.ts
index c7f0255e..6b50b76f 100644
--- a/test-playwright/33-record-gift-x10.spec.ts
+++ b/test-playwright/33-record-gift-x10.spec.ts
@@ -86,7 +86,7 @@
import { test, expect } from '@playwright/test';
import { UNNAMED_ENTITY_NAME } from '../src/constants/entities';
-import { importUser, createUniqueStringsArray, createRandomNumbersArray } from './testUtils';
+import { importUser, createUniqueStringsArray, createRandomNumbersArray, closeOnboardingIfShown } from './testUtils';
test('Record 9 new gifts', async ({ page }) => {
test.slow(); // Set timeout longer
@@ -114,7 +114,7 @@ test('Record 9 new gifts', async ({ page }) => {
// Record gift
await page.goto('./', { waitUntil: 'networkidle' });
if (i === 0) {
- await page.getByTestId('closeOnboardingAndFinish').click();
+ await closeOnboardingIfShown(page);
}
await page.getByRole('button', { name: 'Thank' }).click();
await page.getByRole('listitem').filter({ hasText: UNNAMED_ENTITY_NAME }).locator('svg').click();
diff --git a/test-playwright/37-record-gift-on-project.spec.ts b/test-playwright/37-record-gift-on-project.spec.ts
index 13c9fa9a..b7d6db30 100644
--- a/test-playwright/37-record-gift-on-project.spec.ts
+++ b/test-playwright/37-record-gift-on-project.spec.ts
@@ -19,7 +19,6 @@ async function testProjectGive(page: Page, isToProject: boolean) {
// find a project and enter a give to it and see that it shows
await importUser(page, '00');
await page.goto('./discover');
- await page.getByTestId('closeOnboardingAndFinish').click();
await page.locator('ul#listDiscoverResults li:first-child a').click()
// wait for the project page to load
diff --git a/test-playwright/38-record-gift-on-deep-linked-project.spec.ts b/test-playwright/38-record-gift-on-deep-linked-project.spec.ts
index ee545ce1..192f43c4 100644
--- a/test-playwright/38-record-gift-on-deep-linked-project.spec.ts
+++ b/test-playwright/38-record-gift-on-deep-linked-project.spec.ts
@@ -27,7 +27,6 @@ async function findProjectIds(
page: Page,
): Promise<{ fullId: string; shortId: string }> {
await page.goto('./discover');
- await page.getByTestId('closeOnboardingAndFinish').click();
await page.locator('ul#listDiscoverResults li:first-child a').click();
await page.waitForURL(/\/project\//);
diff --git a/test-playwright/40-add-contact.spec.ts b/test-playwright/40-add-contact.spec.ts
index 39903055..4552bf90 100644
--- a/test-playwright/40-add-contact.spec.ts
+++ b/test-playwright/40-add-contact.spec.ts
@@ -60,7 +60,7 @@
*/
import { test, expect, Page } from '@playwright/test';
-import { importUser, getOSSpecificTimeout } from './testUtils';
+import { importUser, getOSSpecificTimeout, closeOnboardingIfShown } from './testUtils';
test('Add contact, record gift, confirm gift', async ({ page }) => {
@@ -117,7 +117,7 @@ test('Add contact, record gift, confirm gift', async ({ page }) => {
// Confirm that home shows contact in "Record Something…"
await page.goto('./');
- await page.getByTestId('closeOnboardingAndFinish').click();
+ await closeOnboardingIfShown(page);
await page.getByRole('button', { name: 'Thank' }).click();
await expect(page.locator('#sectionGiftedGiver').getByRole('listitem').filter({ hasText: contactName }).first()).toBeVisible();
@@ -159,7 +159,7 @@ test('Add contact, record gift, confirm gift', async ({ page }) => {
// Go to home view and look for gift
await page.goto('./');
- await page.getByTestId('closeOnboardingAndFinish').click();
+ await closeOnboardingIfShown(page);
const giftLink = page.locator('li').filter({ hasText: finalTitle }).locator('[data-testid="circle-info-link"]');
await expect(giftLink).toBeVisible();
await giftLink.click();
diff --git a/test-playwright/50-record-offer.spec.ts b/test-playwright/50-record-offer.spec.ts
index 1153af58..1535ec2d 100644
--- a/test-playwright/50-record-offer.spec.ts
+++ b/test-playwright/50-record-offer.spec.ts
@@ -1,5 +1,5 @@
import { test, expect, Page } from '@playwright/test';
-import { importUser, importUserFromAccount, switchToUser, waitForNewActivityLoaded } from './testUtils';
+import { importUser, importUserFromAccount, switchToUser, waitForNewActivityLoaded, closeOnboardingIfShown } from './testUtils';
test('Record an offer', async ({ page }) => {
test.setTimeout(60000);
@@ -17,7 +17,7 @@ test('Record an offer', async ({ page }) => {
const userZeroDid = await importUserFromAccount(page, "00");
// this Home visit records where User Zero's New Activity starts
await page.goto('./');
- await page.getByTestId('closeOnboardingAndFinish').click();
+ await closeOnboardingIfShown(page);
await waitForNewActivityLoaded(page);
// Select a project User Zero owns, since New Activity leaves out a person's
// own offers to their projects
@@ -31,7 +31,7 @@ test('Record an offer', async ({ page }) => {
await importUserFromAccount(page, "01");
// onboarding is per identity, and its dialog would cover the Projects page
await page.goto('./');
- await page.getByTestId('closeOnboardingAndFinish').click();
+ await closeOnboardingIfShown(page);
await expect(page.locator('.dialog-overlay')).toBeHidden();
await page.goto(projectUrl);
await expect(page.getByTestId('offerButton')).toBeVisible();
@@ -110,7 +110,7 @@ test('Affirm delivery of an offer', async ({ page }) => {
await importUserFromAccount(page, "00");
await page.goto('./');
- await page.getByTestId('closeOnboardingAndFinish').click();
+ await closeOnboardingIfShown(page);
// Wait for dialog to be hidden or removed - try multiple approaches
try {
// First try: wait for overlay to disappear
diff --git a/test-playwright/55-new-activity.spec.ts b/test-playwright/55-new-activity.spec.ts
index 92ff416d..eba37f05 100644
--- a/test-playwright/55-new-activity.spec.ts
+++ b/test-playwright/55-new-activity.spec.ts
@@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test';
-import { switchToUser, getTestUserData, importUserFromAccount, waitForNewActivityLoaded } from './testUtils';
+import { switchToUser, getTestUserData, importUserFromAccount, waitForNewActivityLoaded, closeOnboardingIfShown } from './testUtils';
test('New offers for another user', async ({ page }) => {
await page.goto('./');
@@ -14,7 +14,7 @@ test('New offers for another user', async ({ page }) => {
throw new Error('Auto-created DID not found in HomeView');
}
- await page.getByTestId('closeOnboardingAndFinish').click();
+ await closeOnboardingIfShown(page);
// Wait for onboarding dialog to fully close and settings to persist
await expect(page.locator('.dialog-overlay')).toBeHidden({ timeout: 5000 });
await expect(page.getByTestId('newActivityNumber-claims')).toBeHidden();
diff --git a/test-playwright/testUtils.ts b/test-playwright/testUtils.ts
index 8453bd53..60a258a8 100644
--- a/test-playwright/testUtils.ts
+++ b/test-playwright/testUtils.ts
@@ -88,13 +88,26 @@ export async function importUser(page: Page, id?: string): Promise {
return did;
}
+/**
+ * On the feed, wait until onboarding has had its chance to open, and close it
+ * if it did. The interests prompt opens only for an identity with no profile
+ * text on the server, so a test user who has one never sees it.
+ */
+export async function closeOnboardingIfShown(page: Page): Promise {
+ await page.locator('#Content[data-onboarding-checked="true"]').waitFor();
+ const close = page.getByTestId("closeOnboardingAndFinish");
+ if (await close.isVisible()) {
+ await close.click();
+ }
+}
+
export async function importUserAndCloseOnboarding(
page: Page,
id?: string
): Promise {
const did = await importUser(page, id);
await page.goto("./");
- await page.getByTestId("closeOnboardingAndFinish").click();
+ await closeOnboardingIfShown(page);
return did;
}