/// <summary> /// Gets from home page to cart(Sales Order > Store1 > Default Catalog) /// </summary> /// <param name="webappDriver"></param> public static void GetToOrderCenter_SalesOrder(RemoteWebDriver webappDriver) { WebappTest.webapp_Sandbox_Home_Button(webappDriver, "Accounts"); // First account SafeClick(webappDriver, first_account(webappDriver, 1)); Thread.Sleep(4000); // ... button SafeClick(webappDriver, "//div[@id='topBarContainer']//list-menu/div/a/span"); // Sales Order SafeClick(webappDriver, "//div/div/top-bar/div/div/list-menu/div/ul//li[@title='Sales Order']"); Thread.Sleep(5000); /* * @Dan Zlotnikov * // Origin account * SafeClick(webappDriver, "//body/app-root/div/app-accounts-home-page/object-chooser-modal/div/div/div/div/div/div/app-custom-list/virtual-scroll/div/div[2]/app-custom-form/fieldset/div"); * * //Done * SafeClick(driver, "//div[@id='mainCont']/app-accounts-home-page/object-chooser-modal/div/div/div/div[3]/div[2]"); */ try { // Default Catalog SafeClick(webappDriver, "//div[@class='scrollable-content']/div[2]", safeWait: 300, maxRetry: 4); } catch { } }
public static void GetToOrderCenter_SalesOrder2(RemoteWebDriver webappDriver) { webappDriver.Navigate().GoToUrl(webappSandboxHomePageUrl); webappDriver.Navigate().GoToUrl(webappSandboxHomePageUrl); // Accounts WebappTest.webapp_Sandbox_Home_Button(webappDriver, "Accounts"); // First account SafeClick(webappDriver, first_account(webappDriver, 1)); Thread.Sleep(5000); // Plus button SafeClick(webappDriver, "//div[@id='actionBar']/div/ul[3]/li/a/span"); // Sales Order 2 SafeClick(webappDriver, "//div[@id='actionBar']/div/ul[3]/li/ul/li[2]/span"); Thread.Sleep(3000); /* * // Origin account * SafeClick(webappDriver, "//body/app-root/div/app-accounts-home-page/object-chooser-modal/div/div/div/div/div/div/app-custom-list/virtual-scroll/div/div[2]/app-custom-form/fieldset/div"); * * //Done * SafeClick(driver, "//div[@id='mainCont']/app-accounts-home-page/object-chooser-modal/div/div/div/div[3]/div[2]"); */ // Default Catalog SafeClick(webappDriver, "//div[@id='viewsContainer']/app-custom-list/virtual-scroll/div[2]/div/app-custom-form"); }
public static void WebApp_Transaction_Accounts_Settings(RemoteWebDriver webappDriver) { bool flag = true; //write errors to error file in case flag is false string massage = ""; // error massage // wait for transaction button will appear on webapp Sync(webappDriver); Sync(webappDriver); // No account assigned case WebappTest.webapp_Sandbox_Home_Button(webappDriver, "test1"); //This check should not reach any accounts, meaning we are taken straight to the next screen where the home button is available if (SafeIsElementExists(webappDriver, "//span[@class='fa fa-home']")) { ClickOnHomePage(webappDriver); } else { massage += "test1: 'No account assigment' isn't working \n"; flag = false; } //Account destination assigned case //This test should have one type of account, meaning we're taken to the screen where our destination account is selected //after that we are taken to the next screen where the home button is available WebappTest.webapp_Sandbox_Home_Button(webappDriver, "test2"); if (SafeIsElementExists(webappDriver, "//div[text()[contains(.,'Display 2 Lines')]]")) { SafeClick(webappDriver, "//label[@title='New Type Account1']"); SafeClick(webappDriver, "//div[@class='modal in']//button[contains(text(),'Done')]"); //check if the home page button is available if (SafeIsElementExists(webappDriver, "//span[@class='fa fa-home']")) { ClickOnHomePage(webappDriver); } else { massage += massage += "test2: 'Destination' isn't working \n"; flag = false; } } else { massage += massage += "test2: 'Destination' isn't working \n"; flag = false; } //Account Origen And Destination assigned case //This test should have one type of Destination account and one type of Origen account , //meaning we're taken to the screen where our destination account is selected ant then the origen. //after that we are taken to the next screen where the home button is available WebappTest.webapp_Sandbox_Home_Button(webappDriver, "test3"); //check if the first type is appear if (SafeIsElementExists(webappDriver, "//div[text()[contains(.,'Display 32 Lines')]]")) { SafeClick(webappDriver, "//label[@title='Avner']"); SafeClick(webappDriver, "//div[@class='modal in']//button[contains(text(),'Done')]"); //check if the second type is appear if (SafeIsElementExists(webappDriver, "//div[text()[contains(.,'Display 2 Lines')]]")) { SafeClick(webappDriver, "//label[@title='New Type Account1']"); SafeClick(webappDriver, "//div[@class='modal in']//button[contains(text(),'Done')]"); //check if the home page button is available if (SafeIsElementExists(webappDriver, "//span[@class='fa fa-home']")) { ClickOnHomePage(webappDriver); } else { massage += massage += "test3: 'Origen And Destination' isn't working \n"; flag = false; } } else { massage += massage += "test3: 'Origen And Destination' isn't working \n"; flag = false; } } else { massage += massage += "test3: 'Origen And Destination' isn't working \n"; flag = false; } Assert(flag, massage); }