Test: Fix E2ETests
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using Elwig;
|
||||
using Elwig.Helpers;
|
||||
using Elwig.Helpers.Billing;
|
||||
using Microsoft.Data.Sqlite;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Reflection;
|
||||
@@ -26,16 +25,6 @@ namespace Tests {
|
||||
App.SetBranch(ctx.Branches.Include(b => b.PostalDest).Single());
|
||||
}
|
||||
|
||||
[OneTimeSetUp]
|
||||
public async Task Setup_3_BillingData() {
|
||||
await BillingData.Init();
|
||||
}
|
||||
|
||||
[OneTimeSetUp]
|
||||
public void Setup_4_Culture() {
|
||||
Utils.OverrideCulture();
|
||||
}
|
||||
|
||||
[OneTimeTearDown]
|
||||
public async Task TeardownDatabase() {
|
||||
AppDbContext.ConnectionStringOverride = null;
|
||||
|
||||
@@ -67,7 +67,10 @@ namespace Tests.E2ETests {
|
||||
window.FindElement(By.WpfId("MemberInput")).SendKeys("Mustermann Max");
|
||||
window.FindElement(By.WpfId("WineVarietyInput")).SelectItem("Zweigelt");
|
||||
window.FindElement(By.WpfId("GradationKmwInput")).SendKeys("18");
|
||||
window.FindElement(By.Name("Wiegen")).Click();
|
||||
window.FindElement(By.WpfId("WeighingManualButton")).Click();
|
||||
var dialog = Session.CreateWindowDriver("ManualWeighingDialog");
|
||||
dialog.FindElement(By.WpfId("WeightInput")).SendKeys("2468");
|
||||
dialog.FindElement(By.WpfId("ConfirmButton")).Click();
|
||||
FinishDeliveryNote(window);
|
||||
window.Close();
|
||||
}
|
||||
@@ -76,7 +79,7 @@ namespace Tests.E2ETests {
|
||||
public void Test_3_AttributeCultivationModifier() {
|
||||
var window = OpenReceiptWindow();
|
||||
window.FindElement(By.WpfId("MgNrInput")).SendKeys("102" + Keys.Enter + "GVK");
|
||||
window.FindElement(By.WpfId("CultivationInput")).SelectItem("Bio");
|
||||
window.FindElement(By.WpfId("CultivationInput")).SelectItem("KIP");
|
||||
window.FindElement(By.WpfId("GradationOeInput")).SendKeys("73" + Keys.Enter + Keys.Enter);
|
||||
FinishDeliveryNote(window);
|
||||
window.Close();
|
||||
|
||||
@@ -20,7 +20,18 @@ namespace Tests.E2ETests {
|
||||
Session.App.FindElement(By.Name("Mitglieder")).Click();
|
||||
Thread.Sleep(Utils.WINDOW_OPEN_SLEEP);
|
||||
var window = Session.CreateWindowDriver("MemberAdminWindow");
|
||||
Assert.That(window.Title, Is.EqualTo("Mitglieder - Elwig"));
|
||||
Assert.That(window.Title, Is.EqualTo("Mitglieder: aktive Mitglieder - Elwig"));
|
||||
window.Close();
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_Open_DeliveryAncmtWindow() {
|
||||
Assert.DoesNotThrow(() => {
|
||||
Session.App.FindElement(By.Name("Anmeldungen")).Click();
|
||||
Thread.Sleep(Utils.WINDOW_OPEN_SLEEP);
|
||||
var window = Session.CreateWindowDriver("DeliveryAncmtWindow");
|
||||
Assert.That(window.Title, Is.EqualTo($"Anmeldungen: {DateTime.Today.Year} - Elwig"));
|
||||
window.Close();
|
||||
});
|
||||
}
|
||||
@@ -31,7 +42,7 @@ namespace Tests.E2ETests {
|
||||
Session.App.FindElement(By.Name("Lieferungen")).Click();
|
||||
Thread.Sleep(Utils.WINDOW_OPEN_SLEEP);
|
||||
var window = Session.CreateWindowDriver("DeliveryAdminWindow");
|
||||
Assert.That(window.Title, Is.EqualTo("Lieferungen - Elwig"));
|
||||
Assert.That(window.Title, Is.EqualTo($"Lieferungen: {DateTime.Now.Year} - Elwig"));
|
||||
window.Close();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ namespace Tests.E2ETests {
|
||||
Window.FindElement(By.WpfId("IbanInput")).SendKeys("AT611904300234573201");
|
||||
Window.FindElement(By.WpfId("BicInput")).SendKeys("RLNWATWWWDF");
|
||||
|
||||
Window.FindElement(By.WpfId("UstIdNrInput")).SendKeys("ATU66192906"); // TODO: Testdaten?
|
||||
Window.FindElement(By.WpfId("LfbisNrInput")).SendKeys("1251074"); // TODO: Testdaten?
|
||||
Window.FindElement(By.WpfId("UstIdNrInput")).SendKeys("ATU01234565");
|
||||
Window.FindElement(By.WpfId("LfbisNrInput")).SendKeys("0123455");
|
||||
|
||||
Window.FindElement(By.WpfId("BuchführendInput")).Click();
|
||||
Window.FindElement(By.WpfId("OrganicInput")).Click();
|
||||
@@ -68,7 +68,7 @@ namespace Tests.E2ETests {
|
||||
Window.FindElement(By.WpfId("BillingPlzInput")).SendKeys("2120");
|
||||
Window.FindElement(By.WpfId("BillingOrtInput")).SelectItem(2);
|
||||
|
||||
Window.FindElement(By.WpfId("BusinessSharesInput")).SendKeys("10");
|
||||
Window.FindElement(By.WpfId("BusinessShares1Input")).SendKeys("10");
|
||||
Window.FindElement(By.WpfId("BranchInput")).SelectItem("Matzen");
|
||||
Window.FindElement(By.WpfId("DefaultKgInput")).SelectItem(3);
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Tests.E2ETests {
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Test, DependsOnTest("Test_1_CreateMember")]
|
||||
public void Test_2_EditMember() {
|
||||
Window!.FindElement(By.WpfId("SearchInput")).SendKeys("9999");
|
||||
Thread.Sleep(500);
|
||||
@@ -104,7 +104,7 @@ namespace Tests.E2ETests {
|
||||
|
||||
Window.FindElement(By.WpfId("EditMemberButton")).Click();
|
||||
|
||||
var businessSharesInput = Window.FindElement(By.WpfId("BusinessSharesInput"));
|
||||
var businessSharesInput = Window.FindElement(By.WpfId("BusinessShares1Input"));
|
||||
Assert.That(businessSharesInput, Is.Not.Null);
|
||||
|
||||
var businessShares = int.Parse(businessSharesInput.Text);
|
||||
@@ -117,7 +117,7 @@ namespace Tests.E2ETests {
|
||||
Assert.That(newBusinessShares, Is.EqualTo(businessShares + 5));
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Test, DependsOnTest("Test_2_EditMember")]
|
||||
public void Test_3_DeleteMember() {
|
||||
Window!.FindElement(By.WpfId("SearchInput")).SendKeys("9999");
|
||||
Thread.Sleep(500);
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using Elwig.Services;
|
||||
|
||||
namespace Tests {
|
||||
[SetUpFixture]
|
||||
public class InteractionSetup {
|
||||
|
||||
[OneTimeSetUp]
|
||||
public void Setup() {
|
||||
InteractionService.Override = (mode, title, text) => {
|
||||
Assert.Fail($"User interaction requested: {mode} - {title} - {text}");
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
||||
[OneTimeTearDown]
|
||||
public void Teardown() {
|
||||
InteractionService.Override = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ INSERT INTO AT_plz_dest (plz, okz, dest) VALUES
|
||||
(2122, 05137, 'Riedenthal');
|
||||
|
||||
INSERT INTO client_parameter (param, value) VALUES
|
||||
('CLIENT_NAME_TOKEN', 'WGT'),
|
||||
('CLIENT_NAME_TOKEN', 'WGX'),
|
||||
('CLIENT_NAME_SHORT', 'WG Test'),
|
||||
('CLIENT_NAME', 'Winzergenossenschaft Test'),
|
||||
('CLIENT_NAME_SUFFIX', NULL),
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using Elwig;
|
||||
using Elwig.Helpers;
|
||||
using Elwig.Helpers.Billing;
|
||||
|
||||
namespace Tests {
|
||||
[SetUpFixture]
|
||||
class Setup {
|
||||
|
||||
[OneTimeSetUp]
|
||||
public void Setup_1_Config() {
|
||||
Utils.OverrideCulture();
|
||||
App.Config.Debug = true;
|
||||
}
|
||||
|
||||
[OneTimeSetUp]
|
||||
public async Task Setup_2_Init() {
|
||||
await BillingData.Init();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ type = SysTec-IT
|
||||
model = IT3000A
|
||||
connection = tcp://127.0.0.1:12345
|
||||
required = false
|
||||
synctime = false
|
||||
|
||||
[scale.2]
|
||||
type = Avery-Async
|
||||
|
||||
Reference in New Issue
Block a user