Skip to content

Instantly share code, notes, and snippets.

@roydekleijn
roydekleijn / SelectWrapper.ts
Created Jan 22, 2018
Wrapper for interacting with selectbox elements in protractor.
View SelectWrapper.ts
import {by, element} from 'protractor';
export class SelectWrapper {
select: any;
constructor(select: any) {
this.select = element(select);
}
getOptions() {
@roydekleijn
roydekleijn / tsconfig.json
Created Oct 20, 2017
Basic typescript config
View tsconfig.json
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "target/specs",
"types": ["jasmine", "node"]
},
"exclude": [
"node_modules"
@roydekleijn
roydekleijn / config.js
Created Oct 20, 2017
Basic jasmine config
View config.js
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',
View gist:24f6868413e01fb97710e197e31d5989
!***> 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 Jul 29, 2017
HSAC project base
View pom.xml
<?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 Jun 17, 2016
This snippet can be used to retrieve the binding names.
View findAngularBinding.js
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]);
}
@roydekleijn
roydekleijn / WaitUtil.java
Last active Apr 12, 2019
checkPendingRequests - checks for pending HTTP requests
View WaitUtil.java
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 / LocalStorage.java
Created Mar 2, 2013
Selenium WebDriver Javascript execution for localStorage
View LocalStorage.java
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 Oct 29, 2012
Selenium WebDriver Javascript execution for sessionStorage
View SessionStorage.java
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
public class SessionStorage {
private JavascriptExecutor js;
public SessionStorage(WebDriver driver) {
this.js = (JavascriptExecutor) driver;
}