Skip to content

Instantly share code, notes, and snippets.

@stirno
stirno / test.cs
Last active August 29, 2015 13:56
Expect cookie exists with value
[TestClass]
public class AcceptanceTest1 : FluentAutomation.FluentTest<OpenQA.Selenium.IWebDriver>
{
public AcceptanceTest1()
{
FluentAutomation.SeleniumWebDriver.Bootstrap(FluentAutomation.SeleniumWebDriver.Browser.Chrome);
}
[TestMethod]
public void TestMethod1()
@stirno
stirno / Install Steps
Created February 22, 2014 06:21
scriptcs + FluentAutomation
scriptcs -install FluentAutomation.SeleniumWebDriver
scriptcs -install ScriptCs.FluentAutomation
@stirno
stirno / Features.md
Last active August 29, 2015 13:57
Changes for FluentAutomation v3.0

FluentAutomation v3.0 Changelog

######Multi-browser support with I.Find

Change from Func<Element> to ElementProxy

######New configuration syntax

Config
var gulp = new Gulp();
gulp.Task("Compile CSS", () =>
{
gulp.Source("*.less", "*.sass", "*.scss")
.Pipe("less$", new GulpLess())
.Pipe("(sass|scss)$", new GulpSass())
.Destination("~/bin");
});
@stirno
stirno / findmultiple.cs
Created May 25, 2014 23:35
FindMultiple iterate over items
I.FindMultiple("div").Elements.ForEach((elementTuple) =>
{
var commandProvider = elementTuple.Item1;
var elementFunc = elementTuple.Item2;
var element = elementFunc();
// do things with element
});
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
width: 960px;
height: 500px;
position: relative;
}
namespace DTNX.DNS.RestServices
{
public class RestServiceBase<T, TRepository> : ServiceStack.ServiceInterface.RestServiceBase<T> where T : ModelBase where TRepository : IRepository<T>
{
public TRepository Repository { get; set; }
public override object OnGet(T request)
{
var baseRequest = request.TranslateTo<ModelBase>();
if (baseRequest.Id == default(int))
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTNX.DNS.DataAccess.Repositories
{
public class RepositoryBase<T> where T : ModelBase
{
public RepositoryBase()
@stirno
stirno / gist:1176188
Created August 28, 2011 03:05
Example automation test API
[TestClass]
public class LoginTests : StirnoTestDriver
{
[TestMethod]
public void Login_HappyPath()
{
I.Use(BrowserType.InternetExplorer);
I.Open("http://idev05/Login");
// Validate expected strings on page
@stirno
stirno / gist:1176470
Created August 28, 2011 09:28
Fluent Automation API Sample
using FluentAutomation.API;
using FluentAutomation.API.Enumerations;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace FluentAutomation.Samples
{
/// <summary>
/// Fluent Automation API for the Web - http://www.stirno.com/fluentautomation
/// </summary>
[TestClass]