diff --git a/addons/xterm-addon-fit/src/FitAddon.api.ts b/addons/xterm-addon-fit/src/FitAddon.api.ts index 760a31761f..798b2fc54a 100644 --- a/addons/xterm-addon-fit/src/FitAddon.api.ts +++ b/addons/xterm-addon-fit/src/FitAddon.api.ts @@ -14,8 +14,6 @@ let page: Page; const width = 1024; const height = 768; -let isFirefox = false; - describe('FitAddon', () => { before(async function(): Promise { const browserType = getBrowserType(); @@ -27,10 +25,6 @@ describe('FitAddon', () => { await page.setViewportSize({ width, height }); await page.goto(APP); await openTerminal(page); - // This is used to do conditional assertions since cell height is 1 pixel higher with the - // default font on Firefox. Minor differences in font rendering/sizing is expected so this is - // fine. - isFirefox = await page.evaluate(`navigator.userAgent.toLowerCase().indexOf('firefox') > -1`); }); after(async () => { @@ -49,18 +43,18 @@ describe('FitAddon', () => { it('default', async function(): Promise { await loadFit(); - assert.deepEqual(await page.evaluate(`window.fit.proposeDimensions()`), { - cols: 87, - rows: isFirefox ? 28 : 26 - }); + const dimensions: {cols: number, rows: number} = await page.evaluate(`window.fit.proposeDimensions()`); + assert.equal(dimensions.cols, 87); + assert.isAbove(dimensions.rows, 24); + assert.isBelow(dimensions.rows, 29); }); it('width', async function(): Promise { await loadFit(1008); - assert.deepEqual(await page.evaluate(`window.fit.proposeDimensions()`), { - cols: 110, - rows: isFirefox ? 28 : 26 - }); + const dimensions: {cols: number, rows: number} = await page.evaluate(`window.fit.proposeDimensions()`); + assert.equal(dimensions.cols, 110); + assert.isAbove(dimensions.rows, 24); + assert.isBelow(dimensions.rows, 29); }); it('small', async function(): Promise { @@ -80,15 +74,21 @@ describe('FitAddon', () => { it('default', async function(): Promise { await loadFit(); await page.evaluate(`window.fit.fit()`); - assert.equal(await page.evaluate(`window.term.cols`), 87); - assert.equal(await page.evaluate(`window.term.rows`), isFirefox ? 28 : 26); + const cols: number = await page.evaluate(`window.term.cols`); + const rows: number = await page.evaluate(`window.term.rows`); + assert.equal(cols, 87); + assert.isAbove(rows, 24); + assert.isBelow(rows, 29); }); it('width', async function(): Promise { await loadFit(1008); await page.evaluate(`window.fit.fit()`); - assert.equal(await page.evaluate(`window.term.cols`), 110); - assert.equal(await page.evaluate(`window.term.rows`), isFirefox ? 28 : 26); + const cols: number = await page.evaluate(`window.term.cols`); + const rows: number = await page.evaluate(`window.term.rows`); + assert.equal(cols, 110); + assert.isAbove(rows, 24); + assert.isBelow(rows, 29); }); it('small', async function(): Promise { diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7f8d36fb7e..adeecb88b7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,7 +6,7 @@ jobs: - job: Linux pool: - vmImage: 'ubuntu-16.04' + vmImage: 'ubuntu-18.04' steps: - task: NodeTool@0 inputs: @@ -79,8 +79,12 @@ jobs: - job: Linux_IntegrationTests pool: - vmImage: 'ubuntu-16.04' + vmImage: 'ubuntu-18.04' steps: + - script: | + sudo apt update + sudo apt install libwoff1 libopus0 libwebp6 libwebpdemux2 libenchant1c2a libgudev-1.0-0 libsecret-1-0 libhyphen0 libgdk-pixbuf2.0-0 libegl1 libgles2 libevent-2.1-6 libnotify4 libxslt1.1 + displayName: Install required packages - task: NodeTool@0 inputs: versionSpec: '10.x' @@ -102,6 +106,8 @@ jobs: displayName: 'Start test server' - script: yarn test-api-chromium --headless --forbid-only displayName: 'Integration tests (Chromium)' + - script: xvfb-run --auto-servernum -- bash -c "yarn test-api-firefox --headless --forbid-only" + displayName: 'Integration tests (Firefox)' - job: macOS_IntegrationTests pool: