@auxcode/auxta 0.3.0 → 0.3.1
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
|
@@ -3,6 +3,7 @@ import { config } from "../configs/config";
|
|
|
3
3
|
|
|
4
4
|
export function startSuite(suites: string[], reportId?: string) {
|
|
5
5
|
console.log('Starting next suite: ' + suites[0]);
|
|
6
|
+
//todo on error, end the test
|
|
6
7
|
return axios.post(
|
|
7
8
|
`${config.netlifyPath}.netlify/functions/${suites.shift()}?token=${config.token}`,
|
|
8
9
|
{ nextSuites: suites, reportId: reportId}
|
|
@@ -106,11 +106,17 @@ export class FunctionHelper {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
public async click(className: string, page = puppeteer.defaultPage) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
try{
|
|
110
|
+
await page.waitForSelector(className);
|
|
111
|
+
let elementName = await puppeteer.defaultPage.$eval(className, (e) => e.textContent);
|
|
112
|
+
if (!elementName || elementName === ' ') elementName = className;
|
|
113
|
+
await page.click(className);
|
|
114
|
+
log.push('Then', `I click on the '${elementName}'`, StatusOfStep.PASSED);
|
|
115
|
+
} catch (e){
|
|
116
|
+
const msg = `I click on the '${className}'`;
|
|
117
|
+
log.push('Then', msg, StatusOfStep.FAILED);
|
|
118
|
+
throw new Error(msg)
|
|
119
|
+
}
|
|
114
120
|
}
|
|
115
121
|
|
|
116
122
|
public async urlContains(selector: string) {
|