@auxcode/auxta 0.3.6 → 0.3.7

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auxcode/auxta",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "",
5
5
  "main": "src/AuxTA.ts",
6
6
  "scripts": {
@@ -18,7 +18,7 @@ export class FunctionHelper {
18
18
  const splitedQuotes = text.replace(/'/g, `', "'", '`)
19
19
  return `concat('${splitedQuotes}', '')`;
20
20
  }
21
-
21
+
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{
@@ -96,9 +96,10 @@ export class FunctionHelper {
96
96
  * @param selector - class to select
97
97
  * @param time
98
98
  * @param page
99
+ * @param log_message
99
100
  */
100
101
 
101
- public async waitForSelector(option: string, selector: string, time: number = this.defaultTimeout, page = puppeteer.defaultPage) {
102
+ public async waitForSelector(option: string, selector: string, time: number = this.defaultTimeout, page = puppeteer.defaultPage,log_message = true) {
102
103
  const message = `I check for the '${selector}' element to be ${option}`;
103
104
  try{
104
105
  await page.waitForSelector(selector, {
@@ -106,10 +107,14 @@ export class FunctionHelper {
106
107
  timeout: time
107
108
  });
108
109
  } catch (e){
109
- log.push('And', message, StatusOfStep.FAILED);
110
+ if (log_message) {
111
+ log.push('And', message, StatusOfStep.FAILED);
112
+ }
110
113
  throw new Error(message)
111
114
  }
112
- log.push('And', message, StatusOfStep.PASSED);
115
+ if (log_message) {
116
+ log.push('And', message, StatusOfStep.PASSED);
117
+ }
113
118
  }
114
119
 
115
120
  public async click(selector: string, logMessages = true, page = puppeteer.defaultPage) {