public void Test1()
        {
            var device = WebDriverExtensions.Devices.SingleOrDefault();

            AppDriver driver = new AppDriver(new DeviceCapabilities(deviceId: device.UniqueId));
            var       source = driver.PageSource;
        }
        public void インデックス新規作成_0件Test()
        {
            const string testPath = @"C:\Workspace\Repo\Git\MyProject\PokudaSearch.Test\TestData\Zero";

            _indexBuildForm.TargetDirText.SetWindowText(testPath);
            //参照ボタン
            Async async = new Async();

            _indexBuildForm.ReferenceButton.EmulateClick(async);
            var    dirDlg = _indexBuildForm.Window.WaitForNextModal();
            string title  = dirDlg.GetWindowText();

            Assert.AreEqual(title, "フォルダーの参照");

            //OKボタンクリック
            var okButton = dirDlg.IdentifyFromWindowText("OK");

            okButton.SendMessage(FriendlyUtil.BM_CLICK, IntPtr.Zero, IntPtr.Zero);
            string dirPath = _indexBuildForm.TargetDirText.GetWindowText();

            Assert.AreEqual(dirPath, testPath);

            //インデックス作成
            Async async2 = new Async();

            _indexBuildForm.UpdateIndexButton.EmulateClick(async2);

            //0件メッセージ
            string retMsg = FriendlyUtil.GetMsgBoxMessage(_indexBuildForm.Window, async2);

            Assert.AreEqual(retMsg, AppDriver.GetMsg("MSG_INDEXED_COUNT_ZERO"));
        }
        public async Task ShouldRejectForecastReportAsBadRequestWhenTemperatureIsLessThanMinus100()
        {
            //GIVEN
            await using var driver = new AppDriver();
            await driver.StartAsync();

            //WHEN
            using var reportForecastResponse = await driver.WeatherForecastApi.AttemptToReportForecast(
                      request => request with { TemperatureC = -101 });
Beispiel #4
0
 /// <summary>
 /// テストCleanup
 /// </summary>
 public void NotifyTestCleanup()
 {
     if (TestContext.DataRow == null ||
         ReferenceEquals(TestContext.DataRow, TestContext.DataRow.Table.Rows[TestContext.DataRow.Table.Rows.Count - 1]))
     {
         _tests.Remove(TestContext.TestName);
     }
     AppDriver.Release(TestContext.CurrentTestOutcome == UnitTestOutcome.Passed && 0 < _tests.Count);
 }
        public void 存在しないフォルダを指定Test()
        {
            _indexBuildForm.TargetDirText.SetWindowText(@"C:\Temp2");

            Async async = new Async();

            _indexBuildForm.UpdateIndexButton.EmulateClick(async);
            string retMsg = FriendlyUtil.GetMsgBoxMessage(_indexBuildForm.Window, async);

            Assert.AreEqual(retMsg, AppDriver.GetMsg("ERR_DIR_NOT_FOUND"));
        }
Beispiel #6
0
        public async Task ShouldRejectForecastReportAsBadRequestWhenTemperatureIsBelowAllowedMinimum()
        {
            //GIVEN
            await using var driver = new AppDriver();
            await driver.StartAsync();

            using var user = new User(driver);

            //WHEN
            using var reportForecastResponse =
                      await user.AttemptToReportNewForecast(forecast => forecast with { TemperatureC = -101 });
        public TestsMerchantGalaxy()
        {
            merchantGalaxy = new AppDriver();
            merchantGalaxy.LineFeed("glob is I");
            merchantGalaxy.LineFeed("prok is V");
            merchantGalaxy.LineFeed("pish is X");
            merchantGalaxy.LineFeed("tegj is L");

            merchantGalaxy.LineFeed("glob glob Silver is 34 Credits");
            merchantGalaxy.LineFeed("glob prok Gold is 57800 Credits");
            merchantGalaxy.LineFeed("pish pish Iron is 3910 Credits");
        }
        public async Task ShouldAllowTryingToKillAragornAndEndGame()
        {
            var bot = new AppDriver();
            await bot.Receives(StartGame());

            bot.AnswersWith(EntryDescription());
            await bot.Receives(Kill("Aragorn"));

            bot.AnswersWith(AttemptingToKillAragornAnswer());
            await bot.Receives(StartGame());

            bot.AnswersWith(EntryDescription());
        }
        public async Task ShouldDOWHAT()
        {
            //GIVEN
            var johnny = AUser().Adult();

            using (var context = new AppDriver())
            {
                //WHEN
                var response = await context.Create(johnny);

                //THEN
                response.ShouldIndicateSuccessfulCreationOf(johnny);
            }
        }
        public async Task ShouldAllowRetrievingReportedForecast()
        {
            //GIVEN
            await using var driver = new AppDriver();
            await driver.StartAsync();

            await driver.WeatherForecastApi.ReportForecast();

            //WHEN
            using var retrievedForecast = await driver.WeatherForecastApi.GetReportedForecast();

            //THEN
            await retrievedForecast.ShouldBeTheSameAsReported();

            //not really part of the scenario...
            driver.Notifications.ShouldIncludeNotificationAboutReportedForecast();
        }
        public async Task ShouldMakeAragornJokeWhenFianceeNameIsAragorn()
        {
            var bot = new AppDriver();
            await bot.Receives(StartGame());

            bot.AnswersWith(EntryDescription());
            await bot.Receives(TalkTo("Aragorn"));

            bot.AnswersWith(
                QuestionFromAragornAboutFrodosStateOfMind(),
                QuestionFromAragornAboutFrodosFianceeName()
                );
            await bot.Receives(Words("Aragorn"));

            bot.AnswersWith(
                AragornJokesAboutHimBeingAFianceeOfFrodo(),
                QuestionFromAragornAboutFrodosFianceeName());
        }
        public async Task ShouldAllowTalkingToAragornAndGivingFianceeName()
        {
            var bot = new AppDriver();
            await bot.Receives(StartGame());

            bot.AnswersWith(EntryDescription());
            await bot.Receives(TalkTo("Aragorn"));

            bot.AnswersWith(
                QuestionFromAragornAboutFrodosStateOfMind(),
                QuestionFromAragornAboutFrodosFianceeName()
                );
            await bot.Receives(Words("Mandaryna Mandrykiewicz"));

            bot.AnswersWith(
                AragornsStoryOfHisFianceeAfterAcknowleding("Mandaryna Mandrykiewicz"),
                EntryDescription());
        }
Beispiel #13
0
        public async Task ShouldAllowRetrievingReportedForecast()
        {
            //GIVEN
            await using var driver = new AppDriver();
            await driver.StartAsync();

            using var user = new User(driver);

            await user.ReportNewForecast();

            //WHEN
            using var retrievedForecast = await user.RetrieveLastReportedForecast();

            //THEN
            await retrievedForecast.ShouldBeTheSameAs(user.LastReportedForecast());

            //not really part of the scenario...
            driver.Notifications.ShouldIncludeNotificationAbout(user.LastReportedForecast());
        }
        public async Task ShouldMakeAragornClarifyHisFianceeQuestionWhenAskedForDetails()
        {
            var bot = new AppDriver();
            await bot.Receives(StartGame());

            bot.AnswersWith(EntryDescription());
            await bot.Receives(TalkTo("Aragorn"));

            bot.AnswersWith(
                QuestionFromAragornAboutFrodosStateOfMind(),
                QuestionFromAragornAboutFrodosFianceeName()
                );
            await bot.Receives(QuestionWho());

            bot.AnswersWith(ClarificationFromAragornAboutFrodosFianceeName());
            await bot.Receives(Words("Mandaryna Mandrykiewicz"));

            bot.AnswersWith(
                AragornsStoryOfHisFianceeAfterAcknowleding("Mandaryna Mandrykiewicz"),
                EntryDescription());
        }
Beispiel #15
0
        public void StartEnd()
        {
            using (var appDriver = new AppDriver($"--config {AppConfigFilePath}", 60 * 1000))
            {
                appDriver.MainWindow.Close();
            }

            Assert.True(File.Exists(AppConfigFilePath));

            var lines = ReadLogLines();

            Assert.Contains("Start Application", lines.First());
            Assert.Contains("End Application", lines.Last());

            // エラー、警告がない
            foreach (var line in lines)
            {
                Assert.DoesNotContain("[ERROR]", line);
                Assert.DoesNotContain("[WARN ]", line);
            }
        }
        public async Task ShouldDOWHAT2()
        {
            //GIVEN
            using (var context = new AppDriver())
            {
                var johnny = AUser().Adult();
                var kate   = AUser().Adult();
                await context.Create(johnny);

                await context.Create(kate);

                //WHEN
                var probablyJohnny = await context.Get(johnny);

                var probablyKate = await context.Get(kate);

                //THEN
                probablyJohnny.ShouldBe(johnny);
                probablyKate.ShouldBe(kate);
            }
        }
Beispiel #17
0
        public async Task ShouldAllowRetrievingReportsFromAParticularUser()
        {
            //GIVEN
            await using var driver = new AppDriver();
            await driver.StartAsync();

            using var user1 = new User(driver);
            using var user2 = new User(driver);

            await user1.ReportNewForecast();

            await user1.ReportNewForecast();

            await user2.ReportNewForecast();

            //WHEN
            using var allForecastsReportedByUser1 = await user1.RetrieveAllReportedForecasts();

            //THEN
            await allForecastsReportedByUser1.ShouldConsistOf(user1.AllReportedForecasts());
        }
Beispiel #18
0
 /// <summary>
 /// テストクラスを初期化します。
 /// </summary>
 public static void NotifyClassInitialize()
 {
     App   = new AppDriver();
     tests = typeof(T).GetMethods().Where(e => 0 < e.GetCustomAttributes(typeof(TestMethodAttribute), true).Length).ToDictionary(e => e.Name, e => true);
 }
Beispiel #19
0
 public AndroidBasePage(AppDriver appDriver)
 {
     this.androidDriver = appDriver.AppiumAndroidDriver;
 }
Beispiel #20
0
 public HomePage()
 {
     this.driver = AppDriver.GetInstance().GetDriver();
 }
Beispiel #21
0
 public TareaPage()
 {
     this.driver = AppDriver.GetInstance().GetDriver();
 }
 public SearchPage(AppDriver appDriver)
     : base(appDriver)
 {
 }
Beispiel #23
0
 public void TestInitialize()
 {
     _app = new AppDriver();
 }
Beispiel #24
0
 /// <summary>
 /// プロセス終了
 /// </summary>
 public static void NotifyClassCleanup()
 {
     AppDriver.EndProcess();
 }
Beispiel #25
0
 /// <summary>
 /// プロセス起動
 /// </summary>
 public void NotifyTestInitialize()
 {
     AppDriver.Attach();
 }
Beispiel #26
0
 public void SetUpScenario()
 {
     AppDriver.InitializeDatabase();
 }
Beispiel #27
0
 public void GivenTheFollowingKnowRegisteredOwners(Table table)
 {
     AppDriver.AddTable("owners", table.Rows);
 }
Beispiel #28
0
 public void GivenTheFollowingPuppiesAreAvailableForAdoption(Table table)
 {
     AppDriver.AddTable("puppies", table.Rows);
 }
Beispiel #29
0
 public MockAppFixture()
 {
     _appDriver = new AppDriver($"--config {AppConfigFilePath}", 10 * 60 * 1000);
 }
 public void LoginToGmailInbox(string email, string password)
 {
     AppDriver.LoadURL("https://Uk.Mail.Yahoo.Com");
     Page.YahooMailLoginPage.EnterLoginDetails(email, password);
 }