Skip to content

Instantly share code, notes, and snippets.

#addin "nuget:?package=Cake.Incubator&version=3.1.0"
var target = Argument("Target", "Build");
var configuration = Argument("Configuration", "Release");
Task("Restore")
.Does(() =>
{
Information("Restoring packages...");
DotNetCoreRestore();
@johnmmoss
johnmmoss / _vimrc
Last active February 14, 2019 13:18
" Begin vim-plug extensions
call plug#begin('~/.vim/plugged')
Plug 'bling/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'kien/ctrlp.vim'
Plug 'scrooloose/nerdtree'
call plug#end()
var target = Argument<string>("Target");
var runLocal = true;
Setup(context =>
{
Information("Task Setup Method ran...");
});
Teardown(context =>
{
@johnmmoss
johnmmoss / Set-BuildNumber.ps1
Created January 11, 2019 10:06
Using Powershell to set the BuildNumber in a json file
Get-ChildItem configs -Filter appConfig*.json | % {
$fullName = $_.FullName
write-output "Applying build number to $fileName"
$fileContent = Get-Content $fullName
$replacedFileContent = $fileContent.replace('BUILDNUMBER', $(Build.BuildNumber))
Set-Content -Path $fullName -Value $replacedFileContent
write-output "COMPLETED Applying build number to $fileName"
}
[Binding]
public class UserAdminSteps
{
[Given(@"I am a valid user of the site")]
public void GivenIAmAValidUserOfTheSite()
{
}
[Given(@"I have navigated to the login page")]
public void GivenIHaveNavigatedToTheLoginPage()
[BeforeScenario]
public void BeforeScenario()
{
// At the begining of the scenario, we are on the homepage
var webDriver = FeatureContext.Current.Get<IWebDriver>();
var homePage = new HomePage(webDriver);
ScenarioContext.Current.Set<HomePage>(homePage);
}
public class HomePage
{
private readonly IWebDriver webDriver;
public HomePage(IWebDriver webDriver)
{
this.webDriver = webDriver;
}
public LoginPage ClickLoginLink()
private static string websiteUrl = ConfigurationSettings.AppSettings["WebSiteUrl"];
[BeforeFeature]
public static void BeforeFeature()
{
IWebDriver driver = new ChromeDriver();
FeatureContext.Current.Set(driver);
driver.Navigate().GoToUrl(websiteUrl);
}
Feature: UserAdmin
In order to use the site
As an employee
I want to be able to register and login to the site
Scenario: A valid user can login to the site
Given I am a valid user of the site
And I have navigated to the login page
And I have entered a username of "johndoe" and a password of "Password1!"
When I click the create button
$subscription_id_test = "<guid>"
$ScriptPath = Split-Path $MyInvocation.InvocationName
$templateFile = "$ScriptPath\WebApi\WebSite.json" # Sample Azure Template
$name = "TestWebApi"
$hostPlan = "F1" # Defined in the parameters in template
write-host Importing azure module -ForegroundColor gray
Import-Module -Name AzureRM