froth-webdriverio-framework 2.0.5 → 2.0.6

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.
@@ -1,35 +1,20 @@
1
1
  // Function to verify text in Android app
2
- const assert = require('assert');
3
2
 
4
3
  async function assertText(driver, elementSelector, expectedText) {
5
- // try {
6
- // Wait for the element to be visible
7
- // await driver.waitUntil(async () => {
8
- // const element = await driver.$(elementSelector);
9
- // return await element.isDisplayed();
10
- // }, { timeout: 30000 });
4
+
5
+ // Wait for the element to be visible
6
+ await driver.waitUntil(async () => {
7
+ const element = await driver.$(elementSelector);
8
+ // return await element.isDisplayed();
9
+ }, { timeout: 30000 });
11
10
 
12
11
  // Get the actual text from the element
13
- // const element = await driver.$(elementSelector);
14
- // const actualText = await element.getText();
15
-
16
- console.log( 'Expected text:', expectedText);
17
- //expect(await browser.getTitle()).to.be.equal('Admin Area')
18
-
19
- await expect(elementSelector).toHaveText(expectedText)
20
-
21
- // assert.strictEqual(actualText, expectedText, `Expected title to be "${expectedText}", but found "${actualText}"`);
22
-
23
- // // Compare the actual text with the expected text
24
- // if (actualText === expectedText) {
25
- // console.log('Text verification passed. Actual text:', actualText, 'Expected text:', expectedText);
26
- // return true;
27
- // } else {
28
- // console.warn('Text verification failed. Actual text:', actualText, 'Expected text:', expectedText);
29
- // }
30
- // } catch (error) {
31
- // console.error('Error occurred while verifying text:', error);
32
- // }
12
+ const actualText = await element.getText();
13
+
14
+ console.log('Actual text:', actualText, 'Expected text:', expectedText);
15
+
16
+ await expect(actualText).toBe(expectedText, `Expected text to be "${expectedText}", but found "${actualText}"`);
17
+
33
18
  }
34
19
 
35
20
  module.exports = assertText;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",