Class: Page

e2e/pages/Page~Page()

Page

Constructor

new Page()

Defines a web page to help writing end to end tests with protractor for OpenVeo.

Do not use this directly but extend it.

Source:
Example
var Page = require('@openveo/test').e2e.pages.Page;

function MyPage() {
  MyPage.super_.call(this);
  this.path = 'be/myPage';
}

module.exports = MyPage;
util.inherits(MyPage, Page);

var page = new MyPage();
page.load().then(function() {
  console.log('Page fully loaded');
});

Members

(readonly) bodyElement :Object

Body element.

Type:
  • Object
Source:

(readonly) EC :Object

Protractor expected conditions.

Type:
  • Object
Source:

(readonly) flow :Object

Protractor control flow.

Type:
  • Object
Source:

(readonly) pageElement :Object

Page element.

Page wrapper holding the content scrollbar.

Type:
  • Object
Source:

Methods

deleteCookies() → {Promise}

Removes all cookies on the actual page.

Source:
Returns:

Promise resolving when all cookies are deleted

Type
Promise

getPath() → {Promise}

Helper Url Get only current url path without host

Source:
Returns:

Promise resolving with current path

Type
Promise

getTitle() → {Promise}

Gets page title as described by the HTMLTitleElement.

Source:
Returns:

Promise resolving with the title of the page

Type
Promise
Example
// With MyPage extending Page
var page = new MyPage();
assert.eventually.equal(page.getTitle(), 'My page title');

load() → {Promise}

Loads the page.

Source:
Returns:

Promise resolving when the page is fully loaded

Type
Promise
Example
var Page = require('@openveo/test').e2e.pages.Page;

function MyPage() {
  MyPage.super_.call(this);
  this.path = 'be/myPage';
}

module.exports = MyPage;
util.inherits(MyPage, Page);

var page = new MyPage();
page.load().then(function() {
  console.log('Page fully loaded');
});

onLoaded() → {Promise}

Handles page loaded.

Use this method to perform actions after the page is loaded. Typically, verify that the page is loaded by waiting for elements to be present on the page.

By default it does nothing, override it to define your own behaviour.

Source:
Returns:

Promise resolving when the page is fully loaded

Type
Promise

refresh() → {Promise}

Refreshes actual page.

Source:
Returns:

Promise resolving when the page is fully loaded

Type
Promise

sendRequest(path, method, data) → {Promise}

Sends an http request and return its reponse.

This will execute the request from the page.

Parameters:
Name Type Description
path String

Request's path

method String

HTTP method to use

data Object

Request's data to send in body

Source:
Returns:

Promise resolving with the request's response

Type
Promise