Skip to content

Instantly share code, notes, and snippets.

View jimode's full-sized avatar
🎯
Focusing

Jimi Odeyemi jimode

🎯
Focusing
View GitHub Profile
@jimode
jimode / gist:5162472
Created March 14, 2013 15:44
CSS: Image Replacement
.ir {
border:0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@jimode
jimode / gist:5162766
Last active December 14, 2015 22:59
HTML: HTML5 Shiv v3.6.2pre
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
@jimode
jimode / gist:5568919
Last active December 17, 2015 06:58
JUnit: ChromeDriver
// Run test in Chrome browser
File file =new File("C:/Users/Jimi/Selenium/Workspace/chromedriver.exe");
System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());
WebDriver myD = new ChromeDriver();
@jimode
jimode / gist:5569053
Created May 13, 2013 15:13
JUnit: IE Driver
// Run test in Internet Explorer
File file =new File("C:/Users/Jimi/Selenium/Workspace/IEDriverServer.exe");
System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
WebDriver myD = new InternetExplorerDriver();
@jimode
jimode / gist:5569097
Created May 13, 2013 15:19
JUnit: HSSF Workbook
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.junit.After;
@jimode
jimode / JUnit: Print_hybrid_driver2.java
Created May 22, 2014 13:01
JUnit: hyrbrid_framework
// Global Variables
public class hybrid_driver1 {
private WebDriver driver;
private String baseUrl;
private boolean acceptNextAlert = true;
private StringBuffer verificationErrors = new StringBuffer();
//Test Case Variables
int xRows_TC, xCols_TC;
String[][] xData_TC;
When(/^there is no hover border displayed$/, () => {
const monthlySubscription =
SelectSubscription.monthly.plan.selector;
function getPsuedoAttributeValues(component, selector, cssProperty) {
return window
.getComputedStyle(document.querySelector(component), selector)
.getPropertyValue(cssProperty);
}
@jimode
jimode / browserSroll.js
Last active July 25, 2018 13:31
Get location co-ordinates of elements and get browser to scroll to it.
// Webdriver.IO
const [x, y] = Object.values(this.cardPaymentOption.getLocation());
browser.scroll(x, y);
this.cardPaymentOption.click();
const [x1, y1] = Object.values(this.ccSecureCheckoutText.getLocation());
browser.scroll(x1, y1);
this.ccSecureCheckoutText.waitForVisible();
@jimode
jimode / table-steps.js
Last active August 24, 2018 10:20
checking list of elements using tables
Then(/^I should see the following dropdown options$/, (table) => {
const expectedOptions = [].concat(...table.raw()); // this array is from the table in the scenario
const availableOptions = PaymentDetailsFormComponent.billingCountryOptions // this array will come from the collection of DOM elements
.map(option => option.getText());
expect(availableOptions).to.deep.eq(expectedOptions);
});
@jimode
jimode / index.html
Last active August 31, 2018 22:13
Introduction to Currying - JS Bin// source https://jsbin.com/dinahay
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">