E2ETests: Refactor to use .FindElement(By.Something())
All checks were successful
Test / Run tests (push) Successful in 2m12s
All checks were successful
Test / Run tests (push) Successful in 2m12s
This commit is contained in:
@ -3,7 +3,7 @@ using OpenQA.Selenium.Appium.Windows;
|
||||
using Tests.WeighingTests;
|
||||
|
||||
namespace Tests.E2ETests {
|
||||
[TestFixture]
|
||||
[TestFixture, Order(2)]
|
||||
public class DeliveryAdminWindowReceiptTest {
|
||||
|
||||
private MockScale Mock;
|
||||
@ -15,13 +15,13 @@ namespace Tests.E2ETests {
|
||||
Weight = 3210,
|
||||
};
|
||||
Session = new(Utils.ApplicationPath, Utils.ConfigPath, WinAppDriver.WinAppDriverUrl);
|
||||
Session.App.FindElementByName("Stammdaten").Click();
|
||||
Session.App.FindElement(By.Name("Stammdaten")).Click();
|
||||
Thread.Sleep(500);
|
||||
var window = Session.CreateWindowDriver("BaseDataWindow");
|
||||
window.FindElementByName("Saisons").Click();
|
||||
window.FindElementByName("Neu anlegen...").Click();
|
||||
window.FindElement(By.Name("Saisons")).Click();
|
||||
window.FindElement(By.Name("Neu anlegen...")).Click();
|
||||
var dialog = Session.CreateWindowDriver("NewSeasonDialog");
|
||||
dialog.FindElementByName("Bestätigen").Click();
|
||||
dialog.FindElement(By.Name("Bestätigen")).Click();
|
||||
dialog.Close();
|
||||
Thread.Sleep(500);
|
||||
window.Close();
|
||||
@ -34,13 +34,13 @@ namespace Tests.E2ETests {
|
||||
}
|
||||
|
||||
private WindowsDriver<WindowsElement> OpenReceiptWindow() {
|
||||
Session.App.FindElementByName("Übernahme").Click();
|
||||
Session.App.FindElement(By.Name("Übernahme")).Click();
|
||||
Thread.Sleep(Utils.WINDOW_OPEN_SLEEP);
|
||||
return Session.CreateWindowDriver("DeliveryAdminWindow");
|
||||
}
|
||||
|
||||
private void FinishDeliveryNote(WindowsDriver<WindowsElement> window) {
|
||||
window.FindElementByName("Abschließen").Click();
|
||||
window.FindElement(By.Name("Abschließen")).Click();
|
||||
Thread.Sleep(2000);
|
||||
var doc = Session.CreateWindowDriver("DocumentViewerWindow");
|
||||
Assert.That(doc.Title, Contains.Substring("Traubenübernahmeschein"));
|
||||
@ -52,7 +52,7 @@ namespace Tests.E2ETests {
|
||||
[Test]
|
||||
public void Test_1_Minimal() {
|
||||
var window = OpenReceiptWindow();
|
||||
window.FindById("MgNrInput").SendKeys("101" + Keys.Enter + "GV" + Keys.Enter + "73" + Keys.Enter + Keys.Enter);
|
||||
window.FindElement(By.WpfId("MgNrInput")).SendKeys("101" + Keys.Enter + "GV" + Keys.Enter + "73" + Keys.Enter + Keys.Enter);
|
||||
Thread.Sleep(500);
|
||||
FinishDeliveryNote(window);
|
||||
window.Close();
|
||||
@ -61,10 +61,10 @@ namespace Tests.E2ETests {
|
||||
[Test]
|
||||
public void Test_2_OtherInputs() {
|
||||
var window = OpenReceiptWindow();
|
||||
window.FindById("MemberInput").SendKeys("Mustermann Max");
|
||||
window.SelectComboBoxItemByText("WineVarietyInput", "Zweigelt");
|
||||
window.FindById("GradationKmwInput").SendKeys("18");
|
||||
window.FindElementByName("Wiegen").Click();
|
||||
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();
|
||||
Thread.Sleep(500);
|
||||
FinishDeliveryNote(window);
|
||||
window.Close();
|
||||
@ -73,9 +73,9 @@ namespace Tests.E2ETests {
|
||||
[Test]
|
||||
public void Test_3_AttributeCultivationModifier() {
|
||||
var window = OpenReceiptWindow();
|
||||
window.FindById("MgNrInput").SendKeys("102" + Keys.Enter + "GVK");
|
||||
window.SelectComboBoxItemByText("CultivationInput", "Bio");
|
||||
window.FindById("GradationOeInput").SendKeys("73" + Keys.Enter + Keys.Enter);
|
||||
window.FindElement(By.WpfId("MgNrInput")).SendKeys("102" + Keys.Enter + "GVK");
|
||||
window.FindElement(By.WpfId("CultivationInput")).SelectItem("Bio");
|
||||
window.FindElement(By.WpfId("GradationOeInput")).SendKeys("73" + Keys.Enter + Keys.Enter);
|
||||
|
||||
Thread.Sleep(500);
|
||||
FinishDeliveryNote(window);
|
||||
|
Reference in New Issue
Block a user