fix(core): update
This commit is contained in:
parent
ed1522062e
commit
87d7460183
7
package-lock.json
generated
7
package-lock.json
generated
@ -11,7 +11,8 @@
|
||||
"dependencies": {
|
||||
"@pushrocks/smartdelay": "^2.0.13",
|
||||
"@pushrocks/smartenv": "^4.0.16",
|
||||
"puppeteer": "^10.2.0"
|
||||
"puppeteer": "^10.2.0",
|
||||
"tree-kill": "^1.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.26",
|
||||
@ -13680,7 +13681,6 @@
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://verdaccio.lossless.one/tree-kill/-/tree-kill-1.2.2.tgz",
|
||||
"integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"tree-kill": "cli.js"
|
||||
@ -24975,8 +24975,7 @@
|
||||
"tree-kill": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://verdaccio.lossless.one/tree-kill/-/tree-kill-1.2.2.tgz",
|
||||
"integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",
|
||||
"dev": true
|
||||
"integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A=="
|
||||
},
|
||||
"trim-right": {
|
||||
"version": "1.0.1",
|
||||
|
@ -23,7 +23,8 @@
|
||||
"dependencies": {
|
||||
"@pushrocks/smartdelay": "^2.0.13",
|
||||
"@pushrocks/smartenv": "^4.0.16",
|
||||
"puppeteer": "^10.2.0"
|
||||
"puppeteer": "^10.2.0",
|
||||
"tree-kill": "^1.2.2"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
|
@ -5,7 +5,15 @@ tap.test('first test', async (tools) => {
|
||||
const headlessBrowser = await smartpuppeteer.getEnvAwareBrowserInstance({
|
||||
forceNoSandbox: true,
|
||||
});
|
||||
const page = await headlessBrowser.newPage();
|
||||
await headlessBrowser.close();
|
||||
});
|
||||
|
||||
tap.test('should get and stop an Incognito browser', async () => {
|
||||
const incognitoInstance = new smartpuppeteer.IncognitoBrowser();
|
||||
await incognitoInstance.start();
|
||||
const page = await incognitoInstance.browser.newPage();
|
||||
await incognitoInstance.stop();
|
||||
})
|
||||
|
||||
tap.start();
|
||||
|
@ -28,6 +28,7 @@ export class IncognitoBrowser {
|
||||
*/
|
||||
public async stop() {
|
||||
this.status = 'stopped';
|
||||
plugins.treeKill(this.browser.process().pid);
|
||||
await this.browser.close();
|
||||
}
|
||||
|
||||
|
@ -11,5 +11,6 @@ export { smartdelay, smartenv };
|
||||
|
||||
// third party scope
|
||||
import puppeteer from 'puppeteer';
|
||||
import treeKill from 'tree-kill';
|
||||
|
||||
export { puppeteer };
|
||||
export { puppeteer, treeKill };
|
||||
|
Loading…
Reference in New Issue
Block a user