Skip to content

Instantly share code, notes, and snippets.

View lefthandedgoat's full-sized avatar

Chris Holt lefthandedgoat

View GitHub Profile
@lefthandedgoat
lefthandedgoat / gist:9138759
Created February 21, 2014 17:20
A way to get selenium tests to run at higher res
Running selenium tests via Team City as a windows service has a resolution of 1024x768. I tryed adding/changing DefaultSettings.XResolution and YResolution in the registry with no luck. What did work was running TC agent in the console as a logged in user.
Use these instructions to setup a user to automatically log in when your box starts up
http://www.win2008workstation.com/configure-auto-logon/
Add shortcut to the startup forlder on start menu:
C:\Users\YOUUSER\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
that points to your team city agent's start.bat with 'start' parameter
@lefthandedgoat
lefthandedgoat / gist:9126142
Last active September 4, 2019 13:20
How to embed images for failed tests in Team City (using canopy)
//first read about how to do something similar here:
http://atombrenner.blogspot.com/2012/09/embed-url-links-in-teamcity-build-logs.html
//plugin location
http://confluence.jetbrains.com/display/TW/StaticUIExtensions
//download at:
http://teamcity.jetbrains.com/repository/download/TeamCityPluginsByJetBrains_StaticUiExtensionsAgainstTeamCity8/latest.lastSuccessful/static-ui-extensions.zip
//after downloading you can go to you team city administrator, go to plugins, and upload the one you just downloaded
//restart TC web server so that it registers the plugin, once you go back you should have 1 more
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>canopy</id>
<version>2.0.0</version>
<authors>Chris Holt</authors>
<licenseUrl>https://github.com/lefthandedgoat/canopy/blob/master/LICENSE.txt</licenseUrl>
<projectUrl>http://lefthandedgoat.github.io/canopy/</projectUrl>
<iconUrl>http://lefthandedgoat.github.io/canopy/canopy_orig.jpg</iconUrl>
<description>A simple framework in F# on top of selenium for writing UI automation and tests.</description>
@lefthandedgoat
lefthandedgoat / gist:18464c3a14e5b98c24a5
Last active January 11, 2018 12:45
What to talk about in a canopy presentation
  • People (usually no F# exposure) always want to understand what &&& is ex:
    • "Some test" &&& fun _ -> url "http://www.google.com"
    • To explain this I teach them about infix operators which also helps with them understand why you can do "#name" == "Bob" and with |>
  • Its good to point out that canopy uses selenium and does not hide it at all. If you need to do something that canopy does not support, you can google for it and take the example and convert it to f#. browser is the instance of ISeleniumWebDriver
  • UI Automation works really well but is a pain because its sometimes more precise that people care about. It will uncover subtle bugs that people often time don't want to research and fix =(
  • A great property of F# is that the most recent definition of a function is the one that is used. This lets you 'override' core functionality with some that is better for you. ex if you dont like how displayed works, you can create your own version and put it in a module and open it after op
@lefthandedgoat
lefthandedgoat / esc.ahk
Created May 18, 2017 19:19
auto hot key script to have capslock double up as esc and ctrl and have left shit and right shift add parenthesis
;be sure to run AHK et all as administrator
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
@lefthandedgoat
lefthandedgoat / init.el
Created April 4, 2017 17:37
my emacs config
;; require package managers, but we'll avoid them if at all possible
(require 'package)
(push '("melpa" . "http://melpa.milkbox.net/packages/")
package-archives)
;;=====================================
;;plugins
;;=====================================
@lefthandedgoat
lefthandedgoat / gist:25e5bc05f8c631c2d9885ace4f4169a6
Created February 11, 2017 16:55
working fsx with html reporter
#I @"C:\projects\fsxCanopy\packages\Selenium.WebDriver.3.0.0\lib\net40\"
#I @"C:\projects\fsxCanopy\packages\canopy.1.0.6\lib"
#r "WebDriver.dll"
#r "canopy.dll"
open canopy
open runner
open reporters
module Test1
open Xunit
open FsUnit.Xunit
type ``Context 1`` () =
let setup = failwith "do your setup here and if it returns unit its fine, it will bind to the setup val"
[<Fact>]
member x.``test 1`` () =
@lefthandedgoat
lefthandedgoat / connect4.fs
Created September 28, 2016 23:21
Connect 4
type Color =
| Red
| Yellow
type Spot =
| Empty
| Color of Color
type Column =
| A

Keybase proof

I hereby claim:

  • I am lefthandedgoat on github.
  • I am lefthandedgoat (https://keybase.io/lefthandedgoat) on keybase.
  • I have a public key whose fingerprint is 2605 18F6 0853 C366 17CE D7C2 013C B074 F73F 4256

To claim this, I am signing this object: