@auxcode/auxta 1.3.19-beta.12 → 1.3.19-beta.13
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.
- package/build/cjs/macros/helpers/code.helper.d.ts +1 -1
- package/build/cjs/macros/helpers/code.helper.js +12 -7
- package/build/esm/macros/helpers/code.helper.d.ts +1 -1
- package/build/esm/macros/helpers/code.helper.js +12 -7
- package/build/tsconfig-cjs.tsbuildinfo +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@ export declare class FunctionHelper extends ExtendDefaultPage {
|
|
|
16
16
|
clickAndWaitForPageToBeCreated(selector: string, page?: import("puppeteer").Page): Promise<void>;
|
|
17
17
|
closeLastPage(page?: import("puppeteer").Page): Promise<void>;
|
|
18
18
|
microsoftLogin(button: string, email: string, password: string): Promise<void>;
|
|
19
|
-
clickInMail(from_email: string): Promise<boolean
|
|
19
|
+
clickInMail(from_name: string, from_email: string, subject: string): Promise<boolean>;
|
|
20
20
|
private getHeader;
|
|
21
21
|
}
|
|
22
22
|
declare const _default: FunctionHelper;
|
|
@@ -189,8 +189,11 @@ class FunctionHelper extends extend_default_page_1.ExtendDefaultPage {
|
|
|
189
189
|
yield loginPage.waitForNetworkIdle();
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
-
clickInMail(from_email) {
|
|
192
|
+
clickInMail(from_name, from_email, subject) {
|
|
193
193
|
return __awaiter(this, void 0, void 0, function* () {
|
|
194
|
+
from_name = from_name.toLocaleLowerCase();
|
|
195
|
+
from_email = from_email.toLocaleLowerCase();
|
|
196
|
+
subject = subject.toLocaleLowerCase();
|
|
194
197
|
yield AuxGoogleAuth_1.AuxGoogleAuth.setup();
|
|
195
198
|
const res = yield AuxGoogleAuth_1.AuxGoogleAuth.gmailClient.users.messages.list({
|
|
196
199
|
userId: config_1.config.googleEmail,
|
|
@@ -198,8 +201,7 @@ class FunctionHelper extends extend_default_page_1.ExtendDefaultPage {
|
|
|
198
201
|
});
|
|
199
202
|
const messagesIds = res.data.messages;
|
|
200
203
|
if (!messagesIds || messagesIds.length === 0) {
|
|
201
|
-
|
|
202
|
-
return;
|
|
204
|
+
throw new Error('No messagesIds found.');
|
|
203
205
|
}
|
|
204
206
|
let timeoutCount = 12000;
|
|
205
207
|
yield this.timeout(12000);
|
|
@@ -208,8 +210,10 @@ class FunctionHelper extends extend_default_page_1.ExtendDefaultPage {
|
|
|
208
210
|
if (messageId.id) {
|
|
209
211
|
const message = yield AuxGoogleAuth_1.AuxGoogleAuth.gmailClient.users.messages.get({ userId: config_1.config.googleEmail, id: messageId.id.toString(), format: 'FULL' });
|
|
210
212
|
if (message.data.payload) {
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
+
const message_sender = this.getHeader('from', message.data.payload.headers);
|
|
214
|
+
const message_subject = this.getHeader('subject', message.data.payload.headers);
|
|
215
|
+
if (message_sender.includes(from_email) && message_sender.includes(from_name) && message_subject.includes(subject)) {
|
|
216
|
+
yield this.log('Then', `Email from ${from_name} ${from_email} with subject ${subject} is found`, AuxTA_1.StepStatus.PASSED);
|
|
213
217
|
return true;
|
|
214
218
|
}
|
|
215
219
|
}
|
|
@@ -219,13 +223,14 @@ class FunctionHelper extends extend_default_page_1.ExtendDefaultPage {
|
|
|
219
223
|
yield this.timeout(12000);
|
|
220
224
|
timeoutCount += 12000;
|
|
221
225
|
}
|
|
222
|
-
|
|
226
|
+
yield this.log('Then', `Email from ${from_name} ${from_email} with subject ${subject} is found`, AuxTA_1.StepStatus.PASSED);
|
|
227
|
+
throw new Error(`Email from ${from_name} ${from_email} with subject ${subject} is found`);
|
|
223
228
|
});
|
|
224
229
|
}
|
|
225
230
|
getHeader(value, headers) {
|
|
226
231
|
for (const header of headers) {
|
|
227
232
|
if (header.name.toLocaleLowerCase() === value.toLocaleLowerCase()) {
|
|
228
|
-
return header.value;
|
|
233
|
+
return header.value.toLocaleLowerCase();
|
|
229
234
|
}
|
|
230
235
|
}
|
|
231
236
|
}
|
|
@@ -16,7 +16,7 @@ export declare class FunctionHelper extends ExtendDefaultPage {
|
|
|
16
16
|
clickAndWaitForPageToBeCreated(selector: string, page?: import("puppeteer").Page): Promise<void>;
|
|
17
17
|
closeLastPage(page?: import("puppeteer").Page): Promise<void>;
|
|
18
18
|
microsoftLogin(button: string, email: string, password: string): Promise<void>;
|
|
19
|
-
clickInMail(from_email: string): Promise<boolean
|
|
19
|
+
clickInMail(from_name: string, from_email: string, subject: string): Promise<boolean>;
|
|
20
20
|
private getHeader;
|
|
21
21
|
}
|
|
22
22
|
declare const _default: FunctionHelper;
|
|
@@ -183,8 +183,11 @@ export class FunctionHelper extends ExtendDefaultPage {
|
|
|
183
183
|
yield loginPage.waitForNetworkIdle();
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
|
-
clickInMail(from_email) {
|
|
186
|
+
clickInMail(from_name, from_email, subject) {
|
|
187
187
|
return __awaiter(this, void 0, void 0, function* () {
|
|
188
|
+
from_name = from_name.toLocaleLowerCase();
|
|
189
|
+
from_email = from_email.toLocaleLowerCase();
|
|
190
|
+
subject = subject.toLocaleLowerCase();
|
|
188
191
|
yield AuxGoogleAuth.setup();
|
|
189
192
|
const res = yield AuxGoogleAuth.gmailClient.users.messages.list({
|
|
190
193
|
userId: config.googleEmail,
|
|
@@ -192,8 +195,7 @@ export class FunctionHelper extends ExtendDefaultPage {
|
|
|
192
195
|
});
|
|
193
196
|
const messagesIds = res.data.messages;
|
|
194
197
|
if (!messagesIds || messagesIds.length === 0) {
|
|
195
|
-
|
|
196
|
-
return;
|
|
198
|
+
throw new Error('No messagesIds found.');
|
|
197
199
|
}
|
|
198
200
|
let timeoutCount = 12000;
|
|
199
201
|
yield this.timeout(12000);
|
|
@@ -202,8 +204,10 @@ export class FunctionHelper extends ExtendDefaultPage {
|
|
|
202
204
|
if (messageId.id) {
|
|
203
205
|
const message = yield AuxGoogleAuth.gmailClient.users.messages.get({ userId: config.googleEmail, id: messageId.id.toString(), format: 'FULL' });
|
|
204
206
|
if (message.data.payload) {
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
+
const message_sender = this.getHeader('from', message.data.payload.headers);
|
|
208
|
+
const message_subject = this.getHeader('subject', message.data.payload.headers);
|
|
209
|
+
if (message_sender.includes(from_email) && message_sender.includes(from_name) && message_subject.includes(subject)) {
|
|
210
|
+
yield this.log('Then', `Email from ${from_name} ${from_email} with subject ${subject} is found`, StepStatus.PASSED);
|
|
207
211
|
return true;
|
|
208
212
|
}
|
|
209
213
|
}
|
|
@@ -213,13 +217,14 @@ export class FunctionHelper extends ExtendDefaultPage {
|
|
|
213
217
|
yield this.timeout(12000);
|
|
214
218
|
timeoutCount += 12000;
|
|
215
219
|
}
|
|
216
|
-
|
|
220
|
+
yield this.log('Then', `Email from ${from_name} ${from_email} with subject ${subject} is found`, StepStatus.PASSED);
|
|
221
|
+
throw new Error(`Email from ${from_name} ${from_email} with subject ${subject} is found`);
|
|
217
222
|
});
|
|
218
223
|
}
|
|
219
224
|
getHeader(value, headers) {
|
|
220
225
|
for (const header of headers) {
|
|
221
226
|
if (header.name.toLocaleLowerCase() === value.toLocaleLowerCase()) {
|
|
222
|
-
return header.value;
|
|
227
|
+
return header.value.toLocaleLowerCase();
|
|
223
228
|
}
|
|
224
229
|
}
|
|
225
230
|
}
|