froth-webdriverio-framework 2.0.22 → 2.0.25

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.
@@ -7,22 +7,23 @@ async function assertText(driver, elementSelector, expectedText) {
7
7
  // Wait for the element to be visible
8
8
 
9
9
  // Get the actual text from the element
10
- // const element = await driver.$(elementSelector);
11
- // console.log("actual text is:" + element)
12
- const actualText = await driver.$(elementSelector).map((ele) => ele.getText())
13
- // const actualText = await element.getText();
14
- console.log("actual text is:" + actualText)
10
+ // const element = await driver.$(elementSelector);
11
+ // console.log("actual text is:" + element)
12
+ const element = await driver.$(elementSelector)
13
+ // const actualText = await element.getText();
14
+ await expect(element).toHaveText(expectedText)
15
15
 
16
+ //console.log("actual text is:" + actualText)
16
17
 
17
18
  // Compare the actual text with the expected text
18
19
  if (actualText == expectedText) {
19
20
  let annotationMessage = `Assertion pass. Actual text: ${actualText}, Expected text: ${expectedText}.`;
20
21
  console.log(`Assertion pass. Actual text: ${actualText}, Expected text: ${expectedText}.`);
21
- // await driver.execute(`browserstack_executor: {"action": "annotate", "arguments": {"data":"${annotationMessage}","level": "info"}}`);
22
+ // await driver.execute(`browserstack_executor: {"action": "annotate", "arguments": {"data":"${annotationMessage}","level": "info"}}`);
22
23
  } else {
23
24
  let annotationMessage = `Assertion fail. Actual text: ${actualText}, Expected text: ${expectedText}.`;
24
25
  console.log(`Assertion fail. Actual text: ${actualText}, Expected text: ${expectedText}.`);
25
- // await driver.execute(`browserstack_executor: {"action": "annotate", "arguments": {"data":"${annotationMessage}","level": "info"}}`);
26
+ // await driver.execute(`browserstack_executor: {"action": "annotate", "arguments": {"data":"${annotationMessage}","level": "info"}}`);
26
27
  }
27
28
  } catch (error) {
28
29
  console.error('Error occurred while verifying text:', error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "2.0.22",
3
+ "version": "2.0.25",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",