Skip to content

Commit

Permalink
fixing bug caused Puppeteer@1.12 #13 and adding filter for empty targets
Browse files Browse the repository at this point in the history
  • Loading branch information
dsheiko committed Feb 11, 2019
1 parent b272a24 commit 17570a7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/main/install-runtime-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ exports.installRuntimeTest = ( event, appInstallDirectory ) => {
npm.commands.install( appInstallDirectory, [
"cross-env@^5.2.0",
"jest@^23.6.0",
"puppeteer@^1.10.0",
"puppeteer@1.11.0",
"shelljs@^0.8.2"
], ( err, data ) => {
if ( err ) {
Expand Down
6 changes: 5 additions & 1 deletion jest-pkg/lib/extendPuppeteer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
const { ElementHandle } = require( "puppeteer/lib/ExecutionContext" );
let { ElementHandle } = require( "puppeteer/lib/ExecutionContext" );
// since version 1.12 ElementHandle moved out of ExecutionContext
if ( ElementHandle === undefined ) {
ElementHandle = require( "puppeteer/lib/JSHandle" ).ElementHandle;
}

/**
* Set value on a select element
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "puppetry",
"description": "Puppetry - codeless end-to-end test automation, integrated with CI/CD pipeline",
"version": "1.0.5",
"version": "1.0.6",
"author": "Dmitry Sheiko <me@dsheiko.com> (http://dsheiko.com)",
"repository": {
"type": "git",
Expand Down
4 changes: 3 additions & 1 deletion src/service/TestGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export default class TestGenerator {
}

parseTargets( targets ) {
return Object.values( targets ).map( this.schema.jest.tplQuery ).join( "\n" );
return Object.values( targets )
.filter( ({ target, selector }) => Boolean( target ) && Boolean( selector ) )
.map( this.schema.jest.tplQuery ).join( "\n" );
}

parseCommand = ( command ) => {
Expand Down

0 comments on commit 17570a7

Please sign in to comment.