Skip to content

Instantly share code, notes, and snippets.

View NickBaynham's full-sized avatar
:octocat:
Learning Github Actions

Nick Baynham NickBaynham

:octocat:
Learning Github Actions
  • Macon, Georgia
View GitHub Profile
@NickBaynham
NickBaynham / registrationForm.java
Created March 3, 2020 15:42
Registration Form Page Object
package framework.pageObjects;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class RegistrationForm {
@FindBy(xpath = "//label[contains(.,'First name')]/../input")
@NickBaynham
NickBaynham / RegistrationDD.java
Created March 3, 2020 15:40
Registration Form Test - Data Driven
package selfHealingExamples.tests.registration;
import org.openqa.selenium.By;
import org.testng.annotations.Test;
import selfHealingExamples.dataProviders.RegistrationData;
import static org.testng.AssertJUnit.assertEquals;
public class RegistrationDD extends BaseTest {
@Test(dataProvider = "registration", dataProviderClass= RegistrationData.class)
@NickBaynham
NickBaynham / BaseTest.java
Created March 3, 2020 15:36
Registration Base Test
package selfHealingExamples.tests.registration;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
public class BaseTest {
@BeforeMethod
@NickBaynham
NickBaynham / gist:a71b713ffd9b279b35df6ef7427985bb
Created March 3, 2020 15:33
Registration Test with Raw Selenium API Calls
package selfHealingExamples.tests.registration;
import org.openqa.selenium.By;
import org.testng.annotations.Test;
import static org.testng.AssertJUnit.assertEquals;
public class RegistrationSelenium extends BaseTest {
@Test
@NickBaynham
NickBaynham / bootstrap1.html
Created March 3, 2020 15:29
HTML Form (For Auto Discovery Demo)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Self Healing Test Page</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
@NickBaynham
NickBaynham / Exceptions2.java
Created February 13, 2019 13:42
Exceptions
package codingExamples;
import org.junit.Test;
public class Exceptions2 {
@Test
public void test() {
System.out.println(doIt());
}
<!DOCTYPE html>
<html>
<head>
<!-- Load the Paper.js library -->
<script type="text/javascript" src="js/paper-full.min.js"></script>
<!-- Define inlined PaperScript associate it with myCanvas -->
<script type="text/paperscript" canvas="myCanvas">
var balls = [];
var ball1 = {
"id": 1,
function isPrime(value) {
if (!isPrime.answers) {
isPrime.answers = {};
}
if (isPrime.answers[value] !== undefined) {
return isPrime.answers[value];
}
var prime = value !== 1;
console.log([4,21,6,44,9,99,21,54].sort(function(prev, current){
return prev - current;
}));
module.exports = (function(){
let log = {};
log.log = msg => logAssist('[**Log]')(msg);
log.logCase = msg => logAssist('[**C]')(msg);
log.logStep = msg => logAssist('[**S]')(msg);
log.logVerification = msg => logAssist('[**V]')(msg);
log.logPropertyVerification = msg => logAssist('[**VV]')(msg);
log.logError = msg => logAssist('[**Error]')(msg);
log.logSection = msg => logAssist('[**Section]')(msg);
log.logAction = msg => logAssist('[**Action]')(msg);