@auxcode/auxta 0.3.3 → 0.3.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.
package/package.json
CHANGED
|
@@ -22,21 +22,17 @@ export class FunctionHelper {
|
|
|
22
22
|
public async clickByText(selector: string, text: string, page = puppeteer.defaultPage) {
|
|
23
23
|
const message = `I click on the '${text}' '${selector}'`;
|
|
24
24
|
try{
|
|
25
|
-
await page.waitForSelector(selector, {
|
|
26
|
-
timeout: this.defaultTimeout
|
|
27
|
-
});
|
|
28
25
|
const [linkHandlers] = await page.$x(`//${selector}[. = ${this.getEscapedText(text)}]`);
|
|
29
26
|
|
|
30
27
|
if (linkHandlers) {
|
|
31
|
-
log.push('Then', message, StatusOfStep.PASSED);
|
|
32
28
|
await linkHandlers.click();
|
|
29
|
+
log.push('Then', message, StatusOfStep.PASSED);
|
|
33
30
|
return;
|
|
34
31
|
}
|
|
35
32
|
} catch (e){
|
|
36
33
|
}
|
|
37
34
|
log.push('Then', message, StatusOfStep.FAILED);
|
|
38
35
|
throw new Error(message);
|
|
39
|
-
|
|
40
36
|
}
|
|
41
37
|
|
|
42
38
|
public async waitForSelectorWithText(selector: string, text: string, page = puppeteer.defaultPage) {
|
|
@@ -137,7 +133,7 @@ export class FunctionHelper {
|
|
|
137
133
|
let message = `I am on the ${selector} page`
|
|
138
134
|
if (!url.includes(selector)) {
|
|
139
135
|
log.push('And', message, StatusOfStep.FAILED);
|
|
140
|
-
throw new Error(
|
|
136
|
+
throw new Error(message)
|
|
141
137
|
}
|
|
142
138
|
log.push('And', message, StatusOfStep.PASSED);
|
|
143
139
|
}
|