From 8bc9ce3b528d305c31b5412f6be34b0d8fc3a03c Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Wed, 19 Jun 2024 13:19:44 +0200 Subject: [PATCH] Merge pull request #18993 from overleaf/jpa-test-xelatex [server-pro] add tests for using XeLaTeX GitOrigin-RevId: 66c602c930a4dd0888e88f2f90bd587ee16a7a64 --- server-ce/test/sandboxed-compiles.spec.ts | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/server-ce/test/sandboxed-compiles.spec.ts b/server-ce/test/sandboxed-compiles.spec.ts index c88b776bdd..73c5ec6fd2 100644 --- a/server-ce/test/sandboxed-compiles.spec.ts +++ b/server-ce/test/sandboxed-compiles.spec.ts @@ -46,8 +46,40 @@ describe('SandboxedCompiles', function () { cy.get('[aria-label="View logs"]').click() cy.findByText(/This is pdfTeX, Version .+ \(TeX Live 2022\) /) }) + + checkXeTeX() }) + function checkXeTeX() { + it('should be able to use XeLaTeX', () => { + cy.visit('/project') + createProject('XeLaTeX') + const recompile = throttledRecompile() + cy.log('wait for compile') + cy.get('.pdf-viewer').should('contain.text', 'XeLaTeX') + + cy.log('Check which compiler was used, expect pdfLaTeX') + cy.get('[aria-label="View logs"]').click() + cy.findByText(/This is pdfTeX/) + + cy.log('Switch compiler to from pdfLaTeX to XeLaTeX') + cy.get('header').findByText('Menu').click() + cy.findByText('Compiler') + .parent() + .findByText('pdfLaTeX') + .parent() + .select('XeLaTeX') + cy.get('#left-menu-modal').click() + + cy.log('Trigger compile with other compiler') + recompile() + + cy.log('Check which compiler was used, expect XeLaTeX') + cy.get('[aria-label="View logs"]').click() + cy.findByText(/This is XeTeX/) + }) + } + function checkUsesDefaultCompiler() { beforeEach(function () { login('user@example.com') @@ -70,11 +102,13 @@ describe('SandboxedCompiles', function () { startWith({ pro: true }) checkUsesDefaultCompiler() + checkXeTeX() }) describe.skip('unavailable in CE', () => { startWith({ pro: false, vars: enabledVars }) checkUsesDefaultCompiler() + checkXeTeX() }) })