Skip to content

Instantly share code, notes, and snippets.

View safebear's full-sized avatar

Simon Stratton safebear

View GitHub Profile
@safebear
safebear / azure_pipeline.yml
Last active September 12, 2019 13:35
azure pipeline with newman
- task: NodeTool@0
displayName: 'Run API Tests'
inputs:
versionSpec: '8.x'
- script: npm install newman -g
displayName: 'Install newman'
@safebear
safebear / azure-pipelines.yml
Created March 14, 2019 10:54
Filtering on Tests and Changing URL
# filtering on 'highPriority' but ignoring any test tagged as 'Ignore'
- task: VSTest@2
inputs:
testFiltercriteria: (TestCategory=highPriority&TestCategory!=Ignore)
# I.E. we add the 'testFiltercriteria' line to the 'inputs:' section of the Acceptance Tests
- task: VSBuild@1
@safebear
safebear / closures.js
Created March 8, 2019 11:10
Closures
function sayHi(greeting){
console.log(greeting)
}
sayHi("hello")
// 'greeting' variable contains the word 'Hello' when 'sayHi' is run
// but the 'greeting' variable no longer exists anywhere after 'sayHi' has finished executing
@safebear
safebear / callbacks.js
Created March 8, 2019 11:06
Callbacks, 'Then' and 'Async / Await'.
function first () {
console.log(1)
}
function second () {
console.log(2)
}
first();
second();
@safebear
safebear / Jenkinsfile
Last active July 25, 2019 06:01
Jenkinsfile for the MAT Java course
pipeline {
// Here we set which CI node/agent we want to run on
agent any
// Here we can set what environment we're running on, which browser etc...
parameters {
string(name: 'tests', defaultValue: 'RunCucumberTest', description: 'cucumber tests')
string(name: 'url', defaultValue: 'http://toolslist.safebear.co.uk:8080', description: 'test environment')
string(name: 'browser', defaultValue: 'chrome_headless', description: 'chrome headless')
docker system prune --all --force --volumes
#! /bin/bash
set +e
sudo apt-get purge -y chromium-browser && \
sudo apt autoremove -y && \
sudo apt-get update && \
sudo apt-get install -y libappindicator1 fonts-liberation && \
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
sudo dpkg -i google-chrome*.deb && \
sudo apt-get install -f -y && \
@safebear
safebear / installchromedriver.sh
Created July 11, 2018 12:20
Install Chromedriver
wget https://chromedriver.storage.googleapis.com/2.40/chromedriver_linux64.zip && \
unzip chromedriver_linux64.zip && \
sudo rm /usr/local/bin/chromedriver && sudo mv chromedriver /usr/local/bin/ && \
rm chromedriver_linux64.zip
package com.safebear.tasklist.controller;
import com.safebear.tasklist.service.TaskService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
package com.safebear.tasklist.model;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager;
import org.springframework.test.context.junit4.SpringRunner;
import java.time.LocalDate;