public void OneTimeSetup()
        {
            _appiumLocalService = new Uri("http://localhost:4723/wd/hub");

            var appiumOptions = new AppiumOptions();

            appiumOptions.AddAdditionalCapability(MobileCapabilityType.Udid, "374c323837553098");
            appiumOptions.AddAdditionalCapability(AndroidMobileCapabilityType.AppPackage, "com.sec.android.app.popupcalculator");
            appiumOptions.AddAdditionalCapability(AndroidMobileCapabilityType.AppActivity, "com.sec.android.app.popupcalculator.Calculator");
            appiumOptions.AddAdditionalCapability(MobileCapabilityType.PlatformName, "Android");
            appiumOptions.AddAdditionalCapability(MobileCapabilityType.PlatformVersion, "9");
            appiumOptions.AddAdditionalCapability(MobileCapabilityType.DeviceName, "Samsung");

            _mobileDriver = new AndroidDriver <AppiumWebElement>(_appiumLocalService, appiumOptions);

            _mobileDriver?.LaunchApp();
            _calcScreen = new CalculatorScreen(_mobileDriver);
        }
예제 #2
0
        public void testCalc()
        {
            JSONFileReader jsonRead = new JSONFileReader();
            Reporter       extRpt   = new Reporter();

            extRpt.reportSetup("Report.html");
            extRpt.createTest("Calculator Test");
            CalculatorScreen cs  = new CalculatorScreen();
            Window           win = cs.bootupApplication(jsonRead.jsonReader("Data.json", "Application_exe"), jsonRead.jsonReader("Data.json", "Application_Title"));

            cs.clickButton(jsonRead.jsonReader("Data.json", "Key_1"), win);
            cs.clickButton("Add", win);
            cs.clickButton(jsonRead.jsonReader("Data.json", "Key_2"), win);
            cs.clickButton("Equals", win);
            string value = cs.getCalcAnswer(win, "150");

            Assert.AreEqual(value, jsonRead.jsonReader("Data.json", "Answer_1"));

            extRpt.logReportStatement(AventStack.ExtentReports.Status.Pass, "Calculation done...answer" + value);
            extRpt.flushReport();
        }
예제 #3
0
 //CLEAR THE CALCULATOR
 private void CalculatorClear_Click(object sender, RoutedEventArgs e)
 {
     Calculator = "";
     CalculatorScreen.Clear();
 }