Skip to content

Instantly share code, notes, and snippets.

View djangofan's full-sized avatar

Jon Austen djangofan

View GitHub Profile
@djangofan
djangofan / CreateThrowable.java
Created March 18, 2016 00:24
Class to create a Throwable in Java for testing expected exceptions from a mock framework.
package com.healthsparq.qa.framework.util;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
/**
* Use this to create a new Exception for a unit test.
*/
public class CreateThrowable
{
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.ContextLoader;
/**
* This class is responsible for determining which spring context should be used.
* This allows us to support running integration tests as a unit/integration tests and via web services.
* @ContextConfiguration(value = "classpath:test-beans.xml", loader = TestContextProvider.class)
* http://www.waitingforcode.com/spring-framework/context-loader-in-spring/read
@djangofan
djangofan / output.txt
Created October 29, 2015 02:28
Failed build - jmeter-gradle-plugin - 0.6.4
Closing this window will close Jmeter...
:clean
:printBuildScriptClasspath
Loading the following jmeter classpath jars...
jmeter-gradle-plugin-0.6.4-2.13.jar:java-libpst-0.8.1.jar:groovy-all-2.4.3.jar:opencsv-3.3.jar:activation-1.1.jar:guava-18.0.j
ar:commons-lang3-3.4.jar:jmeter-plugins-standard-1.3.1.jar:jmeter-plugins-common-1.3.1.jar:hsqldb-1.8.0.1.jar:jmeter-plugins-e
xtras-1.3.1.jar:excalibur-pool-instrumented-2.1.jar:avalon-framework-api-4.3.jar:jmeter-plugins-extras-libs-1.3.1.jar:jmeter-p
lugins-webdriver-1.3.1.jar:commons-math3-3.4.1.jar:commons-pool2-2.3.jar:ant-1.8.4.jar:avalon-framework-impl-4.3.jar:rendersna
ke-1.8.jar:soap-2.3.1.jar:bsh-core-2.0b4.jar:avalon-logkit-2.1.jar:ApacheJMeter_components-2.13.jar:htmllexer-2.1.jar:excalibu
@djangofan
djangofan / pom-jmeter.xml
Created September 16, 2015 20:25
For Jmeter, a 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>com.lazerycode.jmeter</groupId>
<artifactId>launch-jmeter</artifactId>
<version>1.0</version>
<description>https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Advanced-Configuration</description>
<name>launch-jmeter</name>
@djangofan
djangofan / ShootoutTestBase.java
Created September 2, 2015 17:45
Example test base showing Selenium browser/driver creation and destruction.
From https://github.com/djangofan/yet-another-selenium-framework
package qa.se.framework;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.ui.Sleeper;
import org.testng.ITestContext;
@djangofan
djangofan / MinorSwing.txt
Created August 30, 2015 20:00
Minor Swing Tab
E|-7p5p4-5-7-5-4-7-5-----------10-8-7------------------|
B|-------------------6----------------10-9h10p9--------|
G|---------------------7-4--10------------------10-7---|
D|---------------------------------------------------9-|
A|-----------------------------------------------------|
E|-----------------------------------------------------|
@djangofan
djangofan / gist:f615d49cf8ece2ec58a0
Last active January 8, 2017 19:14
QA sdet team working agreement
We couldn’t find that file to show.
@djangofan
djangofan / Rakefile
Created June 14, 2015 16:27
Rakefile example for passing parameters for optparse
require 'rake'
require 'rake/testtask'
# uses '--' args format because ruby 'optparse' lib wants it that way
# runs myapp tests with args client, env, and application
namespace :myapp do |args|
desc "Example test task."
Rake::TestTask.new do |t|
t.name = "runTestsReal"
@djangofan
djangofan / gist:d74c3ea8450d7c55f054
Last active September 7, 2016 20:29
A build.gradle to load Jmeter with all the Jmeter-plugins
// https://github.com/kulya/jmeter-gradle-plugin
// run with 'gradle addToJmeterClasspath jmeterEditor'
apply plugin: 'jmeter'
apply plugin: 'java'
List<String> pluginList = new ArrayList<String>()
buildscript {
repositories {
@djangofan
djangofan / gist:27374b054884730596ff
Last active August 29, 2015 14:13
Verbose elementExistsWithText for Selenium
public Boolean elementExistsWithText(By locator, String text)
{
ExpectedCondition<Boolean> textToBePresentInElement = ExpectedConditions.textToBePresentInElementLocated(locator, text);
WebDriverWait wait = webDriverManager.getCachedWebDriverWait(webDriverManager.DEFAULT_WAIT);
try {
wait.until(textToBePresentInElement);
return Boolean.TRUE;
} catch ( WebDriverException wde ) {
LOG.debug( "Element '" + locator.toString() + "' with text '" + text + "' was not present.", wde);
return Boolean.FALSE;