Compare commits

..

14 Commits

Author SHA1 Message Date
b2efe28f4d 1.0.35 2021-11-07 19:33:10 +01:00
1ab34d909b fix(core): update 2021-11-07 19:33:09 +01:00
09a8888d47 1.0.34 2021-11-07 18:55:11 +01:00
243beb2c75 1.0.33 2021-11-07 18:50:23 +01:00
c6fd1bea7a fix(core): update 2021-11-07 18:50:22 +01:00
4f94fa31ac 1.0.32 2021-11-07 18:38:16 +01:00
ac61d8ff4d fix(core): update 2021-11-07 18:38:15 +01:00
107178e9e7 1.0.31 2021-11-07 18:33:26 +01:00
0b5c030d5d fix(core): update 2021-11-07 18:33:25 +01:00
94f145c3dc 1.0.30 2021-11-07 18:30:09 +01:00
ebd60756ea fix(core): update 2021-11-07 18:30:08 +01:00
8305dd105c 1.0.29 2021-11-07 15:58:45 +01:00
797cac672b fix(core): update 2021-11-07 15:58:45 +01:00
4b1f058a21 1.0.28 2021-11-07 15:46:31 +01:00
8 changed files with 2528 additions and 1632 deletions

View File

@@ -7,54 +7,10 @@ cache:
key: '$CI_BUILD_STAGE' key: '$CI_BUILD_STAGE'
stages: stages:
- security - only
- test
- release
- metadata
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=dev
tags:
- docker
allow_failure: true
# ====================
# test stage
# ====================
testStable: testStable:
stage: test stage: only
script: script:
- npmci npm prepare - npmci npm prepare
- npmci node install stable - npmci node install stable
@@ -64,74 +20,3 @@ testStable:
tags: tags:
- docker - docker
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release:
stage: release
script:
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- lossless
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g tslint typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- lossless
- docker
- notpriv
pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci npm install
- npmci command tsdoc
tags:
- lossless
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

24
.vscode/launch.json vendored
View File

@@ -2,28 +2,10 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "current file", "command": "npm test",
"type": "node", "name": "Run npm test",
"request": "launch", "request": "launch",
"args": [ "type": "node-terminal"
"${relativeFile}"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "test.ts",
"type": "node",
"request": "launch",
"args": [
"test/test.ts"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
} }
] ]
} }

3988
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartpuppeteer", "name": "@pushrocks/smartpuppeteer",
"version": "1.0.27", "version": "1.0.35",
"private": false, "private": false,
"description": "simplified access to puppeteer", "description": "simplified access to puppeteer",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@@ -13,17 +13,18 @@
"format": "(gitzone format)" "format": "(gitzone format)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.26", "@gitzone/tsbuild": "^2.1.28",
"@gitzone/tstest": "^1.0.54", "@gitzone/tstest": "^1.0.59",
"@pushrocks/tapbundle": "^3.2.14", "@pushrocks/tapbundle": "^3.2.14",
"@types/node": "^16.6.1", "@types/node": "^16.11.6",
"tslint": "^6.1.3", "tslint": "^6.1.3",
"tslint-config-prettier": "^1.15.0" "tslint-config-prettier": "^1.15.0"
}, },
"dependencies": { "dependencies": {
"@pushrocks/smartdelay": "^2.0.13", "@pushrocks/smartdelay": "^2.0.13",
"@pushrocks/smartenv": "^4.0.16", "@pushrocks/smartenv": "^4.0.16",
"puppeteer": "^10.2.0", "@pushrocks/smartshell": "^2.0.29",
"puppeteer": "^11.0.0",
"tree-kill": "^1.2.2" "tree-kill": "^1.2.2"
}, },
"files": [ "files": [

View File

@@ -14,6 +14,6 @@ tap.test('should get and stop an Incognito browser', async () => {
await incognitoInstance.start(); await incognitoInstance.start();
const page = await incognitoInstance.browser.newPage(); const page = await incognitoInstance.browser.newPage();
await incognitoInstance.stop(); await incognitoInstance.stop();
}) });
tap.start(); tap.start();

View File

@@ -35,7 +35,7 @@ export class IncognitoBrowser {
/** /**
* rotate * rotate
*/ */
public async rotateBrowser () { public async rotateBrowser() {
this.browser.close().catch(); this.browser.close().catch();
this.browser = await getEnvAwareBrowserInstance(); this.browser = await getEnvAwareBrowserInstance();
} }

View File

@@ -25,7 +25,16 @@ export const getEnvAwareBrowserInstance = async (
console.log(chromeArgs); console.log(chromeArgs);
headlessBrowser = await plugins.puppeteer.launch({ headlessBrowser = await plugins.puppeteer.launch({
args: chromeArgs, args: chromeArgs,
pipe: true pipe: true,
headless: true,
...(() => {
const returnObject: any = {};
const googleChrome = plugins.smartshell.which.sync('google-chrome')
if(googleChrome) {
returnObject.executablePath = googleChrome
}
return returnObject;
})()
}); });
return headlessBrowser; return headlessBrowser;

View File

@@ -6,8 +6,9 @@ export { os };
// @pushrocks scope // @pushrocks scope
import * as smartdelay from '@pushrocks/smartdelay'; import * as smartdelay from '@pushrocks/smartdelay';
import * as smartenv from '@pushrocks/smartenv'; import * as smartenv from '@pushrocks/smartenv';
import * as smartshell from '@pushrocks/smartshell';
export { smartdelay, smartenv }; export { smartdelay, smartenv, smartshell };
// third party scope // third party scope
import puppeteer from 'puppeteer'; import puppeteer from 'puppeteer';