Skip to content

Instantly share code, notes, and snippets.

Simon Stratton safebear

Block or report user

Report or block safebear

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View protractor.conf.ts
import { browser, Config } from "protractor";
export const config: Config = {
seleniumAddress: "",
baseUrl: "http://localhost:8080/",
framework: "custom",
frameworkPath: require.resolve("protractor-cucumber-framework"),
View tsconfig.json
"compilerOptions": {
/* Basic Options */
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"declaration": false, /* Generates corresponding '.d.ts' file. */
"sourceMap": false, /* Generates corresponding '.map' file. */
"outDir": "e2ejs", /* Redirect output structure to the directory. */
"removeComments": false, /* Do not emit comments to output. */
View settings.json
"cucumberautocomplete.steps": [
"cucumberautocomplete.syncfeatures": "e2e/features/*feature",
"cucumberautocomplete.strictGherkinCompletion": true
safebear / tslint.json
Created Sep 30, 2019
Linting Rules for TypeScript MAT-TS
View tslint.json
"defaultSeverity": "error",
"extends": [
"jsRules": {},
"rules": {
"no-var-requires": false,
"no-console": true,
"object-literal-sort-keys": false
safebear / Cheatsheet.cs
Created Sep 12, 2019
Cheatsheet of Selenium Commands for C# / .NET
View Cheatsheet.cs
using OpenQA.Selenium;
using OpenQA.Selenium.Interactions;
using OpenQA.Selenium.Support.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ToolsList.Pages
safebear / selenium_cheetsheet_java.js
Last active Aug 16, 2019
Selenium Cheetsheet for Java
View selenium_cheetsheet_java.js
package test_automation.actions;
import Utils.Waits;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Action;
import org.openqa.selenium.interactions.Actions;
safebear /
Last active Jul 25, 2019
The Wait for Element method
public static WebElement waitForElement(By locator, WebDriver driver){
// Maximum time to wait in seconds
int WAIT = 30;
try {
// Wait for the element to appear
new WebDriverWait(driver, WAIT)
safebear /
Created Jul 25, 2019
Your ScreenShots Class
public class Screenshots {
public static String generateScreenShotFileName(){
// create filename
return new SimpleDateFormat("").format(new Date()) + ".png";
public static void capturescreenshot(WebDriver driver, String fileName) {
safebear / pom.xml
Created Jul 25, 2019
Cluecumber Report
View pom.xml
safebear /
Created Jul 17, 2019
Import Excel Spreadsheet - TestNG
public class ExcelUtils {
private static HSSFSheet ExcelWSheet;
private static HSSFWorkbook ExcelWBook;
private static HSSFCell Cell;
private static HSSFRow Row;
public static Object[][] getTableArray(String FilePath, String SheetName) throws Exception {
String[][] tabArray = null;
You can’t perform that action at this time.