1
0
mirror of https://github.com/snobu/destreamer.git synced 2026-01-26 01:42:19 +00:00

Import mocha test from dev branch

This commit is contained in:
kylon
2020-04-10 02:00:56 +02:00
parent 1e97bde964
commit cbcd7a0dd3
4 changed files with 672 additions and 52 deletions

26
test/test.ts Normal file
View File

@@ -0,0 +1,26 @@
import puppeteer from 'puppeteer';
import assert from 'assert';
let browser: any;
let page: any;
before(async () => {
browser = await puppeteer.launch({
headless: true,
args: ['--disable-dev-shm-usage']
});
page = await browser.newPage();
});
describe('Puppeteer', () => {
it('should grab GitHub page title', async () => {
await page.goto("https://github.com/", { waitUntil: 'networkidle2' });
let pageTitle = await page.title();
assert.equal(true, pageTitle.includes('GitHub'));
}).timeout(15000); // yeah, this may take a while...
});
after(async () => {
await browser.close();
});