diff --git a/.gitignore b/.gitignore index 9e8284d..eab3b46 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,5 @@ Thumbs.db _compareTemp _notes aspnet_client -httpd.parse.errors \ No newline at end of file +httpd.parse.errors +/MvcMegaForms/.vs/ diff --git a/MvcMegaForms/MVCMega.Forms.FunctionalTests/AssemblyFixture.cs b/MvcMegaForms/MVCMega.Forms.FunctionalTests/AssemblyFixture.cs index 99fb11b..03452b2 100644 --- a/MvcMegaForms/MVCMega.Forms.FunctionalTests/AssemblyFixture.cs +++ b/MvcMegaForms/MVCMega.Forms.FunctionalTests/AssemblyFixture.cs @@ -1,29 +1,40 @@ -// /* -// Copyright (c) 2012 Andrew Newton (http://about.me/nootn) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// */ - -using NUnit.Framework; -using TestStack.Seleno.Configuration; -using TestStack.Seleno.Configuration.Screenshots; - -namespace MVCMega.Forms.FunctionalTests -{ - [SetUpFixture] - public class AssemblyFixture - { - [SetUp] - public void SetUp() - { - SelenoApplicationRunner.Run( - "MvcMega.Forms.WebsiteForTesting", - 12121, - c => c.UsingCamera(new FileCamera("SCREENSHOTS"))); - } - } +// /* +// Copyright (c) 2012 Andrew Newton (http://about.me/nootn) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// */ + +using NUnit.Framework; +using TestStack.Seleno.Configuration; +using TestStack.Seleno.Configuration.Screenshots; + +namespace MVCMega.Forms.FunctionalTests +{ + + + [SetUpFixture] + public class AssemblyFixture + { + public static class Host + { + public static readonly SelenoHost Instance = new SelenoHost(); + + static Host() + { + Instance.Run( + "MvcMega.Forms.WebsiteForTesting", + 12121, + c => c.WithRemoteWebDriver(BrowserFactory.Chrome).UsingCamera(new FileCamera("SCREENSHOTS"))); + } + } + + [SetUp] + public void SetUp() + { + } + } } \ No newline at end of file diff --git a/MvcMegaForms/MVCMega.Forms.FunctionalTests/ChangeVisually/CheckboxFieldsCanBeHookedUp.cs b/MvcMegaForms/MVCMega.Forms.FunctionalTests/ChangeVisually/CheckboxFieldsCanBeHookedUp.cs index dce2a7d..86f0a3b 100644 --- a/MvcMegaForms/MVCMega.Forms.FunctionalTests/ChangeVisually/CheckboxFieldsCanBeHookedUp.cs +++ b/MvcMegaForms/MVCMega.Forms.FunctionalTests/ChangeVisually/CheckboxFieldsCanBeHookedUp.cs @@ -1,62 +1,60 @@ -// /* -// Copyright (c) 2012 Andrew Newton (http://about.me/nootn) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// */ - -using MVCMega.Forms.FunctionalTests.Pages; -using MVCMega.Forms.FunctionalTests.Pages.ChangeVisually; -using MvcMega.Forms.WebsiteForTesting.Models.ChangeVisuallyScreens; -using NUnit.Framework; -using OpenQA.Selenium; -using TestStack.BDDfy; -using TestStack.BDDfy.Core; -using TestStack.BDDfy.Scanners.StepScanners.Fluent; - -namespace MVCMega.Forms.FunctionalTests.ChangeVisually -{ - [TestFixture] - [Story(AsA = "As a user", - IWant = "I want to hide and show fields based on ticking and un-ticking check boxes", - SoThat = "So that my forms will be awesome")] - public class CheckboxFieldsCanBeHookedUp - { - private CheckboxPage _page; - - private void GivenUserIsOnTheCheckboxPage() - { - _page = new HomePage() - .GoToCheckboxPage(); - } - - private void WhenShowNextFieldIsChecked() - { - var model = new CheckboxModel(); - model.TickCheckboxToShowNextField = true; - _page.FillSingleForm(model); - } - - private void ThenNextFieldIsShown() - { - var elem = _page.AssertThatElements(By.Id("NextField")); - - //TODO: assert that elem exists and is not hidden (I.e. check html attributes..) - - //Mehdi, could there be a nicer way to get the ID? We know the model type.. so something like: - //var elem = _homePage.GetElementByModelProperty(m => m.NextField). - } - - [Test] - public void SetCheckboxFromUntickedToTicked() - { - this.Given(_ => _.GivenUserIsOnTheCheckboxPage()) - .When(_ => _.WhenShowNextFieldIsChecked()) - .Then(_ => _.ThenNextFieldIsShown()) - .BDDfy(); - } - } +// /* +// Copyright (c) 2012 Andrew Newton (http://about.me/nootn) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// */ + +using MVCMega.Forms.FunctionalTests.Pages; +using MVCMega.Forms.FunctionalTests.Pages.ChangeVisually; +using MvcMega.Forms.WebsiteForTesting.Models.ChangeVisuallyScreens; +using NUnit.Framework; +using OpenQA.Selenium; +using TestStack.BDDfy; +using TestStack.BDDfy.Core; +using TestStack.BDDfy.Scanners.StepScanners.Fluent; + +namespace MVCMega.Forms.FunctionalTests.ChangeVisually +{ + [TestFixture] + [Story(AsA = "As a user", + IWant = "I want to hide and show fields based on ticking and un-ticking check boxes", + SoThat = "So that my forms will be awesome")] + public class CheckboxFieldsCanBeHookedUp + { + private CheckboxPage _page; + + private void GivenUserIsOnTheCheckboxPage() + { + _page = AssemblyFixture.Host.Instance.NavigateToInitialPage() + .GoToCheckboxPage(); + } + + private void WhenShowNextFieldIsChecked() + { + var model = new CheckboxModel(); + model.TickCheckboxToShowNextField = true; + _page.FillSingleForm(model); + } + + private void ThenNextFieldIsShown() + { + Assert.True(_page.NextField.Displayed); + + //Mehdi, could there be a nicer way to get the ID? We know the model type.. so something like: + //var elem = _homePage.GetElementByModelProperty(m => m.NextField). + } + + [Test] + public void SetCheckboxFromUntickedToTicked() + { + this.Given(_ => _.GivenUserIsOnTheCheckboxPage()) + .When(_ => _.WhenShowNextFieldIsChecked()) + .Then(_ => _.ThenNextFieldIsShown()) + .BDDfy(); + } + } } \ No newline at end of file diff --git a/MvcMegaForms/MVCMega.Forms.FunctionalTests/ChangeVisually/TextboxFieldsCanBeHookedUp.cs b/MvcMegaForms/MVCMega.Forms.FunctionalTests/ChangeVisually/TextboxFieldsCanBeHookedUp.cs index b70095e..ce52370 100644 --- a/MvcMegaForms/MVCMega.Forms.FunctionalTests/ChangeVisually/TextboxFieldsCanBeHookedUp.cs +++ b/MvcMegaForms/MVCMega.Forms.FunctionalTests/ChangeVisually/TextboxFieldsCanBeHookedUp.cs @@ -14,6 +14,7 @@ using MvcMega.Forms.WebsiteForTesting.Models.ChangeVisuallyScreens; using NUnit.Framework; using OpenQA.Selenium; +using OpenQA.Selenium.Support.Events; using TestStack.BDDfy; using TestStack.BDDfy.Core; using TestStack.BDDfy.Scanners.StepScanners.Fluent; @@ -28,46 +29,41 @@ public class TextboxFieldsCanBeHookedUp { private TextboxPage _page; - private void GivenUserIsOnTheCheckboxPage() + private void GivenUserIsOnTheTextboxPage() { - _page = new HomePage() + _page = AssemblyFixture.Host.Instance.NavigateToInitialPage() .GoToTextboxPage(); } private void WhenMakeNotEmptyToShowNextField1IsEmptyInitially() { - var model = new TextboxModel(); - model.MakeNotEmptyToShowNextField1 = string.Empty; - _page.FillSingleForm(model); + _page.MakeNotEmptyToShowNextField1.SendKeys("SomeValue\t"); + + _page.ClearMakeNotEmptyToShowNextField1(); } private void WhenMakeNotEmptyToShowNextField1IsNotEmpty() { - var model = new TextboxModel(); - model.MakeNotEmptyToShowNextField1 = "something"; - _page.FillSingleForm(model); + _page.ClearMakeNotEmptyToShowNextField1(); + _page.MakeNotEmptyToShowNextField1.SendKeys("SomeValue\t"); } private void ThenNextField1IsHidden() { - //TODO: waiting on Seleno to get the element properly - var elem = _page.AssertThatElements(By.Id("NextField1")); - elem.Exist(); - elem.ConformTo(i => Assert.IsTrue(i.All(a => a.GetCssValue("display") == "none"))); + //TODO: waiting on Seleno to get the element properly + Assert.False(_page.NextField1.Displayed); } private void ThenNextField1IsShown() { - //TODO: waiting on Seleno to get the element properly - var elem = _page.AssertThatElements(By.Id("NextField1")); - elem.Exist(); - //elem.ConformTo(i => Assert.IsTrue(i.All(a => a.FindElement(new By.jQueryBy("").Parent(".form-group")).GetCssValue("display") == "block"))); + //TODO: waiting on Seleno to get the element properly + Assert.True(_page.NextField1.Displayed); } [Test] public void SetTextboxToEmptyToHideNextValue() { - this.Given(_ => _.GivenUserIsOnTheCheckboxPage()) + this.Given(_ => _.GivenUserIsOnTheTextboxPage()) .When(_ => _.WhenMakeNotEmptyToShowNextField1IsEmptyInitially()) .Then(_ => _.ThenNextField1IsHidden()) .BDDfy(); @@ -76,7 +72,7 @@ public void SetTextboxToEmptyToHideNextValue() [Test] public void SetTextboxToNotEmptyToShowNextValue() { - this.Given(_ => _.GivenUserIsOnTheCheckboxPage()) + this.Given(_ => _.GivenUserIsOnTheTextboxPage()) .When(_ => _.WhenMakeNotEmptyToShowNextField1IsNotEmpty()) .Then(_ => _.ThenNextField1IsShown()) .BDDfy(); diff --git a/MvcMegaForms/MVCMega.Forms.FunctionalTests/MVCMega.Forms.FunctionalTests.csproj b/MvcMegaForms/MVCMega.Forms.FunctionalTests/MVCMega.Forms.FunctionalTests.csproj index fe8a72c..f72c63d 100644 --- a/MvcMegaForms/MVCMega.Forms.FunctionalTests/MVCMega.Forms.FunctionalTests.csproj +++ b/MvcMegaForms/MVCMega.Forms.FunctionalTests/MVCMega.Forms.FunctionalTests.csproj @@ -13,6 +13,8 @@ v4.5.1 512 + + true @@ -36,9 +38,8 @@ false - - False - ..\packages\Castle.Core.3.1.0\lib\net40-client\Castle.Core.dll + + ..\packages\Castle.Core.4.3.1\lib\net45\Castle.Core.dll False @@ -56,8 +57,10 @@ ..\packages\NUnit.2.6.1\lib\nunit.framework.dll + + ..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.Helpers.dll True @@ -87,17 +90,17 @@ - - False - ..\packages\TestStack.BDDfy.3.12\lib\NET40\TestStack.BDDfy.dll + + ..\packages\TestStack.BDDfy.3.13\lib\NET40\TestStack.BDDfy.dll - - False - ..\packages\TestStack.Seleno.0.2\lib\NET40\TestStack.Seleno.dll + + ..\packages\TestStack.Seleno.0.9.61\lib\NET40\TestStack.Seleno.dll - - False - ..\packages\Selenium.WebDriver.2.25.1\lib\net40\WebDriver.dll + + ..\packages\Selenium.WebDriver.3.5.1\lib\net40\WebDriver.dll + + + ..\packages\Selenium.Support.2.53.0\lib\net40\WebDriver.Support.dll @@ -136,6 +139,13 @@ + + + + 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}. + + + + + win32 + mac64 + linux64 + + + chromedriver.exe + chromedriver + + + $(MSBuildThisFileDirectory)..\driver\$(WebDriverPlatform)\$(ChromeDriverName) + $(TargetDir) + + + + + + + + + + + ;$(ProjectTypeGuids); + + + true + false + + + + + + + + ;$(DefineConstants); + true + false + + + + + + + + + $(ChromeDriverName) + PreserveNewest + False + + + + + + + $(ChromeDriverName) + PreserveNewest + False + + + + + + + + + + + + \ No newline at end of file diff --git a/MvcMegaForms/packages/Selenium.WebDriver.ChromeDriver.2.42.0.1/driver/linux64/chromedriver b/MvcMegaForms/packages/Selenium.WebDriver.ChromeDriver.2.42.0.1/driver/linux64/chromedriver new file mode 100644 index 0000000..55ca0d2 Binary files /dev/null and b/MvcMegaForms/packages/Selenium.WebDriver.ChromeDriver.2.42.0.1/driver/linux64/chromedriver differ diff --git a/MvcMegaForms/packages/Selenium.WebDriver.ChromeDriver.2.42.0.1/driver/mac64/chromedriver b/MvcMegaForms/packages/Selenium.WebDriver.ChromeDriver.2.42.0.1/driver/mac64/chromedriver new file mode 100644 index 0000000..2cb6b81 Binary files /dev/null and b/MvcMegaForms/packages/Selenium.WebDriver.ChromeDriver.2.42.0.1/driver/mac64/chromedriver differ diff --git a/MvcMegaForms/packages/Selenium.WebDriver.ChromeDriver.2.42.0.1/driver/win32/chromedriver.exe b/MvcMegaForms/packages/Selenium.WebDriver.ChromeDriver.2.42.0.1/driver/win32/chromedriver.exe new file mode 100644 index 0000000..fb73769 Binary files /dev/null and b/MvcMegaForms/packages/Selenium.WebDriver.ChromeDriver.2.42.0.1/driver/win32/chromedriver.exe differ diff --git a/MvcMegaForms/packages/TestStack.BDDfy.3.12/TestStack.BDDfy.3.12.nupkg b/MvcMegaForms/packages/TestStack.BDDfy.3.12/TestStack.BDDfy.3.12.nupkg deleted file mode 100644 index 134d26c..0000000 Binary files a/MvcMegaForms/packages/TestStack.BDDfy.3.12/TestStack.BDDfy.3.12.nupkg and /dev/null differ diff --git a/MvcMegaForms/packages/TestStack.BDDfy.3.12/TestStack.BDDfy.3.12.nuspec b/MvcMegaForms/packages/TestStack.BDDfy.3.12/TestStack.BDDfy.3.12.nuspec deleted file mode 100644 index 7b11d07..0000000 --- a/MvcMegaForms/packages/TestStack.BDDfy.3.12/TestStack.BDDfy.3.12.nuspec +++ /dev/null @@ -1,13 +0,0 @@ - - - - TestStack.BDDfy - 3.12 - A simple to use and extend BDD framework for .Net programmers - Mehdi Khalili, Michael Whelan - Mehdi Khalili, Michael Whelan - http://teststack.github.com/TestStack.BDDfy/ - false - BDDfy is the simplest BDD framework to use and extend - - \ No newline at end of file diff --git a/MvcMegaForms/packages/TestStack.BDDfy.3.12/content/BDDfy.readme.txt b/MvcMegaForms/packages/TestStack.BDDfy.3.12/content/BDDfy.readme.txt deleted file mode 100644 index 6465e2c..0000000 --- a/MvcMegaForms/packages/TestStack.BDDfy.3.12/content/BDDfy.readme.txt +++ /dev/null @@ -1,162 +0,0 @@ -BDDfy is explained on Mehdi Khalili's blog in full details: http://www.mehdi-khalili.com/bddify-in-action/introduction - -This is a very short tutorial and quickstart. - -BDDfy is the simplest BDD framework EVER! To use BDDfy: - # Install NuGet if you have not already. - # Go to 'Tools', 'Library Package Manager', and click 'Package Manager Console'. - # In the console, type 'Install-Package BDDfy' and enter. - -This adds BDDfy assembly and its dependencies to your test project. Oh, BTW, BDDfy can work with any and all testing frameworks. In fact, it works even if you are not using any testing framework. - -If this is the first time you are using BDDfy you may want to check out some of the samples on NuGet. Just search NuGet for BDDfy and you will see a list of BDDfy samples. You may install one or more samples to see how the framework works. Each sample installs required packages (including BDDfy and NUnit). - -==Quick start== -Now that you have installed BDDfy, write your first test (this test is borrowed from ATM sample that you can install using nuget package BDDfy.Samples.ATM): - -{{{ -[Story( - AsA = "As an Account Holder", - IWant = "I want to withdraw cash from an ATM", - SoThat = "So that I can get money when the bank is closed")] -public class AccountHasInsufficientFund -{ - private Card _card; - private Atm _atm; - - // You can override step text using executable attributes - [Given(StepText = "Given the account balance is $10")] - void GivenAccountHasEnoughBalance() - { - _card = new Card(true, 10); - } - - void AndGivenTheCardIsValid() - { - } - - void AndGivenTheMachineContainsEnoughMoney() - { - _atm = new Atm(100); - } - - void WhenTheAccountHolderRequests20() - { - _atm.RequestMoney(_card, 20); - } - - void ThenTheAtmShouldNotDispenseAnyMoney() - { - Assert.AreEqual(0, _atm.DispenseValue); - } - - void AndTheAtmShouldSayThereAreInsufficientFunds() - { - Assert.AreEqual(DisplayMessage.InsufficientFunds, _atm.Message); - } - - void AndTheCardShouldBeReturned() - { - Assert.IsFalse(_atm.CardIsRetained); - } - - [Test] - public void Execute() - { - this.BDDfy(); - } -} - -}}} - -And this gives you a report like: -{{{ -Story: Account holder withdraws cash - As an Account Holder - I want to withdraw cash from an ATM - So that I can get money when the bank is closed - -Scenario: Account has insufficient fund - Given the account balance is $10 - And the card is valid - When the account holder requests $20 - Then the atm should not dispense any money - And the atm should say there are insufficient funds - And the card should be returned -}}} - -This is just the console report. Have a look at your output folder and you should see a nice html report too. - -If you want more control you can also use BDDfy's Fluent API. Here is another example done using the Fluent API: - -{{{ -[Test] -public void CardHasBeenDisabled() -{ - this.Given(s => s.GivenTheCardIsDisabled()) - .When(s => s.WhenTheAccountHolderRequests(20)) - .Then(s => s.CardIsRetained(true), "Then the ATM should retain the card") - .And(s => s.AndTheAtmShouldSayTheCardHasBeenRetained()) - .BDDfy(htmlReportName: "ATM"); -} -}}} - -which gives you a report like: -{{{ -Scenario: Card has been disabled - Given the card is disabled - When the account holder requests 20 - Then the ATM should retain the card - And the atm should say the card has been retained -}}} - -==How does BDDfy work?== -BDDfy uses quite a few conventions to make it frictionless to use. For your convenience, I will try to provide a quick tutorial below: - -===Finding steps=== -BDDfy scans your bddified classes for steps. Currently it has three ways of finding a step: - * Using attributes - * Using method name conventions - * And using fluent API. - -BDDfy runs your steps in the following order: SetupState, ConsecutiveSetupState, Transition, ConsecutiveTransition, Assertion, ConsecutiveAssertion and TearDown. Some of these steps are reported in the console and html reports and some of them are not. Please read below for further information. - -====Attributes==== -BDDfy looks for a custom attribute called ExecutableAttribute on your method. To make it easier to use, ExecutableAttribute has a few subclasses that you can use: you may apply Given, AndGiven, When, AndWhen, Then, and AndThen attributes on any method you want to make available to BDDfy. - -====Method name convention==== -BDDfy uses some conventions to find methods that should be turned into steps. Here is the current conventions. The method name: - - * ending with "Context" is considered as a setup method (not reported). - * "Setup" is considered as as setup method (not reported). - * starting with "Given" is considered as a setup method (reported). - * starting with "AndGiven" is considered as a setup method that runs after Context, Setup and Given steps (reported). - * starting with "When" is considered as a transition method (reported). - * starting with "AndWhen" is considered as a transition method that runs after When steps (reported). - * starting with "Then" is considered as an asserting method (reported). - * starting with "And" is considered as an asserting method (reported). - * starting with "TearDown" is considered as a finally method which is run after all the other steps (not reported). - -As you see in the above example you can mix and match the executable attributes and method name conventions to acheive great flexibility and power. - -====Fluent API==== -Fluent API gives you the absolute power over step selection and their titles. When you use Fluent API for a test, the attributes and method name conventions are ignored for that test. - -Pleasee note that you can have some tests using fluent API and some using a combination of attributes and method name conventions. Each .BDDfy() test works in isolation of others. - -==Other conventions== -BDDfy prefers convention over configuration; but it also allows you to configure pretty much all the conventions. Here I will try to list some of the conventions and the way you can override them: - -===Method name convention=== -As mentioned above, by default BDDfy uses method name convention to find your steps. You can override this using ExecutableAttribute or Fluent API as discussed above. - -===Step title convention=== -BDDfy extracts steps titles differently depending on the way steps are found: - -====When using method name convention==== - -====When using ExecutableAttributes==== - -====When using Fluent API==== - -===Scenario title convention=== diff --git a/MvcMegaForms/packages/TestStack.BDDfy.3.12/lib/NET35/TestStack.BDDfy.dll b/MvcMegaForms/packages/TestStack.BDDfy.3.12/lib/NET35/TestStack.BDDfy.dll deleted file mode 100644 index 77cde75..0000000 Binary files a/MvcMegaForms/packages/TestStack.BDDfy.3.12/lib/NET35/TestStack.BDDfy.dll and /dev/null differ diff --git a/MvcMegaForms/packages/TestStack.BDDfy.3.12/lib/NET40/TestStack.BDDfy.dll b/MvcMegaForms/packages/TestStack.BDDfy.3.12/lib/NET40/TestStack.BDDfy.dll deleted file mode 100644 index 387ea1f..0000000 Binary files a/MvcMegaForms/packages/TestStack.BDDfy.3.12/lib/NET40/TestStack.BDDfy.dll and /dev/null differ diff --git a/MvcMegaForms/packages/TestStack.BDDfy.3.13/TestStack.BDDfy.3.13.nuspec b/MvcMegaForms/packages/TestStack.BDDfy.3.13/TestStack.BDDfy.3.13.nuspec deleted file mode 100644 index 478e1c6..0000000 --- a/MvcMegaForms/packages/TestStack.BDDfy.3.13/TestStack.BDDfy.3.13.nuspec +++ /dev/null @@ -1,13 +0,0 @@ - - - - TestStack.BDDfy - 3.13 - A simple to use and extend BDD framework for .Net programmers - Mehdi Khalili, Michael Whelan - Mehdi Khalili, Michael Whelan - http://teststack.github.com/TestStack.BDDfy/ - false - BDDfy is the simplest BDD framework to use and extend - - \ No newline at end of file diff --git a/MvcMegaForms/packages/TestStack.Seleno.0.2/TestStack.Seleno.0.2.nupkg b/MvcMegaForms/packages/TestStack.Seleno.0.2/TestStack.Seleno.0.2.nupkg deleted file mode 100644 index 002e526..0000000 Binary files a/MvcMegaForms/packages/TestStack.Seleno.0.2/TestStack.Seleno.0.2.nupkg and /dev/null differ diff --git a/MvcMegaForms/packages/TestStack.Seleno.0.2/TestStack.Seleno.0.2.nuspec b/MvcMegaForms/packages/TestStack.Seleno.0.2/TestStack.Seleno.0.2.nuspec deleted file mode 100644 index 9063930..0000000 --- a/MvcMegaForms/packages/TestStack.Seleno.0.2/TestStack.Seleno.0.2.nuspec +++ /dev/null @@ -1,15 +0,0 @@ - - - - TestStack.Seleno - 0.2 - Seleno - Mehdi Khalili, Michael Whelan - Mehdi Khalili, Michael Whelan - http://teststack.github.com/TestStack.Seleno/ - false - Seleno helps you write automated UI tests in the right way (using Selenium WebDriver) - The baseline for Seleno - Copyright 2012 TestStack - - \ No newline at end of file diff --git a/MvcMegaForms/packages/TestStack.Seleno.0.2/lib/NET40/TestStack.Seleno.dll b/MvcMegaForms/packages/TestStack.Seleno.0.2/lib/NET40/TestStack.Seleno.dll deleted file mode 100644 index d91630b..0000000 Binary files a/MvcMegaForms/packages/TestStack.Seleno.0.2/lib/NET40/TestStack.Seleno.dll and /dev/null differ diff --git a/MvcMegaForms/packages/TestStack.Seleno.0.9.61/TestStack.Seleno.0.9.61.nupkg b/MvcMegaForms/packages/TestStack.Seleno.0.9.61/TestStack.Seleno.0.9.61.nupkg new file mode 100644 index 0000000..638d08f Binary files /dev/null and b/MvcMegaForms/packages/TestStack.Seleno.0.9.61/TestStack.Seleno.0.9.61.nupkg differ diff --git a/MvcMegaForms/packages/TestStack.Seleno.0.9.61/lib/NET40/TestStack.Seleno.XML b/MvcMegaForms/packages/TestStack.Seleno.0.9.61/lib/NET40/TestStack.Seleno.XML new file mode 100644 index 0000000..68a759a --- /dev/null +++ b/MvcMegaForms/packages/TestStack.Seleno.0.9.61/lib/NET40/TestStack.Seleno.XML @@ -0,0 +1,932 @@ + + + + TestStack.Seleno + + + + + The browser that is viewing the page the DOM was captured from. + + + + + Captures the DOM using the given filename (if specified). + + The filename to use to save the DOM as + + + + Generates ids for HTML controls. + + + + + Generates a control name from a lambda expression of a property representing the control. + + A lambda expression of the property representing the control + The name of the HTML control + + + + Generates a control id from the name of the control. + + The name of the control + The id of the HTML control + + + + Defines an instance of a running Seleno Application and associated web browser and Seleno test entry points. + + + + + Initialise the application. + + + + + Access the Selenium Web Driver browsing the web application being tested. + + + + + Access the web server running the web application being tested. + + + + + Access the camera that takes screenshots of the web application being tested. + + + + + Access the logger. + + + + + Navigate to the initial page in a test by looking up the URL using an MVC controller and action and then return a page object instance of the specified type. + Note: Requires you to have configured the seleno application with a Route Config. + + The type of the MVC controller containing the action to visit + The type of page object to intialise and return + A lambda expression that specifies the action to navigate to + Extra route data to use to generate the route + An initialised page object + + + + Navigate to the initial page in a test by looking up the URL using an MVC controller and action and then return a page object instance of the specified type. + Note: Requires you to have configured the seleno application with a Route Config. + + The type of the MVC controller containing the action to visit + The type of page object to intialise and return + A lambda expression that specifies the action to navigate to + Extra route data to use to generate the route as an anonymous object + An initialised page object + + + + Navigate to the initial page in a test via a URL string relative to the root of the web application and then return a page object instance of the specified type. + + The type of page object to initialise and return + A URL string, either relative to the root of the web application being tested or absoluate URL + An initialised page object + + + + Gets or sets the size of the outer browser window, including title bars and window borders. When setting this property, it should act as the JavaScript window.resizeTo() method. + + The integer width component of the window size + The integer height component of the window size + + + + Takes a screenshot of the currently active browser window, saves it to the configured location, and throws a SelenoException. + + The name of the image + The error message that will be applied to the SelenoException + + + + Captures the dom of the currently active browser window, saves it to the configured location, and throws a SelenoException. + + The name of the capture + The error message that will be applied to the SelenoException + + + + Configure a Seleno test. + + + + + Specify the details of the project you are testing. + + The project you are testing + The configurator to allow for method chaining + + + + Specify the web server you would like to use. + By default the IISExpressWebServer is used. + + The webserver to use + The configurator to allow for method chaining + + + + Specify the web driver/browser you would like to use. + By default Firefox is used. + + The web driver + The configurator to allow for method chaining + + + + Specify the minimum amount of time in seconds to wait when trying to find elements on the page. + By default the minimum wait is 10 seconds. + + The minimum number of seconds to wait to find an element on the page + The configurator to allow for method chaining + + + + Specify the camera you would like to use. + By default no camera is used. + + The camera + The configurator to allow for method chaining + + + + Specify the directory path to store screenshots in. + + The directory to store screenshots in + The configurator to allow for method chaining + + + + Specify the logger factory you would like to use. + By default a null logger is used. + + The logger factory + The configurator to allow for method chaining + + + + Define the routes for the application. + + A method that takes a route collection and populates it with routes + The configurator to allow for method chaining + + + + Specify a control id generator to use; default is , Seleno also has an + and you can implement your own by implementing the interface. + + An instance of the interface + The configurator to allow for method chaining + + + + Adds an environment variable to be injected into the web application process + + The name of the environment variable + The optional value of the environment variable + + + + Class with ability to take screenshots. + + + + + Take a screenshot using the given filename (if specified). + + The filename to use to save the screenshot + + + + The driver to take screenshots with - will be set after the camera is registered with Seleno. + + + + + The browser that is viewing the page the screenshot is taken against. + + + + + Copied from System.Web.Mvc.TagBuilder + + + + + Default control id generator - uses the property name of the last property in the lambda expression chain. + + + + + Default control id generator - uses the same algorithm ASP.NET MVC uses to generate control ids. + + + + + Captures the DOM to a file + + + + + DOM Capturer that doesn't actually do anything + + + + + Wraps an exception that has been received and processed by Seleno. + + + + + Creates a . + + The exception that has been caught and processed by Seleno + + + + The location of the Visual Studio web project under test. + + + + + The absolute path to the web project. + + + The full path. + + + + + + + + + + + Returns the project location from the absolute file path to the web project. + + The web project full path. + + + + + Returns the project location from the folder name of the web project. + + Name of the web project folder. + + + + Defines a web application that exists at a location and can be deployed to a certain port number. + + + + + The location of the web application. + + + + + The port number the web application will be deployed to. + + + + + Environment variables to be injected into the web site process + + + + + Create a web application using the given location and port number. + + The location of the web application + The port number the web application will be deployed to + + + + Adds an environment variable to be injected into the web application process + + + + + + + AppConfiguration Exception throw during the set up of webserver. + + + + + AppConfiguration Exception throw during the set up of webserver. + + + + + AppConfiguration Exception throw during the set up of webserver. + + + + + AppConfiguration Exception throw during the set up of webserver. + + + + + Allows the creation of Browser specific web drivers. + + + + + Returns an initialised PhantomJS Web Driver. + + You need to have phantomjs.exe embedded into your assembly + Initialised PhantomJS driver + + + + Returns an initialised PhantomJS Web Driver. + + You need to have phantomjs.exe embedded into your assembly + Options to configure the driver + Initialised PhantomJS driver + + + + Returns an initialised Chrome Web Driver. + + You need to have chromedriver.exe embedded into your assembly and have Chrome installed on the machine running the test + Initialised Chrome driver + + + + Returns an initialised Chrome Web Driver. + + You need to have chromedriver.exe embedded into your assembly and have Chrome installed on the machine running the test + Options to configure the driver + Initialised Chrome driver + + + + Returns an initialised Firefox Web Driver. + + You need to have Firefox installed on the machine running the test + Initialised Firefox driver + + + + Returns an initialised Firefox Web Driver. + + You need to have Firefox installed on the machine running the test + Profile to use for the driver + Initialised Firefox driver + + + + Returns an initialised Safari Web Driver. + + You need to have Safari installed on the machine running the test + Initialised Safari driver + + + + Returns an initialised Safari Web Driver. + + You need to have Safari installed on the machine running the test + Profile to use for the driver + Initialised Safari driver + + + + Returns an initialised 64-bit IE Web Driver. + + You need to have IEDriverServer_x64_2.28.0.exe embedded into your assembly + Initialised IE driver + + + + Returns an initialised 64-bit IE Web Driver. + + You need to have IEDriverServer_x64_2.28.0.exe embedded into your assembly + Options to configure the driver + Initialised IE driver + + + + Exception to record inability to find a Web Driver. + + + + + Create a web driver not found exception for the given driver. + + The name of the expected executable to be embedded in the assembly + + + + Exception to record inability to find a Browser. + + + + + Create a web driver not found exception for the given driver. + + The name of the expected browser + The exception that indicated the browser couldn't be found + + + + Adds an environment variable to be injected into the web application process + + The name of the environment variable + The optional value of the environment variable + + + Obsolete + + + + Obsolete + + + + + Obsolete + + + + + Obsolete + + + + + The entry point for Seleno. + + + + + The currently running seleno application. + + + + + Begin a Seleno test for a Visual Studio web project. + + The name of the web project to run + The port number to run the project under + Any configuration changes you would like to make + + + + Begin a Seleno test for a web application. + + The web application to test + Any configuration changes you would like to make + + + + Begin a Seleno test. + + Any configuration changes you would like to make + + + + Navigate to the given controller action and return an initialised page object of the specified type. + + The controller to navigate to + The type of page object to initialise and return + The controller action to navigate to + Extra route data to use to generate the route + The initialised page object + + + + Navigate to the given controller action and return an initialised page object of the specified type. + + The controller to navigate to + The type of page object to initialise and return + The controller action to navigate to + Extra route data to use to generate the route as an anonymous object + The initialised page object + + + + Navigate to the given URL and return an initialised page object of the specified type. + + The type of page object to initialise and return + The URL to navigate to (either relative to the base URL of the site or an absolute URL) + The initialised page object + + + + Camera that saves screenshots to a file. + + + + + Constructs a FileCamera. + + The file system directory to save screenshots in + + + + Camera that doesn't take any screenshots. + + + + + Create a SelenoApplication + + An Autofac container that will be owned by the SelenoApplication and disposed by the SelenoApplication + + + + Base class for exceptions that the Seleno library throws. + + + + + Create Seleno exception without message. + + + + + Create Seleno exception with message. + + Exception message + + + + Create Seleno exception with message and inner exception. + + Exception message + Inner exception + + + + Extension methods against an . + + + + + Returns the value for the given HTML attribute on the and type casts it the the requested type. + + The type to cast the value to + The element to return the attribute value from + The name of the attribute to return the value for + The type-casted value + + + + Returns the value for the "value" HTML attribute on the and type casts it the the requested type. + + The type to cast the value to + The element to return the value attribute value from + The type-casted value attribute value + + + Obsolete + + + Obsolete + + + Obsolete + + + Obsolete + + + Obsolete + + + Obsolete + + + + Generic method to convert from one type to another and returns the strongly typed value. + Returns default value for type if cannot convert. + + + + + Converts from one type to another and returns the value. Returns default value for type if cannot convert. + + + + + Navigate to a different page. + + + + + Navigate to a different page by clicking on an element in the page. + + The page object type for the expected resultant page + The element to find in the current page and click + Maximum amount of time to wait for the element to become available to click + An instantiated and initialised page object + + + + Navigate to a different page by clicking on an element in the page. + + The page object type for the expected resultant page + jQuery expression to find an element + Maximum amount of time to wait for the element to become available to click + An instantiated and initialised page object + + + + Navigate to a different page by going to a URL (relative to the root URL of the application under test). + + The page object type for the expected resultant page + The URL, either relative to the root URL of the application under test or the absolute URL, to navigate to + An instantiated and initialised page object + + + + Navigate to a different page by going to a URL by an ASP.NET MVC route. + + The type of the controller that is serving the page you are navigating to + The page object type for the expected resultant page + An expression representing the controller action being navigated to + Extra route data to use to generate the route + An instantiated and initialised page object + + + + Navigate to a different page by going to a URL by an ASP.NET MVC route. + + The type of the controller that is serving the page you are navigating to + The page object type for the expected resultant page + An expression representing the controller action being navigated to + Extra route data to use to generate the route as an anonymous object + An instantiated and initialised page object + + + Obsolete + + + Obsolete + + + + Executes JavaScript on the page and actions on elements in the page. + + + + + Locate an element using a Selenium Web Driver expression and performs an action on the element if found. + Throws an exception if the element isn't found. + + + Execute.ActionOnLocator(By.Id("helloworld"), e => e.ClearAndSendKeys("xyz")) + + Selenium Web Driver expression to find an element + The action to perform when the element is found + Maximum amount of time to wait for the element to become available + When the element isn't found + The representing the found element + + + + Locate an element using a jQuery expression and performs an action on the element if found. + Throws an exception if the element isn't found. + + + Execute.ActionOnLocator(By.jQuery("#helloworld"), e => e.ClearAndSendKeys("xyz")) + + jQuery expression to find an element + The action to perform when the element is found + Maximum amount of time to wait for the element to become available + When the element isn't found + The representing the found element + + + + Executes some JavaScript that returns a boolean and waits until its returned value is true + + The predicate javaScript to execute + Maximum amount of time to wait for predicate Javascript to return true (default is 5 seconds) + When the executed JavaScript took more than maxWait to execute + + + + Executes some JavaScript and returns the return value type-casted to the given type. + + The JavaScript to execute + The type to cast the return value to + The type-casted value as returned from the JavaScript execution + + + + Executes some JavaScript and returns the return value type-casted to the given type. + + The type to cast the return value to + The JavaScript to execute + The type-casted value as returned from the JavaScript execution + + + + Executes the given JavaScript. + + The JavaScript to execute + + + Obsolete + + + Obsolete + + + + Wait until ajax calls are complete + + Maximum amount of time to wait for ajax calls to be completed (default is 5 seconds) + When the ajax calls took more than maxWait to execute + + + + Provides an API to find elements on the page. + + + + + Locate an element using a Selenium Web Driver expression and return the corresponding to that element. + Throws an exception if the element isn't found. + + + Find.Element(By.Id("helloworld")) + + Selenium Web Driver expression to find an element + Maximum amount of time to wait for the element to become available + When the element isn't found + The representing the element + + + + Locate an element using a jQuery expression and return the corresponding to that element. + Throws an exception if the element isn't found. + + + Find.Element(By.jQuery("#helloworld")) + + jQuery expression to find an element + Maximum amount of time to wait for the element to become available + When the element isn't found + The representing the element + + + + Locates multiple elements using a Selenium Web Driver expression and return the list ofs that match. + Returns an empty list of no elements found + + + Find.Elements(By.ClassName("helloworld")) + + Selenium Web Driver expression to find elements + Maximum amount of time to wait for the elements to become available + The s that matched the search + + + + Locates multiple elements using a jQuery expression and return the list ofs that match. + Returns an empty list of no elements found + + + Find.Elements(By.jQuery("#helloworld")) + + jQuery expression to find elements + Maximum amount of time to wait for the elements to become available + The s that matched the search + + + + Locate an element that may or not be present using a Selenium Web Driver expression and return the corresponding to that element. + Returns null if the element isn't found. + + + Find.OptionalElement(By.Id("helloworld")) + + Selenium Web Driver expression to find an element + Maximum amount of time to wait for the element to become available + The representing the element + + + + Locate an element that may or not be present using a jQuery expression and return the corresponding to that element. + Returns null if the element isn't found. + + + Find.OptionalElement(By.jQuery("#helloworld")) + + jQuery expression to find an element + Maximum amount of time to wait for the element to become available + The representing the element + + + Obsolete + + + Obsolete + + + Obsolete + + + + Return a row In the Grid reading data of the HTML page and mapping it back to the ViewModel used to generate it + + number of the row 1 based + + + + + Retrieve a cell value in grid for specified row number + + number of the row in the grid to click on (1 based) + An expression that indicates which property to get the value for in the given row + The value of the requested cell + + + + Wait until ajax calls are complete + + Maximum amount of time to wait for ajax calls to be completed (default is 5 seconds) + When the ajax calls took more than maxWait to execute + + + + jQuery selector + + + + + Specialized "ActionOnLocator" class for jQuery selector + + + + + Return whether jQuery is loaded in the current page + + + + + Load jQuery from an external URL to the current page + + + + + Gets the HTML using jQuery selector class + + + + + Overloads the FindElement function to include support for the jQuery selector class + + + + + Overloads the FindElement function to include support for the jQuery selector class + + + + + Overloads the FindElement function to include support for the jQuery selector class + + + + + Overloads the FindElements function to include support for the jQuery selector class + + + + + Strongly-typed extension of UiComponent. + + + + + + Simple helper to return the name of the property passed in as a lambda expression. + This method helps prevent the need for magic strings and the declaration of the return type, TU, + rather than "object" prevents errors with boxing value types. + + + + + Base class for Page Objects and Components + + + + diff --git a/MvcMegaForms/packages/TestStack.Seleno.0.9.61/lib/NET40/TestStack.Seleno.dll b/MvcMegaForms/packages/TestStack.Seleno.0.9.61/lib/NET40/TestStack.Seleno.dll new file mode 100644 index 0000000..7ab0794 Binary files /dev/null and b/MvcMegaForms/packages/TestStack.Seleno.0.9.61/lib/NET40/TestStack.Seleno.dll differ diff --git a/MvcMegaForms/packages/TestStack.Seleno.0.9.61/lib/NET40/TestStack.Seleno.pdb b/MvcMegaForms/packages/TestStack.Seleno.0.9.61/lib/NET40/TestStack.Seleno.pdb new file mode 100644 index 0000000..7668311 Binary files /dev/null and b/MvcMegaForms/packages/TestStack.Seleno.0.9.61/lib/NET40/TestStack.Seleno.pdb differ diff --git a/MvcMegaForms/packages/TestStack.Seleno.0.9.61/tools/init.ps1 b/MvcMegaForms/packages/TestStack.Seleno.0.9.61/tools/init.ps1 new file mode 100644 index 0000000..54b6c89 --- /dev/null +++ b/MvcMegaForms/packages/TestStack.Seleno.0.9.61/tools/init.ps1 @@ -0,0 +1,3 @@ +param($installPath, $toolsPath, $package, $project) + +Import-Module (Join-Path $toolsPath "webdriver_installs.psm1") diff --git a/MvcMegaForms/packages/TestStack.Seleno.0.9.61/tools/webdriver_installs.psm1 b/MvcMegaForms/packages/TestStack.Seleno.0.9.61/tools/webdriver_installs.psm1 new file mode 100644 index 0000000..c9c80e3 --- /dev/null +++ b/MvcMegaForms/packages/TestStack.Seleno.0.9.61/tools/webdriver_installs.psm1 @@ -0,0 +1,67 @@ +function Install-ChromeDriver() { + Install-Package Selenium.WebDriver.ChromeDriver + Write-Host "Successfully added chrome web driver for use with Seleno." +} + +function Install-PhantomJSDriver() { + Write-Host "Installing phantomjs.exe package" + Install-Package phantomjs.exe + + Write-Host "Marking phantomjs.exe as embedded resource." + Set-RootProjectFileAsEmbeddedResource "phantomjs.exe" + + Write-Host "Successfully added PhantomJS web driver for use with Seleno." +} + +function Install-IE64Driver() { + Install-EmbeddedFileFromNugetPackageTools "WebDriver.IEDriver" "IEDriverServer.exe" + Write-Host "Successfully added IE web driver for use with Seleno." +} + +function Install-IE32Driver() { + Install-Package Selenium.WebDriver.IEDriver + Write-Host "Successfully added IE web driver for use with Seleno." +} + +function Install-EmbeddedFileFromNugetPackageTools($packageName, $fileInToolsDirToEmbed) { + Write-Host "Installing $packageName package" + Install-Package $packageName + + Write-Host "Adding $fileInToolsDirToEmbed to project." + $file = Join-Path (Get-PackageToolsDir $packageName) $fileInToolsDirToEmbed + Update-RootProjectFile $file $fileInToolsDirToEmbed + + Write-Host "Marking $fileInToolsDirToEmbed as embedded resource." + Set-RootProjectFileAsEmbeddedResource $fileInToolsDirToEmbed +} + +function Get-PackageToolsDir($packageName) { + $toolsPath = $PSScriptRoot + $packagesDir = Join-Path (Join-Path $toolsPath "..") ".." + $packageDir = Get-ChildItem $packagesDir | Where-Object { $_.Name -like "$packageName.*" } | Select-Object -First 1 + return Join-Path (Join-Path $packagesDir $packageDir) "tools" +} + +function Update-RootProjectFile($source, $destination) { + $project = Get-Project + $item = $project.ProjectItems | Where-Object { $_.Name -eq $destination } | Select-Object -First 1 + if ($item -ne $null) { + $item.Remove() + } + try { + $project.ProjectItems.AddFromFile($source) + } + catch {} + $item = $project.ProjectItems | Where-Object { $_.Name -eq $destination } | Select-Object -First 1 + if ($item -eq $null) { + Write-Error "Unable to add $destination to project root." + return + } +} + +function Set-RootProjectFileAsEmbeddedResource($file) { + $project = Get-Project + $item = $project.ProjectItems | Where-Object { $_.Name -eq $file } | Select-Object -First 1 + $item.Properties.Item("BuildAction").Value = [int]3 # Embed + $item.Properties.Item("CopyToOutputDirectory").Value = [int]0 # Do not copy +}