froth-webdriverio-framework 2.0.2 → 2.0.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.
@@ -1,17 +1,21 @@
1
1
  // Function to verify text in Android app
2
- async function assertText(driver, elementSelector, expectedText) {
3
- // try {
4
- // Wait for the element to be visible
5
- await driver.waitUntil(async () => {
6
- const element = await driver.$(elementSelector);
7
- return await element.isDisplayed();
8
- }, { timeout: 30000});
2
+ const assert = require('assert');
9
3
 
10
- // Get the actual text from the element
4
+ async function assertText(driver, elementSelector, expectedText) {
5
+ // try {
6
+ // Wait for the element to be visible
7
+ await driver.waitUntil(async () => {
11
8
  const element = await driver.$(elementSelector);
12
- const actualText = await element.getText();
9
+ return await element.isDisplayed();
10
+ }, { timeout: 30000 });
11
+
12
+ // Get the actual text from the element
13
+ const element = await driver.$(elementSelector);
14
+ const actualText = await element.getText();
13
15
 
14
- expect(actualText).toEqual(expectedText,`Expected title to be "${expectedText}", but found "${actualText}"`);
16
+ // expect(actualText).toEqual(expectedText,`Expected title to be "${expectedText}", but found "${actualText}"`);
17
+ console.log('Actual text:', actualText, 'Expected text:', expectedText);
18
+ assert.strictEqual(actualText, expectedText, `Expected title to be "${expectedText}", but found "${actualText}"`);
15
19
 
16
20
  // // Compare the actual text with the expected text
17
21
  // if (actualText === expectedText) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",
@@ -33,6 +33,7 @@
33
33
  "@wdio/spec-reporter": "^8.36.1",
34
34
  "appium": "^2.5.4",
35
35
  "appium-uiautomator2-driver": "^3.2.0",
36
+ "assert": "^2.1.0",
36
37
  "browserstack-local": "^1.5.5",
37
38
  "deepmerge": "^4.3.1",
38
39
  "form-data": "^4.0.0",