Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View roydekleijn's full-sized avatar

Roy de Kleijn roydekleijn

View GitHub Profile
@roydekleijn
roydekleijn / LocalStorage.java
Created March 2, 2013 22:35
Selenium WebDriver Javascript execution for localStorage
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
public class LocalStorage {
private JavascriptExecutor js;
public LocalStorage(WebDriver webDriver) {
this.js = (JavascriptExecutor) webDriver;
}
@roydekleijn
roydekleijn / SessionStorage.java
Created October 29, 2012 21:15
Selenium WebDriver Javascript execution for sessionStorage
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
public class SessionStorage {
private JavascriptExecutor js;
public SessionStorage(WebDriver driver) {
this.js = (JavascriptExecutor) driver;
}
@roydekleijn
roydekleijn / WaitUtil.java
Last active April 12, 2019 10:49
checkPendingRequests - checks for pending HTTP requests
package example;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.support.events.EventFiringWebDriver;
public class WaitUtil {
public static void checkPendingRequests(final String context, final EventFiringWebDriver driver) {
final int timeoutInNumberOfTries = 50;
try {
@roydekleijn
roydekleijn / SelectWrapper.ts
Created January 22, 2018 21:52
Wrapper for interacting with selectbox elements in protractor.
import {by, element} from 'protractor';
export class SelectWrapper {
select: any;
constructor(select: any) {
this.select = element(select);
}
getOptions() {
@roydekleijn
roydekleijn / tsconfig.json
Created October 20, 2017 12:01
Basic typescript config
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "target/specs",
"types": ["jasmine", "node"]
},
"exclude": [
"node_modules"
@roydekleijn
roydekleijn / config.js
Created October 20, 2017 12:00
Basic jasmine config
exports.config = {
framework: 'jasmine2',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: './target/specs/**/*_spec.js',
baseUrl: 'http://demo.seleniuminaction.com',
getPageTimeout: 10000,
allScriptsTimeout: 10000,
capabilities: {
'browserName': 'chrome',
!***> Fixture code locations
|Import |
|nl.hsac.fitnesse.fixture |
|nl.hsac.fitnesse.fixture.slim |
|nl.hsac.fitnesse.fixture.slim.web|
*!
!***> Libraries
|Library |
|string fixture|
@roydekleijn
roydekleijn / pom.xml
Created July 29, 2017 07:56
HSAC project base
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>sample-hsac-project</groupId>
<artifactId>hsac-project</artifactId>
<version>1.0.0-SNAPSHOT</version>
@roydekleijn
roydekleijn / findAngularBinding.js
Created June 17, 2016 05:30
This snippet can be used to retrieve the binding names.
Call angular.reloadWithDebugInfo(); in your browser debug console
Execute the following snippet to reveal all the elements:
var bindings = document.getElementsByClassName('ng-binding');
for (var i = 0; i < bindings.length; ++i) {
var bindingName = angular.element(bindings[i]).data().$binding[0].exp ||angular.element(bindings[i]).data().$binding;
console.log(bindingName.toString());
console.log(bindings[i]);
}