froth-webdriverio-framework 2.0.18 → 2.0.20

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/api/loginapi.js CHANGED
@@ -9,7 +9,8 @@ async function getLoginToken(frothUrl, email, password) {
9
9
  const formData = new FormData();
10
10
  formData.append('email_or_username', email);
11
11
  formData.append('password', Buffer.from(password, 'base64').toString('utf-8'));
12
-
12
+ formData.append('is_ad_user',false)
13
+
13
14
  const response = await fetch(url, {
14
15
  method: 'POST',
15
16
  headers: {
@@ -3,26 +3,25 @@
3
3
  async function assertText(driver, elementSelector, expectedText) {
4
4
 
5
5
  try {
6
- console.log("inside the assert text function")
6
+ console.log("inside the assert text function" + elementSelector)
7
7
  // Wait for the element to be visible
8
- await driver.waitUntil(async () => {
9
- const element = await driver.$(elementSelector);
10
- return await element.isDisplayed();
11
- }, { timeout: 30000 });
12
8
 
13
9
  // Get the actual text from the element
14
10
  const element = await driver.$(elementSelector);
11
+ console.log("actual text is:" + element)
15
12
  const actualText = await element.getText();
13
+ console.log("actual text is:" + actualText)
14
+
16
15
 
17
16
  // Compare the actual text with the expected text
18
17
  if (actualText == expectedText) {
19
- console.log('Assertion passed. Actual text:', actualText, 'Expected text:', expectedText);
20
- driver.execute('browserstack_executor: {"action": "annotate", "arguments": {"data":"Assertion passed. Actual text:'+actualText+'",Expected text:"'+expectedText+'","level": "info"}}');
21
- return true;
18
+ let annotationMessage = `Assertion pass. Actual text: ${actualText}, Expected text: ${expectedText}.`;
19
+ console.log(`Assertion pass. Actual text: ${actualText}, Expected text: ${expectedText}.`);
20
+ // await driver.execute(`browserstack_executor: {"action": "annotate", "arguments": {"data":"${annotationMessage}","level": "info"}}`);
22
21
  } else {
23
- driver.execute('browserstack_executor: {"action": "annotate", "arguments": {"data":"Assertion failed. Actual text:'+actualText+'",Expected text:"'+expectedText+'","level": "error"}}');
24
- console.error('Assertion failed. Actual text:', actualText, 'Expected text:', expectedText);
25
- throw error;
22
+ let annotationMessage = `Assertion fail. Actual text: ${actualText}, Expected text: ${expectedText}.`;
23
+ console.log(`Assertion fail. Actual text: ${actualText}, Expected text: ${expectedText}.`);
24
+ // await driver.execute(`browserstack_executor: {"action": "annotate", "arguments": {"data":"${annotationMessage}","level": "info"}}`);
26
25
  }
27
26
  } catch (error) {
28
27
  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.18",
3
+ "version": "2.0.20",
4
4
  "readme": "WebdriverIO Integration",
5
5
  "description": "WebdriverIO and BrowserStack App Automate",
6
6
  "license": "MIT",