예제 #1
0
 internal void VerifyTextInImage(string expectedTest)
 {
     try
     {
         AssertionProvider.Contains(expectedTest, text, "The expected text was not found in the image");
     }
     catch (Exception ex)
     {
         AssertionProvider.FailTest(ex.Message);
     }
 }
예제 #2
0
 public void OpenWikipediaHomePage()
 {
     try
     {
         _webDriver.Navigate().GoToUrl("https://www.wikipedia.org/");
     }
     catch (Exception ex)
     {
         AssertionProvider.FailTest(ex.Message);
     }
 }
예제 #3
0
 public void OpenTesseractTestPage()
 {
     try
     {
         _webDriver.Navigate().GoToUrl("http://www.mattmahoney.net/ocr/");
     }
     catch (Exception ex)
     {
         AssertionProvider.FailTest(ex.Message);
     }
 }
예제 #4
0
 public void VerifyWikipediaResultTitle(string expectedTitle)
 {
     try
     {
         WikiResultPage wikiResult = new WikiResultPage(_webDriver);
         AssertionProvider.EqualsHardAssert(wikiResult.GetPageTitle(), expectedTitle, "Wikipedia result page title");
     }
     catch (Exception ex)
     {
         AssertionProvider.FailTest(ex.Message);
     }
 }
예제 #5
0
 public void SearchInWikipedia(string searchTerm)
 {
     try
     {
         WikiHomePage wikiHome = new WikiHomePage(_webDriver);
         wikiHome.SearchATerm(searchTerm);
     }
     catch (Exception ex)
     {
         AssertionProvider.FailTest(ex.Message);
     }
 }
예제 #6
0
        public void OpenGoogleHomePage()
        {
            try
            {
                _webDriver.Navigate().GoToUrl("https://www.google.com/");
            }

            catch (Exception ex)
            {
                AssertionProvider.FailTest(ex.Message);
            }
        }
예제 #7
0
 internal void VerifyTextInSearchBar(string expectedTest)
 {
     try
     {
         GoogleHomePage googleHomePage  = new GoogleHomePage(_webDriver);
         string         textInSearchBar = googleHomePage.GetTextInInput();
         AssertionProvider.EqualsHardAssert(expectedTest, textInSearchBar, "the text in the search bar is not the expected");
     }
     catch (Exception ex)
     {
         AssertionProvider.FailTest(ex.Message);
     }
 }
예제 #8
0
 public void GetPageText()
 {
     try
     {
         MattmahoneyHomePage mattmahoneyHomePage = new MattmahoneyHomePage(_webDriver);
         mattmahoneyHomePage.CenterTestImage();
         _webDriver.TakeScreenshot("Tesseract_test");
         text = AIProvider.GetTextFromImage($"{GenericUtils.GetScreenShotsDirectory()}//Tesseract_test.bmp");
         Console.WriteLine("asd");
     }
     catch (Exception ex)
     {
         AssertionProvider.FailTest(ex.Message);
     }
 }
예제 #9
0
 public void WriteInGoogleSearchBar(string searchTerm)
 {
     try
     {
         using (var session = Sikuli.CreateSession())
         {
             var input = Patterns.FromFile("C:\\Users\\juan_\\Documents\\projects\\dotnetBase\\GenericProject\\GenericProject\\Resources\\SikuliImages\\GoogleSearchInput.png", 0.9f);
             var logo  = Patterns.FromFile("C:\\Users\\juan_\\Documents\\projects\\dotnetBase\\GenericProject\\GenericProject\\Resources\\SikuliImages\\GoogleLogo.png", 0.9f);
             session.Click(input);
             session.Type(searchTerm);
             session.Click(logo);
         }
     }
     catch (Exception ex)
     {
         AssertionProvider.FailTest(ex.Message);
     }
 }
예제 #10
0
        private void AssertionExamples(Token token)
        {
            var assertionProvider = new AssertionProvider(token);

            var assertionsForIssuer = assertionProvider.GetForIssuer("");

            Console.WriteLine(assertionsForIssuer.Count);

            var assertionsForBadge = assertionProvider.GetForBadge("", "");

            Console.WriteLine(assertionsForBadge.Count);

            var assertion = assertionProvider.Get("", "", "");

            Console.WriteLine(assertion.Slug);

            //issue assertion example
            var assertionToAdd = new AssertionAdd(token)
            {
                BadgeClass          = "",
                Issuer              = "",
                RecipientType       = "email",
                RecipientIdentifier = "",
                Narrative           = "",
                CreateNotification  = true,
                EvidenceItems       = new List <AssertionEvidence>
                {
                    new AssertionEvidence
                    {
                        Narrative   = "",
                        EvidenceUrl = "",
                        Expiration  = ""
                    }
                }
            }.Issue();

            Console.WriteLine(assertionToAdd.Slug);

            //update assertion example
            var assertionToUpdate = new AssertionUpdate(token)
            {
                Slug                = "",
                BadgeClass          = "",
                Issuer              = "",
                RecipientType       = "email",
                RecipientIdentifier = "",
                Narrative           = "",
                CreateNotification  = true,
                EvidenceItems       = new List <AssertionEvidence>
                {
                    new AssertionEvidence
                    {
                        Narrative   = "",
                        EvidenceUrl = "",
                        Expiration  = ""
                    }
                }
            }.Update();

            //revoke assertion example
            new AssertionUpdate(token)
            {
                Slug             = "",
                BadgeClass       = "",
                Issuer           = "",
                RevocationReason = ""
            }.Revoke();

            //issue batch assertion example
            new AssertionBatchAdd(token)
            {
                BadgeClass         = "",
                Issuer             = "",
                CreateNotification = true,
                Assertions         = new List <AssertionBatchAddAssertion>
                {
                    new AssertionBatchAddAssertion
                    {
                        RecipientIdentifier = "",
                        EvidenceItems       = new List <AssertionBatchAddEvidence>
                        {
                            new AssertionBatchAddEvidence
                            {
                                EvidenceUrl = ""
                            }
                        }
                    },
                    new AssertionBatchAddAssertion
                    {
                        RecipientIdentifier = "",
                        EvidenceItems       = new List <AssertionBatchAddEvidence>
                        {
                            new AssertionBatchAddEvidence
                            {
                                EvidenceUrl = ""
                            }
                        }
                    }
                }
            }.BatchIssue();
        }