Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 2.61 KB

QPage.md

File metadata and controls

45 lines (29 loc) · 2.61 KB

Quixote API: QPage

QPage instances represent the overall browser page. You can get an instance by calling QFrame.page(). You'll use its properties in your assertions.

Properties

Use these properties in your assertions.

Compatibility Notes:

  • We aren't aware of a standard way to get the dimensions of the page. We have implemented a solution that works on our tested browsers, but it may not work on all browsers. If you use these properties, perform a visual check to make sure they're working as expected. If they aren't, please file an issue.

  • In particular, the current solution for page dimensions only works on pages in standards mode. Specifically, they have been tested on pages using <!DOCTYPE html>. They do not work on pages without a doctype. If support for another doctype is important to you, please let us know by opening an issue.

Pixel Rounding Note: Browsers handle pixel rounding in different ways. We consider pixel values to be the same if they're within 0.5px of each other. If you have rounding errors that are greater than 0.5px, make sure your test browsers are set to a zoom level of 100%. Zooming can exaggerate rounding errors.

Positions and Sizes

Stability: 3 - Stable

These properties describe the dimensions of the entire page, regardless of how much is scrolled out of view. The page is always at least as big as the viewport. By using page properties in your element assertions, you can assert where elements are positioned relative to the overall page.

Example:

var page = frame.page();
sidebar.right.should.equal(page.right);    // The sidebar should be flush to the right side of the page
sidebar.height.should.equal(page.height);  // The sidebar height should equal the page height