Skip to content

Commit

Permalink
Merge pull request #2722 from Tyriar/linux_tests
Browse files Browse the repository at this point in the history
Install deps for webkit and firefox on Linux
  • Loading branch information
Tyriar authored Feb 16, 2020
2 parents 708c6bd + 84c5f76 commit 986baed
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
36 changes: 18 additions & 18 deletions addons/xterm-addon-fit/src/FitAddon.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ let page: Page;
const width = 1024;
const height = 768;

let isFirefox = false;

describe('FitAddon', () => {
before(async function(): Promise<any> {
const browserType = getBrowserType();
Expand All @@ -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 () => {
Expand All @@ -49,18 +43,18 @@ describe('FitAddon', () => {

it('default', async function(): Promise<any> {
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<any> {
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<any> {
Expand All @@ -80,15 +74,21 @@ describe('FitAddon', () => {
it('default', async function(): Promise<any> {
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<any> {
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<any> {
Expand Down
10 changes: 8 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
jobs:
- job: Linux
pool:
vmImage: 'ubuntu-16.04'
vmImage: 'ubuntu-18.04'
steps:
- task: NodeTool@0
inputs:
Expand Down Expand Up @@ -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'
Expand All @@ -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:
Expand Down

0 comments on commit 986baed

Please sign in to comment.