Skip to content

Instantly share code, notes, and snippets.

@sbley
sbley / browser.ts
Created March 18, 2019 20:23
Protractor cross-browser cross-device helpers
import { browser, by, ElementFinder, Key, promise, WebElement } from 'protractor';
import { hideMobileKeyboard } from './mobile';
import fullyResolved = promise.fullyResolved;
export const scrollToElement = (element: WebElement): promise.Promise<void> => {
return (
hideMobileKeyboard()
// Using scrollIntoView because it scrolls until the element is really in the viewport
// The common recommended way 'browser.actions().mouseMove(element).perform()' does not consider overlapping layers
// and does not work in all browsers.
@sbley
sbley / .travis.yml
Last active March 15, 2017 09:27
Travis CI configuration file for Angular
dist: trusty
sudo: required
language: node_js
node_js:
- "7"
os:
- linux
env:
global:
- DBUS_SESSION_BUS_ADDRESS=/dev/null