From 43ddb741ea8bd4bb09f93ee58056afb9c4d8b657 Mon Sep 17 00:00:00 2001 From: Rebeka Dekany <50901361+rebekadekany@users.noreply.github.com> Date: Wed, 24 Sep 2025 18:23:07 +0200 Subject: [PATCH] Update learn wiki e2e tests for current navigation structure (#28685) GitOrigin-RevId: d7d87bf712e0ed399c5fe3a7108db5c47d641ce8 --- server-ce/test/learn-wiki.spec.ts | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/server-ce/test/learn-wiki.spec.ts b/server-ce/test/learn-wiki.spec.ts index 1d8ce44812..2070868a85 100644 --- a/server-ce/test/learn-wiki.spec.ts +++ b/server-ce/test/learn-wiki.spec.ts @@ -47,8 +47,8 @@ describe('LearnWiki', function () { it('should render wiki page', () => { login(REGULAR_USER) + cy.visit(UPLOADING_A_PROJECT_URL) - // Wiki content cy.findByRole('heading', { name: 'Uploading a project' }) cy.contains(/how to create an Overleaf project/) cy.findByRole('img', { name: 'Creating a new project on Overleaf' }) @@ -56,20 +56,28 @@ describe('LearnWiki', function () { .and((el: any) => { expect(el[0].naturalWidth, 'renders image').to.be.greaterThan(0) }) - // Wiki navigation - cy.findByRole('link', { name: 'Copying a project' }).should('exist') + + cy.visit(COPYING_A_PROJECT_URL) + cy.findByRole('heading', { name: 'Copying a project' }) + cy.findByRole('link', { + name: '1 How to copy a project (option 1)', + }).should('exist') + cy.findByRole('link', { + name: '2 How to copy a project (option 2)', + }).should('exist') }) - it('should navigate back and forth', function () { + it('should navigate within wiki page using table of contents', function () { login(REGULAR_USER) cy.visit(COPYING_A_PROJECT_URL) cy.findByRole('heading', { name: 'Copying a project' }) - cy.findByRole('link', { name: 'Uploading a project' }).click() - cy.url().should('contain', UPLOADING_A_PROJECT_URL) - cy.findByRole('heading', { name: 'Uploading a project' }) - cy.findByRole('link', { name: 'Copying a project' }).click() + cy.findByRole('link', { + name: '2 How to copy a project (option 2)', + }).click() cy.url().should('contain', COPYING_A_PROJECT_URL) - cy.findByRole('heading', { name: 'Copying a project' }) + cy.findByRole('heading', { + name: 'How to copy a project (option 2)', + }).should('be.visible') }) })