Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #2345 AllReady.ScenarioTest Issues #2350

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions AllReadyApp/AllReady.IntegrationTest/Actions.fs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module Actions
module Actions

open canopy
open runner
open System
open canopy.classic

let GoToHomePage baseUrl =
url baseUrl
Expand Down
108 changes: 10 additions & 98 deletions AllReadyApp/AllReady.IntegrationTest/AllReady.ScenarioTest.fsproj
Original file line number Diff line number Diff line change
@@ -1,111 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>44055c15-5757-4822-908b-c66b60251c54</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>AllReady.IntegrationTest</RootNamespace>
<AssemblyName>AllReady.IntegrationTest</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFSharpCoreVersion>4.4.1.0</TargetFSharpCoreVersion>
<Name>AllReady.ScenarioTest</Name>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>bin\$(Configuration)\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).XML</DocumentationFile>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\$(Configuration)\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).XML</DocumentationFile>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '11.0'">
<PropertyGroup Condition=" '$(FSharpTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets') ">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup Condition=" '$(FSharpTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets') ">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" />

<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Constants.fs" />
<Compile Include="Actions.fs" />
<Compile Include="Pages.fs" />
<Compile Include="Utils.fs" />
<Compile Include="Dates.fs" />
<Compile Include="Actions.fs" />
<Compile Include="CreatingOrgsAndCampaigns.fs" />
<Compile Include="CreatingActivitiesForCampaigns.fs" />
<Compile Include="Program.fs" />
<None Include="App.config" />
<Content Include="packages.config" />
</ItemGroup>

<ItemGroup>
<Reference Include="canopy">
<HintPath>..\packages\canopy.1.6.1\lib\canopy.dll</HintPath>
</Reference>
<Reference Include="FSharp.Core">
<HintPath>..\packages\FSharp.Core.4.2.3\lib\net45\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Numerics" />
<Reference Include="System.ValueTuple">
<HintPath>..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="WebDriver">
<HintPath>..\packages\Selenium.WebDriver.3.7.0\lib\net45\WebDriver.dll</HintPath>
</Reference>
<Reference Include="WebDriver.Support">
<HintPath>..\packages\Selenium.Support.3.7.0\lib\net45\WebDriver.Support.dll</HintPath>
</Reference>
<PackageReference Include="canopy" Version="2.1.0" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="2.46.0" />
</ItemGroup>
<Import Project="..\packages\Selenium.WebDriver.ChromeDriver.2.33.0\build\Selenium.WebDriver.ChromeDriver.targets" Condition="Exists('..\packages\Selenium.WebDriver.ChromeDriver.2.33.0\build\Selenium.WebDriver.ChromeDriver.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Selenium.WebDriver.ChromeDriver.2.33.0\build\Selenium.WebDriver.ChromeDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.WebDriver.ChromeDriver.2.33.0\build\Selenium.WebDriver.ChromeDriver.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

</Project>
6 changes: 0 additions & 6 deletions AllReadyApp/AllReady.IntegrationTest/App.config

This file was deleted.

41 changes: 0 additions & 41 deletions AllReadyApp/AllReady.IntegrationTest/AssemblyInfo.fs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
module CreatingActivitiesForCampaigns

open canopy
open runner
open System
open canopy.classic
open canopy.runner.classic
open Pages

let All baseUrl =


context "Organization Admin Activities"

"Login Org Admin" &&& fun _ ->
Expand Down Expand Up @@ -58,18 +56,18 @@ let All baseUrl =
let eventNameValue = read <| element eventNameSelector
eventNameValue |> contains eventName

"The Org Admin can create task" &&& fun _ ->
let taskName = Utils.GetScenarioTestName "First Test Task"
AdminEventDetails.CreateNewTask()
AdminTaskCreate.PopulateTaskDetails
{AdminTaskCreate.DefaultTaskDetails with
Name = taskName
}
//"The Org Admin can create task" &&& fun _ ->
// let taskName = Utils.GetScenarioTestName "First Test Task"
// AdminEventDetails.CreateNewTask()
// AdminTaskCreate.PopulateTaskDetails
// {AdminTaskCreate.DefaultTaskDetails with
// Name = taskName
// }

AdminTaskCreate.Create()
// AdminTaskCreate.Create()

on AdminEventDetails.RelativeUrl
"td a" *= taskName
// on AdminEventDetails.RelativeUrl
// "td a" *= taskName

"The Org Admin can logout" &&& fun _ ->
hover ".dropdown-account"
Expand Down
25 changes: 12 additions & 13 deletions AllReadyApp/AllReady.IntegrationTest/CreatingOrgsAndCampaigns.fs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
module CreatingOrgsAndCampaigns

open canopy
open runner
open System
open canopy.classic
open canopy.runner.classic
open Pages

let All baseUrl =
Expand Down Expand Up @@ -76,18 +75,18 @@ let All baseUrl =
let eventNameValue = read <| element eventNameSelector
eventNameValue |> contains eventName

"Admin can create task" &&& fun _ ->
let taskName = Utils.GetScenarioTestName "First Test Task"
AdminEventDetails.CreateNewTask()
AdminTaskCreate.PopulateTaskDetails
{AdminTaskCreate.DefaultTaskDetails with
Name = taskName
}
//"Admin can create task" &&& fun _ ->
// let taskName = Utils.GetScenarioTestName "First Test Task"
// AdminEventDetails.CreateNewTask()
// AdminTaskCreate.PopulateTaskDetails
// {AdminTaskCreate.DefaultTaskDetails with
// Name = taskName
// }

AdminTaskCreate.Create()
// AdminTaskCreate.Create()

on AdminEventDetails.RelativeUrl
"td a" *= taskName
// on AdminEventDetails.RelativeUrl
// "td a" *= taskName

"Admin can logout" &&& fun _ ->
hover ".dropdown-account"
Expand Down
17 changes: 0 additions & 17 deletions AllReadyApp/AllReady.IntegrationTest/Dates.fs

This file was deleted.

3 changes: 2 additions & 1 deletion AllReadyApp/AllReady.IntegrationTest/Pages.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Pages
open canopy

open canopy.classic

module TopMenu =
let private Campaigns = "Campaigns"
Expand Down
48 changes: 16 additions & 32 deletions AllReadyApp/AllReady.IntegrationTest/Program.fs
Original file line number Diff line number Diff line change
@@ -1,52 +1,36 @@
open canopy
open runner
open canopy.classic
open canopy.runner.classic
open canopy.types
open System

Threading.Thread.CurrentThread.CurrentCulture <- Globalization.CultureInfo "en-US"
//Threading.Thread.CurrentThread.CurrentCulture <- Globalization.CultureInfo "en-US"

Console.WriteLine("Launching Scenario Tests")

CreatingOrgsAndCampaigns.All Constants.UrlLocalHost
CreatingActivitiesForCampaigns.All Constants.UrlLocalHost

//Chrome Driver: https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver
// want to use the chromedriver in current directory to ensure match with current version of Chrome
canopy.configuration.chromeDir <- System.AppDomain.CurrentDomain.BaseDirectory
let chromeOptions = OpenQA.Selenium.Chrome.ChromeOptions()
chromeOptions.AddArgument("--disable-extensions")
start <| ChromeWithOptions chromeOptions
pin Left
resize (1024, 768)
Console.WriteLine("Launched Chrome")

////Firefox has issues with Selnium 2.5.x. see https://github.com/lefthandedgoat/canopy/issues/288. You have to installed version 48.
//start firefox
//pin Right
//resize(1024, 768)
//Console.WriteLine("Launched Firefox")

//Test don't work in IE right now. Many times IE adds a space to the end of the element text
// IE Driver: https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver
//canopy.configuration.ieDir <- System.AppDomain.CurrentDomain.BaseDirectory
//start ie
//let chromeOptions = OpenQA.Selenium.Chrome.ChromeOptions()
//chromeOptions.AddArgument("--disable-extensions")
//start <| ChromeWithOptions chromeOptions
//pin Left
//resize(1024, 768)
//Console.WriteLine("Launched IE")
//resize (1024, 768)

//Test don't work in Edge right now. Many times Edge adds a space to the end of the element text
// Edge Driver: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
//canopy.configuration.edgeDir <- System.AppDomain.CurrentDomain.BaseDirectory
//
//start edgeBETA
//pin Right
//resize(1024, 768)
//Console.WriteLine("Launched EDGE")
// start chrome browser, pin to left of screen and resize
start chrome
pin Left
resize (1024,768)

Console.WriteLine("Launched Chrome")

//run all tests
run()

System.Environment.ExitCode <- runner.failedCount
Console.WriteLine(String.Format("{0} passed, {1} failed", runner.passedCount, runner.failedCount))
System.Environment.ExitCode <- failedCount
Console.WriteLine(String.Format("{0} passed, {1} failed", passedCount, failedCount))

// only turn on when running directly from Visual Studio so that you can look at any errors.
//Console.WriteLine("Press Enter to Exit")
Expand Down
11 changes: 0 additions & 11 deletions AllReadyApp/AllReady.IntegrationTest/packages.config

This file was deleted.

6 changes: 3 additions & 3 deletions AllReadyApp/AllReadyWebOnly.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Builds", "Builds", "{79E5CF
EndProjectSection
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "AllReady.ScenarioTest", "AllReady.IntegrationTest\AllReady.ScenarioTest.fsproj", "{44055C15-5757-4822-908B-C66B60251C54}"
ProjectSection(ProjectDependencies) = postProject
{D00DE040-2254-4118-B172-F14E6FE56D44} = {D00DE040-2254-4118-B172-F14E6FE56D44}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -70,9 +73,6 @@ Global
{79E5CFB4-6FF7-4F89-B560-9342FFE91898} = {364DE571-98D2-4F69-8D93-F25F832E7D7A}
{44055C15-5757-4822-908B-C66B60251C54} = {1475C1FD-CE7D-4E6B-83B1-F7F82EA24FF8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {645EFF42-0422-4249-B544-6038D44E3CDE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FCAA194F-AD24-45C2-AA51-78C71433DCC0}
EndGlobalSection
Expand Down
Loading