mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Merge branch 'main' of https://github.com/LD-Reborn/Berufsschule_HAMX
This commit is contained in:
@@ -270,7 +270,19 @@
|
|||||||
|
|
||||||
|
|
||||||
<script defer>
|
<script defer>
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
});
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', async () => {
|
||||||
|
const createModal = document.getElementById('createAssetModal');
|
||||||
|
createModal.addEventListener('show.bs.modal', async () => {
|
||||||
|
const selectLocations = createModal.querySelector('#createLocationSelect');
|
||||||
|
await loadLocationsIntoSelect(selectLocations);
|
||||||
|
const selectPresets = createModal.querySelector('#createPresetSelect');
|
||||||
|
await loadPresetsIntoSelect(selectPresets);
|
||||||
|
const selectUsers = createModal.querySelector('#createUsersSelect');
|
||||||
|
await loadUsersIntoSelect(selectUsers);
|
||||||
|
});
|
||||||
// Open modal if URL contains parameter: CreateModal=true
|
// Open modal if URL contains parameter: CreateModal=true
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
if (urlParams.get('CreateModal') === 'true') {
|
if (urlParams.get('CreateModal') === 'true') {
|
||||||
@@ -813,17 +825,6 @@ function registerRowDetailviewClick(row) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
|
||||||
const createModal = document.getElementById('createAssetModal');
|
|
||||||
createModal.addEventListener('show.bs.modal', async () => {
|
|
||||||
const selectLocations = createModal.querySelector('#createLocationSelect');
|
|
||||||
await loadLocationsIntoSelect(selectLocations);
|
|
||||||
const selectPresets = createModal.querySelector('#createPresetSelect');
|
|
||||||
await loadPresetsIntoSelect(selectPresets);
|
|
||||||
const selectUsers = createModal.querySelector('#createUsersSelect');
|
|
||||||
await loadUsersIntoSelect(selectUsers);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const presetApplyButton = document.getElementById('createPresetApply');
|
const presetApplyButton = document.getElementById('createPresetApply');
|
||||||
@@ -950,7 +951,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
plugins: ['clear_button'],
|
plugins: ['clear_button'],
|
||||||
create: false,
|
create: false,
|
||||||
sortField: { field: 'text', direction: 'asc' },
|
sortField: { field: 'text', direction: 'asc' },
|
||||||
placeholder: '@T["Select user"]',
|
placeholder: '@T["Select preset"]',
|
||||||
maxOptions: 500, // avoid performance hit if there are many
|
maxOptions: 500, // avoid performance hit if there are many
|
||||||
render: {
|
render: {
|
||||||
no_results: function(data, escape) {
|
no_results: function(data, escape) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class AssetsPageTests : IDisposable
|
|||||||
serverProcess = app.Result;
|
serverProcess = app.Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[RetryFact(5)]
|
||||||
public void AssetsPage_ShouldShowButton()
|
public void AssetsPage_ShouldShowButton()
|
||||||
{
|
{
|
||||||
AppHelper.Login(_driver);
|
AppHelper.Login(_driver);
|
||||||
@@ -30,7 +30,7 @@ public class AssetsPageTests : IDisposable
|
|||||||
_driver.FindElement(By.CssSelector("button[data-bs-target=\"#createAssetModal\"]"));
|
_driver.FindElement(By.CssSelector("button[data-bs-target=\"#createAssetModal\"]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[RetryFact(5)]
|
||||||
public void AssetsPage_ShouldShowCreateViewModal()
|
public void AssetsPage_ShouldShowCreateViewModal()
|
||||||
{
|
{
|
||||||
AppHelper.Login(_driver);
|
AppHelper.Login(_driver);
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using Xunit.Sdk;
|
|||||||
|
|
||||||
namespace Berufsschule_HAM.E2ETests;
|
namespace Berufsschule_HAM.E2ETests;
|
||||||
|
|
||||||
[XunitTestCaseDiscoverer("YourNamespace.RetryFactDiscoverer", "YourAssemblyName")]
|
|
||||||
public class RetryFactAttribute(int maxRetries = 5) : FactAttribute
|
public class RetryFactAttribute(int maxRetries = 5) : FactAttribute
|
||||||
{
|
{
|
||||||
public int MaxRetries { get; } = maxRetries;
|
public int MaxRetries { get; } = maxRetries;
|
||||||
@@ -18,8 +17,13 @@ public class RetryTestCase : XunitTestCase
|
|||||||
[Obsolete("Called by the de-serializer", true)]
|
[Obsolete("Called by the de-serializer", true)]
|
||||||
public RetryTestCase() { }
|
public RetryTestCase() { }
|
||||||
|
|
||||||
public RetryTestCase(int maxRetries, ITestMethod testMethod)
|
public RetryTestCase(
|
||||||
: base(new NullMessageSink(), TestMethodDisplay.Method, TestMethodDisplayOptions.None, testMethod)
|
IMessageSink diagnosticMessageSink,
|
||||||
|
TestMethodDisplay defaultMethodDisplay,
|
||||||
|
TestMethodDisplayOptions defaultMethodDisplayOptions,
|
||||||
|
ITestMethod testMethod,
|
||||||
|
int maxRetries)
|
||||||
|
: base(diagnosticMessageSink, defaultMethodDisplay, defaultMethodDisplayOptions, testMethod)
|
||||||
{
|
{
|
||||||
_maxRetries = maxRetries;
|
_maxRetries = maxRetries;
|
||||||
}
|
}
|
||||||
@@ -50,3 +54,26 @@ public class RetryTestCase : XunitTestCase
|
|||||||
return summary;
|
return summary;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class RetryFactDiscoverer : IXunitTestCaseDiscoverer
|
||||||
|
{
|
||||||
|
private readonly IMessageSink _diagnosticMessageSink;
|
||||||
|
|
||||||
|
public RetryFactDiscoverer(IMessageSink diagnosticMessageSink)
|
||||||
|
{
|
||||||
|
_diagnosticMessageSink = diagnosticMessageSink;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<IXunitTestCase> Discover(ITestFrameworkDiscoveryOptions discoveryOptions,
|
||||||
|
ITestMethod testMethod,
|
||||||
|
IAttributeInfo factAttribute)
|
||||||
|
{
|
||||||
|
var maxRetries = factAttribute.GetNamedArgument<int>("MaxRetries");
|
||||||
|
yield return new RetryTestCase(
|
||||||
|
_diagnosticMessageSink,
|
||||||
|
discoveryOptions.MethodDisplayOrDefault(),
|
||||||
|
discoveryOptions.MethodDisplayOptionsOrDefault(),
|
||||||
|
testMethod,
|
||||||
|
maxRetries);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user