Skip to content

Instantly share code, notes, and snippets.

View mmerrell's full-sized avatar

Marcus Merrell mmerrell

  • Sauce Labs, inc
  • Austin, Tx
View GitHub Profile
[alias]
st = status -sb
co = checkout
cb = checkout -b
b = branch
ba = branch -a
br = !sh -c 'git branch -vv | sed "s/].*/]/"' -
pr = remote prune origin
so = remote show origin
cp = cherry-pick
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@mmerrell
mmerrell / BaseAnalyticsTest
Created April 16, 2018 14:35
This is the Base Test, from which the Analytics tests (TestNG) inherit. This won't compile by itself—it is intended to show the basic functionality of how we manage these tests and look for entries in the HAR file. It includes the "waitForHarEntryToExist" method people were asking about during my Analytics Webinar. I'm going to try to tie all th…
package com.rmn.automation.rmn.test.core.analytics;
import com.google.common.base.Function;
import com.rmn.automation.framework.core.TestContextSetting;
import com.rmn.automation.framework.proxy.IAutomationProxy;
import com.rmn.automation.framework.proxy.IProxyManager;
import com.rmn.automation.framework.util.AutomationWait;
import com.rmn.automation.rmn.test.base.BaseRmnCoreWebDriverTest;
import org.apache.commons.lang3.StringUtils;
import org.browsermob.core.har.HarEntry;
@mmerrell
mmerrell / ProxyManager.java
Created April 10, 2018 19:57
ProxyManager class, for managing your BrowserMob proxy, manipulating HAR files, etc
package com.rmn.automation.framework.proxy;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.rmn.automation.framework.util.AutomationUtils;
import com.rmn.automation.framework.util.JSONUtils;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
@mmerrell
mmerrell / GridTest.java
Last active April 3, 2017 15:02
Grid Test
package seleniumGrid;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@mmerrell
mmerrell / test.js
Created November 13, 2016 16:21
Selenium Conference (London, 2016) Grid Workshop - test.js
var webdriver = require('selenium-webdriver'),
driver = new webdriver.Builder().
usingServer('http://localhost:4444/wd/hub').
withCapabilities({'browserName': 'chrome'}).
build();
var postTitle = "Post "+(+new Date);
driver.get('http://si-demo.herokuapp.com/posts/new');