Skip to content

Commit 0b68fe4

Browse files
Copilotszaimen
andcommitted
fix(e2e): revert App.vue changes, fix tests without app-level workarounds
- Revert src/views/App.vue to original state (always start at intro animation) - Fix 'opens when a new major version' test: click Skip to advance past intro - Move 'About & What's new' wizard test from settings.spec.ts to firstrunwizard.spec.ts - Remove 'About & What's new' describe block from settings.spec.ts Co-authored-by: szaimen <42591237+szaimen@users.noreply.github.com> Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/46619e35-ecf5-4089-a682-8830bd9abfe6
1 parent d2bb7c7 commit 0b68fe4

3 files changed

Lines changed: 47 additions & 49 deletions

File tree

e2e/firstrunwizard.spec.ts

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,57 @@ test.describe('First Run Wizard', () => {
3939
const wizard = page.locator('.first-run-wizard')
4040
await expect(wizard).toBeVisible()
4141

42-
// In changelog-only mode the intro animation is skipped and the
43-
// wizard opens directly on the "What's new" page.
42+
// The intro animation is always shown first; skip it to advance
43+
// directly to the "What's new" page (changelog-only mode).
44+
const skipButton = wizard.getByRole('button', { name: 'Skip' })
45+
await expect(skipButton).toBeVisible({ timeout: 5_000 })
46+
await skipButton.click()
47+
48+
// In changelog-only mode the wizard advances directly to the
49+
// "What's new" page after the intro animation.
4450
await expect(wizard).toContainText('New in Nextcloud Hub')
4551
} finally {
4652
await deleteUser(user.userId)
4753
}
4854
})
4955

56+
test('"About & What\'s new" menu entry reopens the wizard', async ({ page }) => {
57+
const user = await createRandomUser()
58+
59+
try {
60+
await login(page, user.userId, user.password)
61+
62+
// Close the first-run wizard that opens automatically on first login
63+
const wizard = page.locator('.first-run-wizard')
64+
await expect(wizard).toBeVisible()
65+
66+
// Skip the intro animation as soon as the Skip button appears (~2s)
67+
const skipButton = wizard.getByRole('button', { name: 'Skip' })
68+
await expect(skipButton).toBeVisible({ timeout: 5_000 })
69+
await skipButton.click()
70+
71+
// Close the slideshow
72+
const closeButton = wizard.getByRole('button', { name: 'Close' })
73+
await expect(closeButton).toBeVisible()
74+
await closeButton.click()
75+
await expect(wizard).not.toBeVisible()
76+
77+
// Open the user settings menu to find the "About & What's new" entry
78+
const userMenu = page.locator('[aria-controls="header-menu-user-menu"]')
79+
await userMenu.click()
80+
81+
// Use the link role to avoid strict mode violation from the duplicate ID
82+
// that Nextcloud renders on both the <li> and the inner <a> element
83+
const aboutEntry = page.getByRole('link', { name: "About & What's new" })
84+
await aboutEntry.click()
85+
86+
// The wizard should open again via the app-menu.ts handler
87+
await expect(wizard).toBeVisible()
88+
} finally {
89+
await deleteUser(user.userId)
90+
}
91+
})
92+
5093
test('can be navigated and closed', async ({ page }) => {
5194
const user = await createRandomUser()
5295

e2e/settings.spec.ts

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -44,46 +44,3 @@ test.describe('Settings page', () => {
4444
).toBeVisible()
4545
})
4646
})
47-
48-
test.describe('"About & What\'s new" navigation entry', () => {
49-
let user: User
50-
51-
test.beforeAll(async () => {
52-
user = await createRandomUser()
53-
})
54-
55-
test.afterAll(async () => {
56-
await deleteUser(user.userId)
57-
})
58-
59-
test('opens the first run wizard', async ({ page }) => {
60-
await login(page, user.userId, user.password)
61-
62-
// Close the first-run wizard that opens automatically on first login
63-
const wizard = page.locator('.first-run-wizard')
64-
await expect(wizard).toBeVisible()
65-
66-
// Skip the intro animation as soon as the Skip button appears (~2s)
67-
const skipButton = wizard.getByRole('button', { name: 'Skip' })
68-
await expect(skipButton).toBeVisible({ timeout: 5_000 })
69-
await skipButton.click()
70-
71-
// Close the slideshow
72-
const closeButton = wizard.getByRole('button', { name: 'Close' })
73-
await expect(closeButton).toBeVisible()
74-
await closeButton.click()
75-
await expect(wizard).not.toBeVisible()
76-
77-
// Open the user settings menu to find the "About & What's new" entry
78-
const userMenu = page.locator('[aria-controls="header-menu-user-menu"]')
79-
await userMenu.click()
80-
81-
// Use the link role to avoid strict mode violation from the duplicate ID
82-
// that Nextcloud renders on both the <li> and the inner <a> element
83-
const aboutEntry = page.getByRole('link', { name: "About & What's new" })
84-
await aboutEntry.click()
85-
86-
// The wizard should open again via the app-menu.ts handler
87-
await expect(wizard).toBeVisible()
88-
})
89-
})

src/views/App.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ const showChangelogOnly = loadState<boolean>('firstrunwizard', 'changelogOnly',
2424
const changelogPage = Math.max(pages.findIndex((page) => page.id === 'whats-new'), 0)
2525
2626
const showModal = ref(false)
27-
/** Start directly at the changelog page for returning users who only need to see the changelog */
28-
const currentPage = ref(showChangelogOnly ? changelogPage : -1)
27+
const currentPage = ref(-1)
2928
const setReturnFocus = ref<HTMLElement | SVGElement | string>()
3029
3130
/**
@@ -35,8 +34,7 @@ const setReturnFocus = ref<HTMLElement | SVGElement | string>()
3534
*/
3635
function open(focusReturn?: HTMLElement | SVGElement | string) {
3736
setReturnFocus.value = focusReturn
38-
// Skip the intro animation for returning users who only need the changelog
39-
currentPage.value = showChangelogOnly ? changelogPage : -1
37+
currentPage.value = -1
4038
showModal.value = true
4139
}
4240

0 commit comments

Comments
 (0)