Skip to content

Commit

Permalink
Merge pull request #9 from Synthetixio/dev
Browse files Browse the repository at this point in the history
promote dev to master
  • Loading branch information
drptbl authored Dec 3, 2020
2 parents e8c10c7 + 1524b30 commit c4b43e8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"node-fetch": "2.6.1",
"prettier": "2.2.1",
"puppeteer-core": "5.5.0",
"puppeteer-recorder": "1.0.7",
"start-server-and-test": "1.11.6",
"unzipper": "0.10.11"
},
Expand Down
18 changes: 18 additions & 0 deletions plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const path = require('path');
const fs = require('fs');
const helpers = require('../helpers');
const puppeteer = require('puppeteer-core');
const { recordPuppeteer } = require('puppeteer-recorder');
const fetch = require('node-fetch');
const { pageElements } = require('../pages/metamask/page');
const {
Expand Down Expand Up @@ -109,6 +110,11 @@ module.exports = (on, config) => {

await initPuppeteer();
await assignWindows();
// record puppeteer browser
await record(
puppeteerBrowser,
`${helpers.getSynpressPath()}/puppeteer.webm`,
);
// no suitable element to wait for
await metamaskWindow.waitForTimeout(1000);
if ((await metamaskWindow.$(unlockPageElements.unlockPage)) === null) {
Expand Down Expand Up @@ -223,6 +229,18 @@ async function assignWindows() {
return true;
}

async function record(browser, path) {
await recordPuppeteer({
browser: browser,
output: path,
fps: 60,
frames: 60 * 5,
prepare: function () {},
render: function () {},
});
return true;
}

async function switchToCypressWindow() {
await mainWindow.bringToFront();
return true;
Expand Down

0 comments on commit c4b43e8

Please sign in to comment.