diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..741509c2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: node_js + +node_js: + - 10 + +install: + - npm install + +script: + - xvfb-run --server-args="-screen 0 1920x1080x24" npm test diff --git a/test/__snapshots__/integration.ts.snap b/test/__snapshots__/integration.ts.snap index 4efacbda..227b54f2 100644 --- a/test/__snapshots__/integration.ts.snap +++ b/test/__snapshots__/integration.ts.snap @@ -16,8 +16,8 @@ exports[`attributes 1`] = ` \\"type\\": 4, \\"data\\": { \\"href\\": \\"about:blank\\", - \\"width\\": 800, - \\"height\\": 600 + \\"width\\": 1920, + \\"height\\": 1080 }, \\"timestamp\\": 1542268800000 }, @@ -173,8 +173,8 @@ exports[`character-data 1`] = ` \\"type\\": 4, \\"data\\": { \\"href\\": \\"about:blank\\", - \\"width\\": 800, - \\"height\\": 600 + \\"width\\": 1920, + \\"height\\": 1080 }, \\"timestamp\\": 1542268800000 }, @@ -328,8 +328,8 @@ exports[`child-list 1`] = ` \\"type\\": 4, \\"data\\": { \\"href\\": \\"about:blank\\", - \\"width\\": 800, - \\"height\\": 600 + \\"width\\": 1920, + \\"height\\": 1080 }, \\"timestamp\\": 1542268800000 }, @@ -491,8 +491,8 @@ exports[`form 1`] = ` \\"type\\": 4, \\"data\\": { \\"href\\": \\"about:blank\\", - \\"width\\": 800, - \\"height\\": 600 + \\"width\\": 1920, + \\"height\\": 1080 }, \\"timestamp\\": 1542268800000 }, @@ -936,7 +936,7 @@ exports[`form 1`] = ` \\"type\\": 1, \\"id\\": 27, \\"x\\": 204, - \\"y\\": 117 + \\"y\\": 157 }, \\"timestamp\\": 1542268800000 }, @@ -965,7 +965,7 @@ exports[`form 1`] = ` \\"type\\": 0, \\"id\\": 27, \\"x\\": 204, - \\"y\\": 117 + \\"y\\": 157 }, \\"timestamp\\": 1542268800000 }, @@ -976,7 +976,7 @@ exports[`form 1`] = ` \\"type\\": 2, \\"id\\": 27, \\"x\\": 204, - \\"y\\": 117 + \\"y\\": 157 }, \\"timestamp\\": 1542268800000 }, @@ -997,7 +997,7 @@ exports[`form 1`] = ` \\"type\\": 1, \\"id\\": 32, \\"x\\": 228, - \\"y\\": 117 + \\"y\\": 157 }, \\"timestamp\\": 1542268800000 }, @@ -1026,7 +1026,7 @@ exports[`form 1`] = ` \\"type\\": 0, \\"id\\": 32, \\"x\\": 228, - \\"y\\": 117 + \\"y\\": 157 }, \\"timestamp\\": 1542268800000 }, @@ -1037,7 +1037,7 @@ exports[`form 1`] = ` \\"type\\": 2, \\"id\\": 32, \\"x\\": 228, - \\"y\\": 117 + \\"y\\": 157 }, \\"timestamp\\": 1542268800000 }, @@ -1227,9 +1227,9 @@ exports[`select2 1`] = ` { \\"type\\": 4, \\"data\\": { - \\"href\\": \\"data:text/html,%0A%0A%0A %0A %0A %0A Select2 3.5%0A %0A%0A%0A
%0A Select2 is a jQuery replacement for select boxes.%0A
%0A In the 3.5 version it use a quite complicated DOM generation strategy which is a good battle-test for rrweb's recorder.%0A
%0A %0A %0A %0A %0A%0A %0A %0A %0A\\", - \\"width\\": 800, - \\"height\\": 600 + \\"href\\": \\"data:text/html,%0A%0A%0A %0A %0A %0A Select2 3.5%0A %0A%0A%0A
%0A Select2 is a jQuery replacement for select boxes.%0A
%0A In the 3.5 version it use a quite complicated DOM generation strategy which is a good battle-test for rrweb's recorder.%0A
%0A %0A %0A %0A %0A%0A %0A %0A %0A\\", + \\"width\\": 1920, + \\"height\\": 1080 }, \\"timestamp\\": 1542268800000 }, @@ -1745,7 +1745,7 @@ exports[`select2 1`] = ` \\"type\\": 1, \\"id\\": 26, \\"x\\": 31, - \\"y\\": 94 + \\"y\\": 78 }, \\"timestamp\\": 1542268800000 }, @@ -1774,7 +1774,7 @@ exports[`select2 1`] = ` \\"id\\": 75, \\"attributes\\": { \\"id\\": \\"select2-drop\\", - \\"style\\": \\"left: 8px; width: 47.5625px; top: 108px; bottom: auto; display: block;\\", + \\"style\\": \\"left: 8px; width: 47.5625px; top: 92px; bottom: auto; display: block;\\", \\"class\\": \\"select2-drop select2-display-none select2-with-searchbox select2-drop-active\\" } }, @@ -1932,7 +1932,7 @@ exports[`select2 1`] = ` \\"attributes\\": { \\"class\\": \\"select2-drop select2-display-none select2-with-searchbox select2-drop-active\\", \\"id\\": \\"select2-drop\\", - \\"style\\": \\"left: 8px; width: 47.5625px; top: 108px; bottom: auto; display: block;\\" + \\"style\\": \\"left: 8px; width: 47.5625px; top: 92px; bottom: auto; display: block;\\" }, \\"childNodes\\": [], \\"id\\": 75 @@ -2203,7 +2203,7 @@ exports[`select2 1`] = ` \\"type\\": 0, \\"id\\": 93, \\"x\\": 31, - \\"y\\": 94 + \\"y\\": 78 }, \\"timestamp\\": 1542268800000 }, @@ -2234,7 +2234,7 @@ exports[`select2 1`] = ` \\"type\\": 1, \\"id\\": 93, \\"x\\": 31, - \\"y\\": 94 + \\"y\\": 78 }, \\"timestamp\\": 1542268800000 }, @@ -2272,7 +2272,7 @@ exports[`select2 1`] = ` \\"id\\": 75, \\"attributes\\": { \\"id\\": null, - \\"style\\": \\"left: 8px; width: 47.5625px; top: 108px; bottom: auto; display: none;\\" + \\"style\\": \\"left: 8px; width: 47.5625px; top: 92px; bottom: auto; display: none;\\" } }, { @@ -2336,7 +2336,7 @@ exports[`select2 1`] = ` \\"type\\": 0, \\"id\\": 67, \\"x\\": 31, - \\"y\\": 94 + \\"y\\": 78 }, \\"timestamp\\": 1542268800000 } diff --git a/test/integration.ts b/test/integration.ts index e6421513..ffaebad0 100644 --- a/test/integration.ts +++ b/test/integration.ts @@ -65,8 +65,12 @@ describe('record integration tests', () => { before(async () => { this.browser = await puppeteer.launch({ - // headless: false, - executablePath: '/home/yanzhen/Desktop/chrome-linux/chrome', + defaultViewport: { + width: 1920, + height: 1080, + }, + headless: false, + args: ['--no-sandbox'], }); const bundle = await rollup.rollup({ @@ -192,5 +196,5 @@ describe('record integration tests', () => { 'select2', ); assert(result.pass, result.pass ? '' : result.report()); - }).timeout(5000); + }).timeout(10000); });