@auxcode/auxta 1.3.73-beta.4 → 1.3.73-beta.5
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_extra_1 = __importDefault(require("../../puppeteer/puppeteer-extra"));
|
|
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');
|
|
@@ -177,8 +177,9 @@ class AuxGoogleAuth {
|
|
|
177
177
|
return __awaiter(this, void 0, void 0, function* () {
|
|
178
178
|
const email = EMAIL ? EMAIL : process.env.google_account;
|
|
179
179
|
const password = PASSWORD ? PASSWORD : process.env.google_password;
|
|
180
|
+
yield puppeteer_extra_1.default.startBrowser();
|
|
180
181
|
if (email && password) {
|
|
181
|
-
const context = yield
|
|
182
|
+
const context = yield puppeteer_extra_1.default.defaultPage.browser().createIncognitoBrowserContext();
|
|
182
183
|
const page = yield context.newPage();
|
|
183
184
|
yield page.goto(authUrl);
|
|
184
185
|
yield code_helper_1.default.waitForSelector('visible', '#identifierId', config_1.config.timeout, page);
|
|
@@ -209,9 +210,11 @@ class AuxGoogleAuth {
|
|
|
209
210
|
const code = currentUrl.substring(currentUrl.indexOf("code=") + 5, currentUrl.lastIndexOf("&"));
|
|
210
211
|
code_helper_1.default.log('Then', 'I get the code form the url', status_of_step_1.default.PASSED);
|
|
211
212
|
yield page.close();
|
|
213
|
+
yield puppeteer_extra_1.default.close();
|
|
212
214
|
return decodeURIComponent(code);
|
|
213
215
|
}
|
|
214
216
|
else {
|
|
217
|
+
yield puppeteer_extra_1.default.close();
|
|
215
218
|
throw new Error('The email or password for the google account are empty');
|
|
216
219
|
}
|
|
217
220
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UploadModel } from "../auxta/models/upload.model";
|
|
2
|
-
import
|
|
2
|
+
import puppeteer = require("puppeteer");
|
|
3
3
|
export declare class Puppeteer {
|
|
4
|
-
defaultPage:
|
|
4
|
+
defaultPage: puppeteer.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");
|
|
25
25
|
class Puppeteer {
|
|
26
26
|
startBrowser() {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -37,8 +37,6 @@ class Puppeteer {
|
|
|
37
37
|
DISPLAY: ":10.0"
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
|
|
41
|
-
puppeteer.default.use(StealthPlugin());
|
|
42
40
|
this.browser = yield puppeteer.default.launch({
|
|
43
41
|
slowMo: process.env.slowMo ? Number(process.env.slowMo) : 0,
|
|
44
42
|
executablePath: puppeteer.default.executablePath(),
|