@auxcode/auxta 0.3.2 → 0.3.3
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
|
@@ -121,7 +121,7 @@ export class FunctionHelper {
|
|
|
121
121
|
await page.waitForSelector(selector, {
|
|
122
122
|
timeout: this.defaultTimeout
|
|
123
123
|
});
|
|
124
|
-
let elementName = await
|
|
124
|
+
let elementName = await page.$eval(selector, (e) => e.textContent);
|
|
125
125
|
if (!elementName || elementName === ' ') elementName = selector;
|
|
126
126
|
await page.click(selector);
|
|
127
127
|
log.push('Then', `I click on the '${elementName}'`, StatusOfStep.PASSED);
|
|
@@ -132,8 +132,8 @@ export class FunctionHelper {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
public async urlContains(selector: string) {
|
|
136
|
-
const url =
|
|
135
|
+
public async urlContains(selector: string, page = puppeteer.defaultPage) {
|
|
136
|
+
const url = page.url();
|
|
137
137
|
let message = `I am on the ${selector} page`
|
|
138
138
|
if (!url.includes(selector)) {
|
|
139
139
|
log.push('And', message, StatusOfStep.FAILED);
|