Skip to content

Instantly share code, notes, and snippets.

Mikael Östberg O5ten

Block or report user

Report or block O5ten

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 LogoutTest.java
public class LogoutTest extends SeleniumTestBase {
private StartPage startPage = new StartPage();
private LoggedOutPage loggedOutPage = new LoggedOutPage();
public LogoutTest() {
this.pagesToInitialize = Lists.newArrayList(startPage);
}
@Test
public void shouldEndUpOnLoggedOutPageWhenLoggedOut() {
@O5ten
O5ten / Page.java
Created May 1, 2018
Parent Page Object
View Page.java
public class Page {
private String url;
protected Actions actions;
private RemoteWebDriver browser;
public Page(String url) {
this.url = url;
}
View StartPage.java
public class StartPage extends Page {
@FindBy(css = "button[data-test=userButton]")
private WebElement userbutton;
@FindBy(css = "a[data-test=logoutButton]")
private WebElement logoutButton;
public StartPage() {
super("http://my-page.se");
@O5ten
O5ten / SeleniumTestBase.java
Created May 1, 2018
Remote Grid Selenium TestBase
View SeleniumTestBase.java
package framework;
import static framework.Constants.BROWSER_CAPABILIITY;
import static framework.Constants.ENABLE_VIDEO;
import static framework.Constants.ENABLE_VNC;
import static framework.Constants.NAME;
import static framework.Constants.THIRTY;
import static java.util.concurrent.TimeUnit.SECONDS;
import java.net.MalformedURLException;
@O5ten
O5ten / pom.xml
Created May 1, 2018
Dependencies for running junit-tests towards a selenium grid
View pom.xml
<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 Mar 9, 2018
A TeamCity with a linux agent to test plugins with using Vagrant and Docker, put in a folder, do vagrant up
View Vagrantfile
# -*- 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"
View gist:2d07f589028a8c7aac3bc7394198519f
# -*- 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 / Groovy-Higher-order-functions.groovy
Last active Nov 10, 2017
Groovy Higher order functions
View Groovy-Higher-order-functions.groovy
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 / In-build-selenium-server-with-dynamic-port-allocation-maven-profile.xml
Last active Sep 19, 2017
In-build selenium-server to run your tests headless in any operating system.
View In-build-selenium-server-with-dynamic-port-allocation-maven-profile.xml
<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 Jul 28, 2017
My most common settingsfile for maven
View settings.xml
<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>
You can’t perform that action at this time.