static void Main(string[] args) { /* * string path = Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())); * string path1 = Environment.CurrentDirectory.Substring(0, Environment.CurrentDirectory.IndexOf("bin")); * string path2 = new DirectoryInfo(Environment.CurrentDirectory.Substring(0, Environment.CurrentDirectory.IndexOf("bin"))).Parent.FullName; * string path3 = Path.Combine(Environment.CurrentDirectory, @"Data\", "osmar.txt"); * * * string path4 = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location)+ @"\Debug\CsvFiles\Capabilities.csv"; * */ ReadCsvs x = new ReadCsvs(); List <string> parsedData = x.readCapabilities(); for (int i = 0; i < parsedData.Count; i++) { System.Console.WriteLine(parsedData[i]); } Console.ReadKey(); }
string list_location_temp_id; // = "com.accuweather.android:id/current_temp"; public StepsToMenuOptions(AppiumDriver <IWebElement> driver) { this.driver = driver; read_data = new ReadCsvs(); Dictionary <string, Dictionary <string, string> > screenComponents = read_data.read_android_components("menuOptionsScreen"); this.menu_pane_id = screenComponents["ids"]["menuPane"]; this.menu_button_xpath = screenComponents["xpaths"]["menuButton"]; this.menu_options_list_id = screenComponents["ids"]["menuOptionsList"]; this.menu_options_edit_icon_id = screenComponents["ids"]["editIcon"]; this.menu_options_edit_label_id = screenComponents["ids"]["editLabel"]; this.menu_options_add_icon_id = screenComponents["ids"]["addIcon"]; this.menu_options_add_label_id = screenComponents["ids"]["addLabel"]; this.list_location_id = screenComponents["ids"]["location"]; this.list_selection_bar_id = screenComponents["ids"]["selectionBar"]; this.tool_bar_id = screenComponents["ids"]["toolBar"]; this.menu_button_class = screenComponents["classes"]["menuButton"]; this.list_location_name_id = screenComponents["ids"]["locationName"]; this.list_location_whether_icon_id = screenComponents["ids"]["locationWhetherIcon"]; this.list_location_temp_id = screenComponents["ids"]["locationTemp"]; }
public StepsToSetUpDevice() { ReadCsvs readCsv = new ReadCsvs(); List <string> documentCapabilities = readCsv.readCapabilities(); List <string> appiumConfiguration = readCsv.readAppiumConfiguration(); List <string> sauceLabsConfiguration = readCsv.readSauceLabsConfiguration(); this.real = documentCapabilities[0].ToLower(); this.plataform = documentCapabilities[1]; this.deviceName = documentCapabilities[2]; this.udid = documentCapabilities[3]; this.plataformVersion = documentCapabilities[4]; this.app = documentCapabilities[5]; this.sauceLabs = documentCapabilities[6].ToLower(); this.appiumVersion = documentCapabilities[7]; this.appPackage = documentCapabilities[8]; this.username = sauceLabsConfiguration[0]; this.key = sauceLabsConfiguration[1]; this.server = appiumConfiguration[0]; this.port = appiumConfiguration[1]; }
public void OneTimeSetUp() { readCsv = new ReadCsvs(); stepSetUpDevice = new StepsToSetUpDevice(); appActivityTermsConditions = readCsv.read_android_activities()["termAndConditions"]; sauceLabs = readCsv.readCapabilities()[6].ToLower(); if (sauceLabs.Equals("no")) { driver = stepSetUpDevice.run_driver_with_install_one_time("", appActivityTermsConditions); driver.Quit(); } }
public void setUp() { String testCaseName = TestContext.CurrentContext.Test.Name; readCsv = new ReadCsvs(); appActivityMainScreen = readCsv.read_android_activities()["main"]; stepSetUpDevice = new StepsToSetUpDevice(); driver = stepSetUpDevice.run_driver_with_install_every_time(testCaseName, appActivityMainScreen); stepTermConditions = new StepsToTermsAndConditions(driver); //stepTermConditions.accept_termns_and_conditions(); stepMenuOptions = new StepsToMenuOptions(driver); stepAddLocation = new StepsToAddLocation(driver); }
string element_searched_location_country_id; // = "com.accuweather.android:id/location_search_country"; public StepsToAddLocation(AppiumDriver <IWebElement> driver) { this.driver = driver; read_data = new ReadCsvs(); Dictionary <string, Dictionary <string, string> > screenComponents = read_data.read_android_components("addLocationScreen"); this.add_location_screen_id = screenComponents["ids"]["addLocationScreen"]; this.button_back_id = screenComponents["ids"]["backButton"]; this.button_search_id = screenComponents["ids"]["searchButton"]; this.text_field_search_id = screenComponents["ids"]["searchTextField"]; this.search_list_id = screenComponents["ids"]["searchList"]; this.button_close_id = screenComponents["ids"]["closeButton"]; this.element_searched_path = screenComponents["xpaths"]["elementSearched"]; this.element_searched_class = screenComponents["classes"]["elementSearched"]; this.element_searched_location_name_id = screenComponents["ids"]["elementSearchedName"]; this.element_searched_location_country_id = screenComponents["ids"]["elementSearchedCountry"]; }
public void setUp() { String testCaseName = TestContext.CurrentContext.Test.Name; readCsv = new ReadCsvs(); appActivityMainScreen = readCsv.read_android_activities()["main"]; stepSetUpDevice = new StepsToSetUpDevice(); driver = stepSetUpDevice.run_driver_with_install_every_time(testCaseName, appActivityMainScreen); stepTermConditions = new StepsToTermsAndConditions(driver); //stepTermConditions.accept_termns_and_conditions(); stepMenuOptions = new StepsToMenuOptions(driver); stepAddLocation = new StepsToAddLocation(driver); stepEditLocation = new StepsToEditLocation(driver); bool setUpEnviroment = add_several_locations(createLocationNumber); Assert.That(setUpEnviroment, Is.True, "The Test case cannot be executed because the enviroment cannot be created"); }
public StepsToTermsAndConditions(AppiumDriver <IWebElement> driver) { this.driver = driver; read_data = new ReadCsvs(); Dictionary <string, Dictionary <string, string> > screenComponents = read_data.read_android_components("termAndConditionsScreen"); this.title_id_term = screenComponents["ids"]["titleTermAndConditions"]; this.message_id_term = screenComponents["ids"]["messageTermAndConditions"]; this.agree_id_term = screenComponents["ids"]["agreeButtonTermAndConditions"]; this.disagree_id_term = screenComponents["ids"]["rejectButtonTermAndConditions"]; this.title_id_well = screenComponents["ids"]["titleWellcome"]; this.message_id_well = screenComponents["ids"]["messageWellcome"]; this.go_id_well = screenComponents["ids"]["gobuttonWellcome"]; this.element_menu = screenComponents["ids"]["menuLocationList"]; this.allow_localization_id = screenComponents["ids"]["allowButtonLocalizationPermission"]; }
string location_class; // = "android.widget.RelativeLayout"; public StepsToEditLocation(AppiumDriver <IWebElement> driver) { this.driver = driver; read_data = new ReadCsvs(); Dictionary <string, Dictionary <string, string> > screenComponents = read_data.read_android_components("editLocationScreen"); this.tool_bar_edit_id = screenComponents["ids"]["toolBarEdit"]; this.button_back_tool_bar_class = screenComponents["classes"]["backButton"]; this.label_title_tool_bar_class = screenComponents["classes"]["titleLabelToolBar"]; this.button_back_tool_bar_xpath = screenComponents["xpaths"]["backButton"]; this.label_title_tool_bar_xpath = screenComponents["xpaths"]["titleLabelToolBar"]; this.label_title_id = screenComponents["ids"]["titlelabelLocationToEdit"]; this.label_subtitle_id = screenComponents["ids"]["subtitlelabelLocationToEdit"]; this.button_toogle_id = screenComponents["ids"]["toogleButtonLocationToEdit"]; this.edit_list_id = screenComponents["ids"]["editListLocations"]; this.location_class = screenComponents["classes"]["locationToEdit"]; }