Skip to content

Commit

Permalink
Merge dev to master (#156)
Browse files Browse the repository at this point in the history
* Fix workItemIdentifier bug (#108)

* Work item id error fixed (#110)

* delete error message when close & workItemId trim

* trim workItemId addFt

* app & env error message fixed

* Pbi60040 (#111)

* require reason for true/false change

* renaming

* change true/false to enabled/disabled

* CR

* leftovers

* Color changed for enabled/disabled ft for require reason (#112)

* work Item Id error fix (#113)

* work Item Id error fix

* CR

* changed css selectors

* Pbi60462 (#116)

* Add reason to change

* merge fixed

* leftovers

* textarea similar to input (#117)

scroll hidden
rows:2
reduce distance
word-break

* empty reason fixed (#118)

* empty reason fixed

* string empty or null

* leftovers

* Refactor (1) - Split components

* refactoring

* Refactor part 2

* Send props

* Refactor Delete Feature Toggle

* Rename

* Intermediary commit - edit feature toggle

* Updates

* Finish EditFeatureToggle.vue

* Finish EditFeatureToggle

* styling and update ft tests

* Refactor EditEnvironment & DeleteEnvironment

* Try fix Grid bug

* loadGridData before ResetGrid

* Update Toggle Schedule

* Rearrange files & start replacing events

* Fix grid error

* add events list

Co-authored-by: UrcanMiruna <urcan.miruna@yahoo.com>

* Fix config file

* refactoring

* Refactor part 2

* Send props

* Refactor Delete Feature Toggle

* Rename

* Intermediary commit - edit feature toggle

* Updates

* Finish EditFeatureToggle.vue

* Finish EditFeatureToggle

* styling and update ft tests

* Refactor EditEnvironment & DeleteEnvironment

* Try fix Grid bug

* loadGridData before ResetGrid

* Update Toggle Schedule

* Rearrange files & start replacing events

* Fix grid error

* add events list

* add appSettings

Co-authored-by: Patricia Mazere <patriciamazere@gmail.com>

* updated moggles to .net core 3.1 (#121)

Co-authored-by: andrei.lengyel@evozon.onmicrosoft.com <andrei.lengyel@evozon.onmicrosoft.com>

* Bug60989 (#122)

* Delete reason when deleting an environment

* reasonToChange delete methods

* CR

* add reason only when an environment status was changed

* renaming

* CR

* renamed computed method

* fixed build error

* Pbi60039 (#123)

* add arrows

* Change order of an environment

* UI fix for move left/right for environments

* CR fixes

* initialize data when open modal

Co-authored-by: Corey Hickok <corey@cynergydigital.com>

* add 's'

* reset SortOrder for existing apps and environments (#125)

* reset SortOrder for existing apps and environments

* add unitTests

* added ids for buttons, modals (#127)

* renamed ids (#128)

* renamed ids

* renamed id

* updated selectors

* remove unused imports

* fix tests and update selectors

* update chromedriver to v81

* Update packages (#133)

* Fix security issues

* Update

* Remove not used package-lock.json (#134)

* Fix security issues

* Update

* Remove incorrect package-lock.json

* env name on forceCacheRefresh displayed properly (#135)

* forceCacheRefresh fixed (#136)

* Pbi61730 (#137)

* tests fixes

* leftovers

* delete jest dependencies (#138)

* UI test fix (#140)

* Fix security issue (#141)

* Fix security issues

* Update

* Remove incorrect package-lock.json

* Update lock file

* Pbi61847 2 (#143)

* Update packages

* ui tests fixes

* delete leftovers

Co-authored-by: Patricia Mazere <patriciamazere@gmail.com>

* show spinner while loading the toggles

* add testingframework nuget pkg

* refactor

* refactoring

* fix

* Added error display for UI (#146)

Co-authored-by: andrei.lengyel@evozon.onmicrosoft.com <andrei.lengyel@evozon.onmicrosoft.com>

* Add retry policy (#148)

* refactor UI tests

* add wait method

* added Changed column for Feature Toggles grid

* Added trim to feature toggle name

* fix test

* update testing pkg

* refactor

* updates

* add wait for page spinner

* Sortable Created column

* Merge from dev

* Update merge from dev

* Update merge from dev

* Update merge to dev

Co-authored-by: UrcanMiruna <48584507+UrcanMiruna@users.noreply.github.com>
Co-authored-by: Loredana Moga <loredanamoga7@gmail.com>
Co-authored-by: loredanamoga7 <59011154+loredanamoga7@users.noreply.github.com>
Co-authored-by: UrcanMiruna <urcan.miruna@yahoo.com>
Co-authored-by: andreilengyel <andrei.lengyel@evozon.com>
Co-authored-by: andrei.lengyel@evozon.onmicrosoft.com <andrei.lengyel@evozon.onmicrosoft.com>
Co-authored-by: Corey Hickok <corey@cynergydigital.com>
Co-authored-by: Corey Hickok <chickok@cynergydigital.com>
  • Loading branch information
9 people authored Jul 10, 2020
1 parent 4451b0f commit 14c133a
Show file tree
Hide file tree
Showing 49 changed files with 44,793 additions and 110,493 deletions.
2 changes: 1 addition & 1 deletion Moggles.Domain/FeatureToggle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void MarkAsNotDeployed(string envName)
public FeatureToggleStatus GetFeatureToggleStatusForEnv(string envName)
{
return FeatureToggleStatuses.FirstOrDefault(fts =>
string.Compare(fts.EnvironmentName, envName, StringComparison.OrdinalIgnoreCase) == 0);
string.Compare(fts.EnvironmentName, envName.Trim(), StringComparison.OrdinalIgnoreCase) == 0);
}
public void ChangeEnvironmentnameForFeatureToggleStatus(string oldEnvName, string NewEnvName)
{
Expand Down
6 changes: 4 additions & 2 deletions Moggles.EndToEndTests/Moggles.EndToEndTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DotNetSeleniumExtras.WaitHelpers" Version="3.11.0" />
<PackageReference Include="FluentAssertions" Version="5.9.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="1.0.19269.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.0.1" />
Expand All @@ -23,9 +24,10 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NSTestFrameworkDotNetCoreUI" Version="1.19.1113.2" />
<PackageReference Include="NSTestFrameworkUI" Version="1.20.630.1" />
<PackageReference Include="RestSharp" Version="106.6.10" />
<PackageReference Include="Selenium.Chrome.WebDriver" Version="81.0.0" />
<PackageReference Include="Selenium.Chrome.WebDriver" Version="83.0.0" />
<PackageReference Include="Selenium.Support" Version="3.141.0" />
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.7.0" />
</ItemGroup>
Expand Down
364 changes: 165 additions & 199 deletions Moggles.EndToEndTests/MogglesPages/FeatureTogglesPage.cs

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions Moggles.EndToEndTests/SmokeTests/AddANewFeatureToggle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moggles.EndToEndTests.TestFramework;
using MogglesEndToEndTests.TestFramework;
using NSTestFrameworkDotNetCoreUI.Helpers;
using NsTestFrameworkUI.Helpers;

namespace MogglesEndToEndTests.SmokeTests
{
[TestClass]
public class AddANewFeatureToggle : BaseTest
public class AddAndDeleteNewFeatureToggle : BaseTest
{
[TestMethod]
[TestCategory("AddFeatureToggle")]
[TestCategory("SmokeTests")]

public void AddANewFeatureToggle_TheFeatureToggleIsAdded()
public void AddAndDeleteANewFeatureToggle_TheFeatureToggleIsAddedAndDeleted()
{
//act
Browser.Goto(Constants.BaseUrl);
Pages.FeatureTogglesPage.SelectASpecificApplication(Constants.SmokeTestsApplication);
Pages.FeatureTogglesPage.SelectApplicationByName(Constants.SmokeTestsApplication);
Pages.FeatureTogglesPage.AddFeatureToggle(Constants.FeatureToggleName);

//assert
Pages.FeatureTogglesPage.NewAddedFeatureToggleIsVisible(Constants.FeatureToggleName).Should().BeTrue();
Pages.FeatureTogglesPage.CreationDateIsCorrectlyDisplayed(Constants.FeatureToggleName).Should().BeTrue();
}
Pages.FeatureTogglesPage.IsFeatureToggleDisplayed(Constants.FeatureToggleName).Should().BeTrue();
Pages.FeatureTogglesPage.IsCreationDateCorrectlyDisplayed(Constants.FeatureToggleName).Should().BeTrue();

[TestCleanup]
public override void After()
{
//act
Pages.FeatureTogglesPage.DeleteFeatureToggle(Constants.FeatureToggleName);
base.After();

//assert
Pages.FeatureTogglesPage.IsGridEmpty().Should().BeTrue();
}

}
}
28 changes: 0 additions & 28 deletions Moggles.EndToEndTests/SmokeTests/DeleteAFeatureToggle.cs

This file was deleted.

8 changes: 4 additions & 4 deletions Moggles.EndToEndTests/SmokeTests/EditAndDeleteApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moggles.EndToEndTests.TestFramework;
using MogglesEndToEndTests.TestFramework;
using NSTestFrameworkDotNetCoreUI.Helpers;
using NsTestFrameworkUI.Helpers;

namespace MogglesEndToEndTests.SmokeTests
{
Expand All @@ -18,18 +18,18 @@ public void EditAndDeleteApplication_TheApplicationIsUpdatedAndAfterThatDeleted(
//act
Browser.Goto(Constants.BaseUrl);
Pages.FeatureTogglesPage.AddNewApplication(Constants.NewApplicationName, Constants.FirstEnvName);
Pages.FeatureTogglesPage.SelectASpecificApplication(Constants.NewApplicationName);
Pages.FeatureTogglesPage.SelectApplicationByName(Constants.NewApplicationName);
Pages.FeatureTogglesPage.ChangeApplicationName(Constants.NewApplicationName,Constants.EditedApplicationName);

//assert
Pages.FeatureTogglesPage.ApplicationIsSelected(Constants.EditedApplicationName);
Pages.FeatureTogglesPage.GetSelectedApplicationName().Equals(Constants.EditedApplicationName).Should().BeTrue();
Pages.FeatureTogglesPage.IsGridEmpty().Should().BeTrue();

//act
Pages.FeatureTogglesPage.DeleteApplication(Constants.EditedApplicationName);

//assert
Pages.FeatureTogglesPage.ApplicationNameExists(Constants.EditedApplicationName).Should().BeFalse();
Pages.FeatureTogglesPage.IsApplicationListed(Constants.EditedApplicationName).Should().BeFalse();
}
}
}
8 changes: 4 additions & 4 deletions Moggles.EndToEndTests/SmokeTests/EditAndDeleteEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moggles.EndToEndTests.TestFramework;
using MogglesEndToEndTests.TestFramework;
using NSTestFrameworkDotNetCoreUI.Helpers;
using NsTestFrameworkUI.Helpers;

namespace MogglesEndToEndTests.SmokeTests
{
Expand All @@ -18,19 +18,19 @@ public void EditAndDeleteEnvironment_TheEnvironmentIsUpdatedAndAfterThatDeleted(
//act
Browser.Goto(Constants.BaseUrl);
Pages.FeatureTogglesPage.AddNewApplication(Constants.NewApplicationName, Constants.FirstEnvName);
Pages.FeatureTogglesPage.SelectASpecificApplication(Constants.NewApplicationName);
Pages.FeatureTogglesPage.SelectApplicationByName(Constants.NewApplicationName);
Pages.FeatureTogglesPage.AddNewEnvironment(Constants.SecondEnvName);
Pages.FeatureTogglesPage.EditEnvironment(Constants.SecondEnvName);
Pages.FeatureTogglesPage.ChangeEnvironmentName(Constants.EditedSecondEnvName);

//assert
Pages.FeatureTogglesPage.EnvironmentNameExist(Constants.EditedSecondEnvName).Should().BeTrue();
Pages.FeatureTogglesPage.IsEnvironmentNameDisplayed(Constants.EditedSecondEnvName).Should().BeTrue();

//act
Pages.FeatureTogglesPage.DeleteEnvironment(Constants.EditedSecondEnvName);

//assert
Pages.FeatureTogglesPage.EnvironmentNameExist(Constants.EditedSecondEnvName).Should().BeFalse();
Pages.FeatureTogglesPage.IsEnvironmentNameDisplayed(Constants.EditedSecondEnvName).Should().BeFalse();
}

[TestCleanup]
Expand Down
4 changes: 2 additions & 2 deletions Moggles.EndToEndTests/SmokeTests/EnvironmentsLastUpdated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moggles.EndToEndTests.TestFramework;
using MogglesEndToEndTests.TestFramework;
using NSTestFrameworkDotNetCoreUI.Helpers;
using NsTestFrameworkUI.Helpers;

namespace MogglesEndToEndTests.SmokeTests
{
Expand All @@ -17,7 +17,7 @@ public void AddFeatureToggle_DevAndQaEnvironmentsAreUpdated()
{
//act
Browser.Goto(Constants.BaseUrl);
Pages.FeatureTogglesPage.SelectASpecificApplication(Constants.SmokeTestsApplication);
Pages.FeatureTogglesPage.SelectApplicationByName(Constants.SmokeTestsApplication);
Pages.FeatureTogglesPage.AddFeatureToggle(Constants.FeatureToggleName);
Pages.FeatureTogglesPage.EditFeatureToggle(Constants.FeatureToggleName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moggles.EndToEndTests.TestFramework;
using MogglesEndToEndTests.TestFramework;
using NSTestFrameworkDotNetCoreUI.Helpers;
using NsTestFrameworkUI.Helpers;

namespace MogglesEndToEndTests.SmokeTests
{
[TestClass]
public class IsAcceptedByUserFeatureToggle : BaseTest
{
[TestMethod]
[Ignore]
[TestCategory("IsAcceptedByUser")]
[TestCategory("SmokeTests")]

public void EditAFeatureToggleToBeAcceptedByUser()
{
//act
Browser.Goto(Constants.BaseUrl);
Pages.FeatureTogglesPage.SelectASpecificApplication(Constants.SmokeTestsApplication);
Pages.FeatureTogglesPage.SelectApplicationByName(Constants.SmokeTestsApplication);
Pages.FeatureTogglesPage.AddFeatureToggle(Constants.FeatureToggleName);
Pages.FeatureTogglesPage.EditFeatureToggle(Constants.FeatureToggleName);
Pages.FeatureTogglesPage.SetFeatureToggleAsAcceptedByUser();
Expand All @@ -27,10 +26,10 @@ public void EditAFeatureToggleToBeAcceptedByUser()
Pages.FeatureTogglesPage.IsGridEmpty().Should().BeTrue();

//act
Pages.FeatureTogglesPage.FilterByAcceptedByUser(Constants.AcceptedByUserStatus);
Pages.FeatureTogglesPage.FilterAcceptedByUserColumn(Constants.AcceptedByUserStatus);

//assert
Pages.FeatureTogglesPage.NewAddedFeatureToggleIsVisible(Constants.FeatureToggleName).Should().BeTrue();
Pages.FeatureTogglesPage.IsFeatureToggleDisplayed(Constants.FeatureToggleName).Should().BeTrue();
}

[TestCleanup]
Expand Down
6 changes: 3 additions & 3 deletions Moggles.EndToEndTests/SmokeTests/IsPermanentFeatureToggle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moggles.EndToEndTests.TestFramework;
using MogglesEndToEndTests.TestFramework;
using NSTestFrameworkDotNetCoreUI.Helpers;
using NsTestFrameworkUI.Helpers;

namespace MogglesEndToEndTests.SmokeTests
{
Expand All @@ -17,14 +17,14 @@ public void EditAFeatureToggleToBePermanent()
{
//act
Browser.Goto(Constants.BaseUrl);
Pages.FeatureTogglesPage.SelectASpecificApplication(Constants.SmokeTestsApplication);
Pages.FeatureTogglesPage.SelectApplicationByName(Constants.SmokeTestsApplication);

Pages.FeatureTogglesPage.AddFeatureToggle(Constants.FeatureToggleName);
Pages.FeatureTogglesPage.EditFeatureToggle(Constants.FeatureToggleName);
Pages.FeatureTogglesPage.SetFeatureToggleAsPermanent();

//assert
Pages.FeatureTogglesPage.FeatureToggleIsPermanent().Should().BeTrue();
Pages.FeatureTogglesPage.IsFeatureTogglePermanent().Should().BeTrue();
}

[TestCleanup]
Expand Down
4 changes: 2 additions & 2 deletions Moggles.EndToEndTests/SmokeTests/RefreshEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moggles.EndToEndTests.TestFramework;
using MogglesEndToEndTests.TestFramework;
using NSTestFrameworkDotNetCoreUI.Helpers;
using NsTestFrameworkUI.Helpers;

namespace Moggles.EndToEndTests.SmokeTests
{
Expand All @@ -17,7 +17,7 @@ public void UpdateEnvironment_RefreshIsTriggered()
{
//act
Browser.Goto(Constants.BaseUrl);
Pages.FeatureTogglesPage.SelectASpecificApplication(Constants.SmokeTestsApplication);
Pages.FeatureTogglesPage.SelectApplicationByName(Constants.SmokeTestsApplication);
Pages.FeatureTogglesPage.AddFeatureToggle(Constants.FeatureToggleName);
Pages.FeatureTogglesPage.EditFeatureToggle(Constants.FeatureToggleName);
Pages.FeatureTogglesPage.UpdateDevEnvironment();
Expand Down
4 changes: 2 additions & 2 deletions Moggles.EndToEndTests/TestFramework/BaseTest.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NSTestFrameworkDotNetCoreUI.Helpers;
using NsTestFrameworkUI.Helpers;
using System.IO;
using System.Reflection;

namespace Moggles.EndToEndTests.TestFramework
{
public class BaseTest : NSTestFrameworkDotNetCoreUI.BaseTest
public class BaseTest : NsTestFrameworkUI.BaseTest
{
[TestInitialize]
public virtual void Before()
Expand Down
14 changes: 1 addition & 13 deletions Moggles.EndToEndTests/TestFramework/Utils.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using NSTestFrameworkDotNetCoreUI.Helpers;
using NsTestFrameworkUI.Helpers;
using OpenQA.Selenium;
using System;
using System.Collections.ObjectModel;
Expand All @@ -14,18 +14,6 @@ public static bool IsLastUpdatedDateCorrectlyDisplayed(By cssSelector)
var formattedDateValue = DateTime.Parse(dateValue).Date;
return formattedDateValue == DateTime.Now.Date;
}

public static ReadOnlyCollection<IWebElement> GetAllRowsFromGrid(this IWebElement grid, By rowSelector)
{
return grid.FindElements(By.CssSelector(".vgt-responsive> table > tbody"));
}

public static IWebElement GetColumnSpecifiedByIndex(this IWebElement grid, By rowSelector, int rowIndex, int columnIndex)
{
var rows = grid.GetAllRowsFromGrid(rowSelector);
var cells = rows[rowIndex].FindElements(By.TagName("td"));
return cells[columnIndex];
}

public static IWebElement GetHeaderSpecifiedByIndex(this IWebElement grid, int columnIndex)
{
Expand Down
Binary file modified Moggles.EndToEndTests/chromedriver.exe
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ describe('AddApplication.vue', () => {
mockAdapter.reset();
});

it('Shows empty input on show', function () {
test('Shows empty input on show', function () {
const wrapper = shallowMount(AddApplication);
let txt = wrapper.find('input').text();
expect(txt).toBe("");
})

it('Application name is cleared on successful add', async () => {
test('Application name is cleared on successful add', async () => {
const wrapper = shallowMount(AddApplication);
wrapper.find('button').trigger('click');

Expand All @@ -31,9 +31,9 @@ describe('AddApplication.vue', () => {
expect(wrapper.vm.applicationName).toBe('');
})

it('A success alert is shown on successful add and goes away after a while', async () => {
test('A success alert is shown on successful add and goes away after a while', async () => {

let clock = sinon.useFakeTimers();
jest.useFakeTimers();

const wrapper = shallowMount(AddApplication);

Expand All @@ -48,13 +48,16 @@ describe('AddApplication.vue', () => {
mockAdapter.onPost().reply(200);
await flushPromises();

expect(wrapper.find('.alert').exists()).toBe(true);
clock.tick(1510);
expect(wrapper.find('.alert').exists()).toBe(false);
clock.restore();
expect(wrapper.find('.alert').exists()).toBeTruthy();

jest.advanceTimersByTime(1510);
await wrapper.vm.$nextTick();

expect(wrapper.find('.alert').exists()).toBeFalsy();

})

it('Emits app added event on succesfull Add', async () => {
test('Emits app added event on succesfull Add', async () => {

let spy = sinon.spy(Bus, '$emit');

Expand All @@ -75,7 +78,7 @@ describe('AddApplication.vue', () => {
spy.restore();
})

it('Calls the right URL passing the appName and environment name', async () => {
test('Calls the right URL passing the appName and environment name', async () => {

let mock = sinon.mock(axios);
mock.expects('post').withArgs('api/Applications/add', { applicationName: 'testApp', environmentName: "test", defaultToggleValue: true }).returns(Promise.resolve({}));
Expand All @@ -87,9 +90,10 @@ describe('AddApplication.vue', () => {
await flushPromises();

mock.verify();
mock.restore();
})

it('Shows a spinner while request is in process', async () => {
test('Shows a spinner while request is in process', async () => {
const wrapper = shallowMount(AddApplication);
let spy = sinon.spy(Bus, '$emit');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import AddEnvironment from '../src/environment/AddEnvironment.vue'


describe('AddEnvironment.vue', () => {
it('is a Vue instance', ()=> {
test('is a Vue instance', () => {
const wrapper = mount(AddEnvironment, {
propsData: {
application: {
id:1
id: 1
}
}
})
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.findComponent(AddEnvironment).vm).toBeTruthy()
})
})
Loading

0 comments on commit 14c133a

Please sign in to comment.