OpenVeo test API

API Docs for: 8.0.0
Show:

browser

Defined in: lib/e2e/browser.js:7
Module: e2e

static

Summary

Helps using some protractor browser's features.

Item Index

Methods

Methods

click

Syntax

click

(
  • elementFinder
  • [delay]
)
Promise static

Summary

Clicks on an element.

There are many issues with click events in web drivers, the same click is sometimes performed, and sometimes not. Moving the cursor to the element then performing a click seems to be more stable. It also checks if the element is clickable before clicking on it.

Also the banner in position fix prevent the driver to click on elements behind it. To avoid this problem, scroll up to the element minus the height of the banner.

Parameters:

  • elementFinder ElementFinder

    The element to click

  • [delay] Number optional

    The delay in milliseconds to wait before clicking on the element

Returns:

Promise:

Promise resolving when element is clicked

deactivateAnimations

Syntax

deactivateAnimations

() static

Summary

Disables all animations.

Example:

var browserAPI = require('@openveo/test').e2e.browser;
browserAPI.deactivateAnimations();

init

Syntax

init

() Promise static

Summary

Sets process.protractorConf to the configuration of the actual capability.

Returns:

Promise:

Promise resolving when init is done

Example:

var browserAPI = require('@openveo/test').e2e.browser;
browserAPI.init();

setSize

Syntax

setSize

(
  • width
  • height
)
Promise static

Summary

Sets browser's size.

Parameters:

  • width Number

    The browser width in px

  • height Number

    The browser height in px

Returns:

Promise:

Promise resolving when the browser size is set

Example:

var browserAPI = require('@openveo/test').e2e.browser;
browserAPI.setSize(800, 600);

takeScreenshot

Syntax

takeScreenshot

(
  • file
  • fileName
)
Promise static

Summary

Takes a screenshot of the actual browser state.

Parameters:

  • file String

    The screenshot file path

  • fileName String

    The screenshot file name without the extension

Returns:

Promise:

Promise resolving when the capture is made

Example:

var browserAPI = require('@openveo/test').e2e.browser;
browserAPI.takeScreenshot('/tmp', 'myScreenshot');

writeScreenShot

Syntax

writeScreenShot

(
  • data
  • file
  • callback
)
private static

Summary

Writes screenshot to a file.

Parameters:

  • data String

    Screenshot data

  • file String

    Screenshot final file path

  • callback Function

    The function to call when done

    • Error The error if an error occurred, null otherwise