Skip to content

Instantly share code, notes, and snippets.

View O5ten's full-sized avatar

Mikael Östberg O5ten

View GitHub Profile
@O5ten
O5ten / pom.xml
Created May 1, 2018 20:00
Dependencies for running junit-tests towards a selenium grid
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
<version>3.7.1</version>
@O5ten
O5ten / Vagrantfile
Last active March 9, 2018 15:04
A TeamCity with a linux agent to test plugins with using Vagrant and Docker, put in a folder, do vagrant up
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
@O5ten
O5ten / gist:2d07f589028a8c7aac3bc7394198519f
Created December 22, 2017 09:51
Vagrantfile for selenoid
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box_download_insecure = true
config.vm.box = "ubuntu/xenial64"
@O5ten
O5ten / In-build-selenium-server-with-dynamic-port-allocation-maven-profile.xml
Last active September 19, 2017 07:09
In-build selenium-server to run your tests headless in any operating system.
<profile>
<id>selenium-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>reserve-selenium-port</id>
@O5ten
O5ten / settings.xml
Created July 28, 2017 08:00
My most common settingsfile for maven
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>home</id>
<repositories>
<repository>
<id>smartbear</id>
@O5ten
O5ten / run-tests.sh
Last active July 6, 2016 07:54
Run testsuite quickly in browser
#!/bin/bash
library=$1
suite=$2
coverage=$3
if [ ! -d ui/$library ]; then
echo "Directory ui/$library does not exist"
exit 1
fi
@O5ten
O5ten / gist:892508ff077ebff571b9d5f17c5a0f89
Created March 30, 2016 12:22
indexOf by condition instead of deep-equal
indexOf = function(collection, condition){
if(collection && Array.isArray(collection) && condition){
for(var i = 0; i < collection.length; i+=1){
if(condition(collection[i])){
return i;
}
}
}
return -1;
},
@O5ten
O5ten / Groovy-Higher-order-functions.groovy
Last active November 10, 2017 22:32
Groovy Higher order functions
class Person {
String name
int age
Gender gender
enum Gender {
MALE, FEMALE, UNKNOWN
}
}
def persons = [new Person(name: 'Bob', age: 25, gender: Person.Gender.MALE),
@O5ten
O5ten / gist:2cd057e0878b5978a038
Last active August 29, 2015 14:13
Skidutrustning
Underställ
- Överdel
- Underdel
Ytterplagg
- Skaljacka // Vindtät iallafall
- Täckbyxor
Övrigt
- Handskar // som inte drar till sig snö
@O5ten
O5ten / gist:796dd06fb2f5732bada6
Last active August 29, 2015 14:13
Dagens metod.
private void verifyObjectIsValid() {
Object object = test.getFacade().getObject();
if (object.getObject() == null || object.getAnotherObject() == null) {
throw new IllegalStateException("Object: Invalid object: object=" + object.getAnotherObject()
+ ", Load Profile: " + object.getObject());
}
}