@auxcode/auxta 1.3.73-beta.3 → 1.3.73-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.AuxGoogleAuth = void 0;
|
|
39
39
|
const config_1 = require("../../auxta/configs/config");
|
|
40
|
-
const
|
|
40
|
+
const puppeteer_1 = __importDefault(require("../../puppeteer/puppeteer"));
|
|
41
41
|
const code_helper_1 = __importDefault(require("../helpers/code.helper"));
|
|
42
42
|
const status_of_step_1 = __importDefault(require("../../auxta/enums/status-of.step"));
|
|
43
43
|
const fs = require('fs');
|
|
@@ -175,11 +175,10 @@ class AuxGoogleAuth {
|
|
|
175
175
|
static LogIn(authUrl) {
|
|
176
176
|
var _a, _b;
|
|
177
177
|
return __awaiter(this, void 0, void 0, function* () {
|
|
178
|
-
yield puppeteer_extra_1.default.startBrowser();
|
|
179
178
|
const email = EMAIL ? EMAIL : process.env.google_account;
|
|
180
179
|
const password = PASSWORD ? PASSWORD : process.env.google_password;
|
|
181
180
|
if (email && password) {
|
|
182
|
-
const context = yield
|
|
181
|
+
const context = yield puppeteer_1.default.defaultPage.browser().createIncognitoBrowserContext();
|
|
183
182
|
const page = yield context.newPage();
|
|
184
183
|
yield page.goto(authUrl);
|
|
185
184
|
yield code_helper_1.default.waitForSelector('visible', '#identifierId', config_1.config.timeout, page);
|
|
@@ -210,7 +209,6 @@ class AuxGoogleAuth {
|
|
|
210
209
|
const code = currentUrl.substring(currentUrl.indexOf("code=") + 5, currentUrl.lastIndexOf("&"));
|
|
211
210
|
code_helper_1.default.log('Then', 'I get the code form the url', status_of_step_1.default.PASSED);
|
|
212
211
|
yield page.close();
|
|
213
|
-
yield puppeteer_extra_1.default.close();
|
|
214
212
|
return decodeURIComponent(code);
|
|
215
213
|
}
|
|
216
214
|
else {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UploadModel } from "../auxta/models/upload.model";
|
|
2
|
-
import
|
|
2
|
+
import puppeteerN = require("puppeteer");
|
|
3
3
|
export declare class Puppeteer {
|
|
4
|
-
defaultPage:
|
|
4
|
+
defaultPage: puppeteerN.Page;
|
|
5
5
|
private browser;
|
|
6
6
|
startBrowser(): Promise<void>;
|
|
7
7
|
close(): Promise<void>;
|
|
@@ -21,7 +21,7 @@ const status_of_step_1 = require("../auxta/enums/status-of.step");
|
|
|
21
21
|
const config_1 = require("../auxta/configs/config");
|
|
22
22
|
const start_suite_helper_1 = require("../auxta/utilities/start-suite.helper");
|
|
23
23
|
const report_service_1 = require("../auxta/services/report.service");
|
|
24
|
-
const puppeteer = require("puppeteer");
|
|
24
|
+
const puppeteer = require("puppeteer-extra");
|
|
25
25
|
class Puppeteer {
|
|
26
26
|
startBrowser() {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -37,6 +37,8 @@ class Puppeteer {
|
|
|
37
37
|
DISPLAY: ":10.0"
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
+
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
|
|
41
|
+
puppeteer.default.use(StealthPlugin());
|
|
40
42
|
this.browser = yield puppeteer.default.launch({
|
|
41
43
|
slowMo: process.env.slowMo ? Number(process.env.slowMo) : 0,
|
|
42
44
|
executablePath: puppeteer.default.executablePath(),
|