@auxcode/auxta 1.3.73-beta.5 → 1.3.73-beta.6
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.
|
@@ -61,6 +61,7 @@ const TOKEN_PATH = 'token.json';
|
|
|
61
61
|
let TOKEN;
|
|
62
62
|
let EMAIL;
|
|
63
63
|
let PASSWORD;
|
|
64
|
+
let count = 0;
|
|
64
65
|
class AuxGoogleAuth {
|
|
65
66
|
static get oAuth2Client() {
|
|
66
67
|
return this._oAuth2Client;
|
|
@@ -178,34 +179,35 @@ class AuxGoogleAuth {
|
|
|
178
179
|
const email = EMAIL ? EMAIL : process.env.google_account;
|
|
179
180
|
const password = PASSWORD ? PASSWORD : process.env.google_password;
|
|
180
181
|
yield puppeteer_extra_1.default.startBrowser();
|
|
182
|
+
count++;
|
|
181
183
|
if (email && password) {
|
|
182
184
|
const context = yield puppeteer_extra_1.default.defaultPage.browser().createIncognitoBrowserContext();
|
|
183
185
|
const page = yield context.newPage();
|
|
184
186
|
yield page.goto(authUrl);
|
|
185
|
-
yield code_helper_1.default.waitForSelector('visible', '#identifierId', config_1.config.timeout, page);
|
|
187
|
+
yield code_helper_1.default.waitForSelector('visible', '#identifierId', config_1.config.timeout, page, count >= 2);
|
|
186
188
|
yield ((_a = (yield page.$('#identifierId'))) === null || _a === void 0 ? void 0 : _a.type(email));
|
|
187
189
|
yield (yield page.$$('button'))[3].click();
|
|
188
190
|
yield code_helper_1.default.timeout(4000);
|
|
189
|
-
yield code_helper_1.default.waitForSelector('visible', 'input[type="password"]', config_1.config.timeout, page);
|
|
191
|
+
yield code_helper_1.default.waitForSelector('visible', 'input[type="password"]', config_1.config.timeout, page, count >= 2);
|
|
190
192
|
yield ((_b = (yield page.$('input[type="password"]'))) === null || _b === void 0 ? void 0 : _b.type(password));
|
|
191
193
|
yield (yield page.$$('button'))[1].click();
|
|
192
194
|
yield code_helper_1.default.timeout(4000);
|
|
193
|
-
yield code_helper_1.default.waitForSelector('visible', '#headingText', config_1.config.timeout, page);
|
|
195
|
+
yield code_helper_1.default.waitForSelector('visible', '#headingText', config_1.config.timeout, page, count >= 2);
|
|
194
196
|
yield (yield page.$$('button'))[2].click();
|
|
195
197
|
yield code_helper_1.default.timeout(4000);
|
|
196
198
|
const checkbox = yield page.$$('input[type="checkbox"]');
|
|
197
199
|
if (checkbox.length > 0) {
|
|
198
|
-
yield code_helper_1.default.waitForSelector('visible', 'input[type="checkbox"]', config_1.config.timeout, page);
|
|
200
|
+
yield code_helper_1.default.waitForSelector('visible', 'input[type="checkbox"]', config_1.config.timeout, page, count >= 2);
|
|
199
201
|
yield checkbox[0].click();
|
|
200
202
|
yield (yield page.$$('button'))[2].click();
|
|
201
203
|
}
|
|
202
204
|
else {
|
|
203
|
-
yield code_helper_1.default.waitForSelector('visible', `div[data-email="${email.toLocaleLowerCase()}"]`, config_1.config.timeout, page);
|
|
205
|
+
yield code_helper_1.default.waitForSelector('visible', `div[data-email="${email.toLocaleLowerCase()}"]`, config_1.config.timeout, page, count >= 2);
|
|
204
206
|
yield code_helper_1.default.timeout(4000);
|
|
205
207
|
yield (yield page.$$('button'))[2].click();
|
|
206
208
|
}
|
|
207
209
|
yield code_helper_1.default.timeout(4000);
|
|
208
|
-
yield code_helper_1.default.waitForSelector('visible', 'body', config_1.config.timeout, page);
|
|
210
|
+
yield code_helper_1.default.waitForSelector('visible', 'body', config_1.config.timeout, page, count >= 2);
|
|
209
211
|
const currentUrl = page.url();
|
|
210
212
|
const code = currentUrl.substring(currentUrl.indexOf("code=") + 5, currentUrl.lastIndexOf("&"));
|
|
211
213
|
code_helper_1.default.log('Then', 'I get the code form the url', status_of_step_1.default.PASSED);
|