Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: cleanup tests #4078

Merged
merged 1 commit into from Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions test/CDPSession.spec.js
Expand Up @@ -69,5 +69,15 @@ module.exports.addTests = function({testRunner, expect}) {
}
expect(error.message).toContain('Session closed.');
});
it('should throw nice errors', async function({page}) {
const client = await page.target().createCDPSession();
const error = await theSourceOfTheProblems().catch(error => error);
expect(error.stack).toContain('theSourceOfTheProblems');
expect(error.message).toContain('ThisCommand.DoesNotExist');

async function theSourceOfTheProblems() {
await client.send('ThisCommand.DoesNotExist');
}
});
});
};
11 changes: 0 additions & 11 deletions test/input.spec.js
Expand Up @@ -34,16 +34,5 @@ module.exports.addTests = function({testRunner, expect}) {
return promise.then(() => reader.result);
}, input)).toBe('contents of the file');
});
it_fails_ffox('keyboard.modifiers()', async({page, server}) => {
const keyboard = page.keyboard;
expect(keyboard._modifiers).toBe(0);
await keyboard.down('Shift');
expect(keyboard._modifiers).toBe(8);
await keyboard.down('Alt');
expect(keyboard._modifiers).toBe(9);
await keyboard.up('Shift');
await keyboard.up('Alt');
expect(keyboard._modifiers).toBe(0);
});
});
};
11 changes: 0 additions & 11 deletions test/page.spec.js
Expand Up @@ -1078,17 +1078,6 @@ module.exports.addTests = function({testRunner, expect, headless, Errors, Device
});
});

describe_fails_ffox('Connection', function() {
it('should throw nice errors', async function({page}) {
const error = await theSourceOfTheProblems().catch(error => error);
expect(error.stack).toContain('theSourceOfTheProblems');
expect(error.message).toContain('ThisCommand.DoesNotExist');
async function theSourceOfTheProblems() {
await page._client.send('ThisCommand.DoesNotExist');
}
});
});

describe('Page.Events.Close', function() {
it('should work with window.close', async function({ page, context, server }) {
const newPagePromise = new Promise(fulfill => context.once('targetcreated', target => fulfill(target.page())));
Expand Down