0.0.16 • Published 1 year ago

scipio-geppetto v0.0.16

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Geppetto @scipio/geppetto

Geppetto is nothing special. It is a simple facade infront of babel jest and puppeteer. It also makes for a convient dependency for a bunch or smaller packages commonly used in QA testing. It takes any babel and/or jest conguration files and adds a custom geppetto configuration to manage puppetere. It also combines commonly bundled puppetere calls into a simplified API while still exposing the raw puppetere browser and page objects.

Setup

Install packages

In the project root run:

npm i

Configuration

Configure Geppetto With Envronment Variables and or Configuration files

Environment Variables

ENV namerequireddefault Value
GEP_CONFIG_PATHno
GEP_COVERAGEnofalse
GEP_TEST_TIMEOUTno5000
GEP_VERBOSEnotrue
GEP_HEADLESSnofalse
GEP_SLO_MOno10
GEP_BASE_URLnohttp://localhost:3015

Configuration files

There are several Configuration files that you can optionally override. Look at the configuration file before you override it cause there many Environment variables embedded inside of them.

geppetto.config.js
module.exports = {
    browser: {

	    headless: process.env.GEP_HEADLESS !== undefined 
			? process.env.GEP_HEADLESS 
			: false,

	    slowMo: process.env.GEP_SLO_MO !== undefined 
			? process.env.GEP_SLO_MO 
			: 10,

	    devtools: false,

	    args: ['--disable-infobars', '--window-size=1200,900'],

    	defaultViewport: null,
    },
    
    baseURL: process.env.GEP_BASE_URL || "http://localhost:3015"
};
  • By default boon E2E Empty Project will have a geppetto.config.js file that point to this location

  • Any file that replaces this one will be the one used by Geppetto.

  • You can override geppetto.config.js by setting GEP_CONFIG_PATH environment variable to a relative path from current working dir process.cmd()

module.exports = require('@boon/geppetto/geppetto.config.js')
jest.config.js
module.exports = {
	collectCoverage: process.env.GEP_COVERAGE !== undefined 
    ? process.env.GEP_COVERAGE
    : false,
  
  testMatch: [
    "**/test/**/*.test.js",
    "**/test/**/*.spec.js",
    "**/e2e/**/*.test.js",
    "**/e2e/**/*.spec.js"
  ],

  testPathIgnorePatterns: ['node_modules', 'dist'],

  testTimeout: process.env.GEP_TEST_TIMEOUT !== undefined 
    ? process.env.GEP_TEST_TIMEOUT
    : 5000,
  
  verbose: process.env.GEP_VERBOSE !== undefined 
    ? process.env.GEP_VERBOSE
    : true
}
  • This is a stanard Jest config file Jest Configuratiopn

  • Any file that replaces this one will be the one used by Jest.

  • By default boon E2E Empty Project will have a jest.config.js file that point to this location

module.exports = require('@boon/geppetto/jest.config.js')
babel.config.js
module.exports = {
	presets:[
		["@babel/preset-env",{
			targets: {
				node:"current"
			}
		}]
	]
}
  • This is a stanard Babel config file Babel Configuratiopn

  • Any file that replaces this one will be the one used by Jest.

  • default boon E2E Empty Project will have a babel.config.js file that point to this location

module.exports = require('@boon/geppetto/babel.config.js')

Publish geppetto

To publish a new version of geppetto, update package.json with the next version number and run:

npm run publish

Troubleshooting

> @scipio/geppetto@0.0.1 test
> jest --runInBand --detectOpenHandles

sh: jest: command not found

try to install jest globally.

npm i -g jest-cli
0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago