Skip to content

Instantly share code, notes, and snippets.

@DioNNiS
DioNNiS / Test1.java
Last active March 12, 2018 01:01
Functional Tests (E2E)
/*
Example of an acceptance test written without any of the layering:
*/
@Test
public void shouldDeductPaymentFromAccountBalance() {
selectURL(“http://my.test.bank.url");
enterText(“userNameFieldId”, “testUserName”);
enterText(“passwordFieldId”, “testPassword”);
click(“loginButtonId”);
waitForResponse(“loginSuccessIndicator”);
@DioNNiS
DioNNiS / angular-bootstrap-with-config.js
Created February 27, 2016 17:09
Initiate angular application with server config
(function(angular) {
'use strict';
fetchConfig().then(bootstrapApplication);
function fetchConfig() {
var injector = angular.injector(['ng']);
var $http = injector.get('$http');
return $http.get('config.json').then(function(response) {
@DioNNiS
DioNNiS / qunit test
Created June 2, 2014 11:21
qUnit: multiple async tests in one test
asyncTest( "multiple async setTimeout", function() {
expect( 4 );
// Limit total time to 2 sec.
var counter = 2, timeout = setTimeout(function() {start();}, 2000);
function done() { if(--counter === 0) {start(); clearTimeout(timeout);}}
var url = "http://jsfiddle.net/echo/jsonp/?callback=?";
$.getJSON( url, { a: 1 }, function( data ) {
@DioNNiS
DioNNiS / UANewsstandHelper.m
Created April 10, 2012 04:43 — forked from jtowle/UANewsstandHelper.m
UANewsstandHelper.m
/*
Copyright 2009-2011 Urban Airship Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binaryform must reproduce the above copyright notice,