private static TestDataNode AddMetadataNode(TestData testData, string metadataType, TestTreeNode rootNode, Node parentNode) { var testDataNode = new TestDataNode(testData); var metadataList = testData.Metadata[metadataType]; if (metadataList.Count > 0) { foreach (string metadata in metadataList) { var metadataNode = FindOrAddMetadataNode(metadataType, rootNode, metadata); metadataNode.Nodes.Add(testDataNode); testDataNode = new TestDataNode(testData); // can't re-use node } } else if (parentNode != null) { parentNode.Nodes.Add(testDataNode); } else { var metadataNode = FindOrAddMetadataNode(metadataType, rootNode, "None"); metadataNode.Nodes.Add(testDataNode); } return(testDataNode); }
protected override void ExecuteTestCase() { Reporter.Add(new Chapter("Verify that whether the application save the username used in the last successful login,when the Remember Me setting is ON")); var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter); Step = "Launch the YPO application"; Step = "Click on Remember Me buuton"; pg_LoginPage.ClickonRemememberMe(); Step = "Verify the Remember me option is ON"; pg_LoginPage.VerifyRemememberMe(TestDataNode.SelectSingleNode("ExpectedStatus").InnerText); Step = "Login to YPO"; pg_LoginPage.Login(TestDataNode.SelectSingleNode("UserName").InnerText, TestDataNode.SelectSingleNode("Password").InnerText); Step = "wait for Logged out the YPO Application"; Thread.Sleep(65000); Step = "Logged out"; Driver.Quit(); Thread.Sleep(1000); Step = "Re-Launch the YPO application"; DesiredCapabilities dc = new DesiredCapabilities(); dc.SetCapability(IOSMobileCapabilityType.BundleId, "com.ypo.connect.qa"); Driver = new IOSDriver <IOSElement>(new Uri("http://localhost:4723/wd/hub"), dc); Step = "Re-Launched sussessfully"; Step = "Username should be prepopulated"; pg_LoginPage.VerifyUserNameFieldText(); }
private static TestTreeNode AddNode(TestData testData, TestTreeNode parent, TreeBuilderOptions options) { var testTreeNode = new TestDataNode(testData); if (options.NamespaceHierarchy == NamespaceHierarchy.Flat) { if (FixtureNode(testData) && parent.TestKind != TestKinds.Namespace) { var @namespace = testData.CodeReference.NamespaceName; parent = FindOrAddNamespaceNode(parent, @namespace, @namespace); } else if (testTreeNode.TestKind == TestKinds.Namespace) { return(parent); } } if (FixtureNode(testData) && parent.TestKind != TestKinds.Namespace) { parent = BuildNamespaceNode(testData, parent, options); } parent.Nodes.Add(testTreeNode); return(testTreeNode); }
//public IOSDriver<IOSElement> driver; protected override void ExecuteTestCase() { Reporter.Add(new Chapter("Validating Sign In")); var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter); Step = "Usernamefield_pre_populatedifRemembermeisturnedON"; pg_LoginPage.InactiveUser(TestDataNode.SelectSingleNode("UserName").InnerText, TestDataNode.SelectSingleNode("Password").InnerText); }
public void File_name_should_be_null_if_metadata_unavailable() { var testData = new TestData("id", "name", "fullName"); var testDataNode = new TestDataNode(testData); Assert.IsNull(testDataNode.FileName); }
public void CheckState_should_be_checked_otherwise() { var testData = new TestData("id", "name", "fullName"); var testDataNode = new TestDataNode(testData); Assert.AreEqual(CheckState.Checked, testDataNode.CheckState); }
public void Text_should_be_name_from_test_data() { var testData = new TestData("id", "name", "fullName"); var testDataNode = new TestDataNode(testData); Assert.AreEqual(testData.Name, testDataNode.Text); }
public void Test_kind_should_be_group_if_metadata_unavailable() { var testData = new TestData("id", "name", "fullName"); var testDataNode = new TestDataNode(testData); Assert.AreEqual(TestKinds.Group, testDataNode.TestKind); }
protected override void ExecuteTestCase() { Reporter.Add(new Chapter("Verify that Remember Me setting is OFF by default on the login screen")); var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter); Step = "Launch the YPO application"; Step = "Verify the Remember me option is OFF"; pg_LoginPage.VerifyRemememberMe(TestDataNode.SelectSingleNode("ExpectedStatus").InnerText); }
//public IOSDriver<IOSElement> driver; protected override void ExecuteTestCase() { Reporter.Add(new Chapter("Validating Sign In")); var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter); Step = "Login to YPO"; pg_LoginPage.Login(TestDataNode.SelectSingleNode("UserName").InnerText, TestDataNode.SelectSingleNode("Password").InnerText); Step = "Validate message"; pg_LoginPage.InvalidLogin(TestDataNode.SelectSingleNode("invalidcredentialsval_msg").InnerText); }
public void CheckState_should_be_unchecked_if_test_is_pending() { var testData = new TestData("id", "name", "fullName"); testData.Metadata.Add(MetadataKeys.PendingReason, ""); var testDataNode = new TestDataNode(testData); Assert.AreEqual(CheckState.Unchecked, testDataNode.CheckState); }
public void Test_kind_should_come_from_metadata_if_available() { var testData = new TestData("id", "name", "fullName"); const string testKind = TestKinds.Assembly; testData.Metadata.Add(MetadataKeys.TestKind, testKind); var testDataNode = new TestDataNode(testData); Assert.AreEqual(testKind, testDataNode.TestKind); }
public void IsTest_should_be_same_as_test_data() { var testData = new TestData("id", "name", "fullName") { IsTestCase = true }; var testDataNode = new TestDataNode(testData); Assert.AreEqual(testData.IsTestCase, testDataNode.IsTest); }
public void SourceCodeAvailable_should_be_true_if_code_location_is_set() { var testData = new TestData("id", "name", "fullName") { CodeLocation = new CodeLocation("", 1, 1) }; var testDataNode = new TestDataNode(testData); Assert.IsTrue(testDataNode.SourceCodeAvailable); }
protected override void ExecuteTestCase() { Reporter.Add(new Chapter("Verify that the member is able to enable Remember Me option on the login screen")); var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter); Step = "Launch the YPO application"; Step = "Click on Remember Me buuton"; pg_LoginPage.ClickonRemememberMe(); Step = "Verify the Remember me option is ON"; pg_LoginPage.VerifyRemememberMe(TestDataNode.SelectSingleNode("ExpectedStatus").InnerText); }
public void SourceCodeAvailable_should_be_false_if_code_location_is_unknown() { var testData = new TestData("id", "name", "fullName") { CodeLocation = CodeLocation.Unknown }; var testDataNode = new TestDataNode(testData); Assert.IsFalse(testDataNode.SourceCodeAvailable); }
//public IOSDriver<IOSElement> driver; protected override void ExecuteTestCase() { Reporter.Add(new Chapter("Validating Sign In")); var pg_CommonPage = Page <Common>(Driver, TestDataNode, Reporter); var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter); Step = "Login with YPO_member"; pg_LoginPage.Login(TestDataNode.SelectSingleNode("YPOChapterAdmin").InnerText, TestDataNode.SelectSingleNode("Password").InnerText); Step = "Wait for Directory Page"; pg_LoginPage.WaitforDirectorypage(); }
public void File_name_should_come_from_metadata_if_available() { var testData = new TestData("id", "name", "fullName"); const string file = "blahblah"; testData.Metadata.Add(MetadataKeys.File, file); var testDataNode = new TestDataNode(testData); Assert.AreEqual(file, testDataNode.FileName); }
//public IOSDriver<IOSElement> driver; protected override void ExecuteTestCase() { Reporter.Add(new Chapter("Validating Sign In")); var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter); Step = "Enter 2 characters in username field and 7 characters in password field"; pg_LoginPage.Insufficientchars27(TestDataNode.SelectSingleNode("UserName").InnerText, TestDataNode.SelectSingleNode("Password").InnerText); Step = "Enter 3 characters in username field and 6 characters in password field"; pg_LoginPage.Insufficientchars36(TestDataNode.SelectSingleNode("UserName1").InnerText, TestDataNode.SelectSingleNode("Password1").InnerText); Step = "Enter 3 characters in username field and 7 characters in password field"; pg_LoginPage.Insufficientchars37(TestDataNode.SelectSingleNode("UserName2").InnerText, TestDataNode.SelectSingleNode("Password2").InnerText); }
public TestTreeNode BuildTree(IProgressMonitor progressMonitor, TestModelData testModelData, TreeBuilderOptions options) { var root = new TestDataNode(testModelData.RootTest); progressMonitor.Worked(1); PopulateNamespaceTree(progressMonitor, testModelData.RootTest.Children, root, options); return(root); }
public void If_applied_filter_set_is_any_filter_then_the_root_should_be_checked() { var testTreeNode = new TestDataNode(new TestData("root", "root", "root")) { CheckState = CheckState.Unchecked }; testTreeModel.Stub(ttm => ttm.Root).Return(testTreeNode); var filterSet = new FilterSet <ITestDescriptor>(new AnyFilter <ITestDescriptor>()); filterService.ApplyFilterSet(filterSet); Assert.AreEqual(CheckState.Checked, testTreeNode.CheckState); }
private static void PopulateMetadataTree(IProgressMonitor progressMonitor, string metadataType, TestData testData, Node parentNode, TestTreeNode rootNode) { TestDataNode testDataNode = AddMetadataNode(testData, metadataType, rootNode, parentNode); foreach (var childTestData in testData.Children) { PopulateMetadataTree(progressMonitor, metadataType, childTestData, testDataNode, rootNode); } progressMonitor.Worked(1); }
public TestTreeNode BuildTree(IProgressMonitor progressMonitor, TestModelData testModelData, TreeBuilderOptions options) { var root = new TestDataNode(testModelData.RootTest); progressMonitor.Worked(1); foreach (var childTestData in testModelData.RootTest.Children) { PopulateMetadataTree(progressMonitor, options.TreeViewCategory, childTestData, null, root); } return(root); }
public bool CheckResultsAndSelectOne() { bool isSuccess = false; try { Reporter.Add(new Act(String.Format("Select top one match from the search results"))); ClickOnObject(lnk_SearchResults(TestDataNode.SelectSingleNode("SearchValue").InnerText)); isSuccess = true; } catch (Exception ex) { throw new Exception(ex.Message); } return(isSuccess); }
private bool Matches(TestDataNode node) { if (node.CodeReference == CodeReference.Unknown) { return(false); } var namespaceName = node.CodeReference.NamespaceName; if (namespaceName == null) { return(false); } return(CaseInsensitiveContains(namespaceName, @namespace)); }
public bool SearchProduct() { bool isSuccess = false; try { Reporter.Add(new Act(String.Format("Input search value as : '{0}' ", TestDataNode.SelectSingleNode("SearchValue").InnerText))); SetValueToObject(txt_Searchbox, TestDataNode.SelectSingleNode("SearchValue").InnerText); Reporter.Add(new Act(String.Format("Click on Search"))); ClickOnObject(btn_Submit); isSuccess = true; } catch (Exception ex) { throw new Exception(ex.Message); } return(isSuccess); }
public void Filter_sets_should_be_applied_appropriately() { var root = new TestDataNode(new TestData("root", "root", "root")); var test1 = new TestDataNode(new TestData("test1", "test1", "test1")); var test2 = new TestDataNode(new TestData("test2", "test2", "test2")); root.Nodes.Add(test1); root.Nodes.Add(test2); testTreeModel.Stub(ttm => ttm.Root).Return(root); var filterSet = new FilterSet <ITestDescriptor>(new OrFilter <ITestDescriptor>(new[] { new IdFilter <ITestDescriptor>(new EqualityFilter <string>("test2")) })); filterService.ApplyFilterSet(filterSet); Assert.AreEqual(CheckState.Indeterminate, root.CheckState); Assert.AreEqual(CheckState.Unchecked, test1.CheckState); Assert.AreEqual(CheckState.Checked, test2.CheckState); }
//public IOSDriver<IOSElement> driver; protected override void ExecuteTestCase() { Reporter.Add(new Chapter("Validating Sign In")); var pg_CommonPage = Page <Common>(Driver, TestDataNode, Reporter); var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter); Step = "Login with YPO_member"; pg_LoginPage.Login(TestDataNode.SelectSingleNode("YPOMember").InnerText, TestDataNode.SelectSingleNode("Password").InnerText); Step = "Wait for Directory Page"; pg_LoginPage.WaitforDirectorypage(); // Step = "Close the YPO app"; // Driver.Quit(); // Step = "Reopen the application"; // Thread.Sleep(59000); // var pg_CommonPage1 = Page<Common>(Driver1, TestDataNode, Reporter); // DesiredCapabilities dc1 = new DesiredCapabilities(); // dc1.SetCapability(IOSMobileCapabilityType.BundleId, "com.ypo.connect.qa"); // Driver1 = new IOSDriver<IOSElement>(new Uri("http://localhost:4723/wd/hub"), dc1); // Step = "Login with YPO_Spouse_member"; // Step = "Login with YPO_Spouse_member"; // pg_LoginPage.Login(TestDataNode.SelectSingleNode("YPOSpouse").InnerText, TestDataNode.SelectSingleNode("Password").InnerText); // Step = "Wait for Directory Page"; // pg_LoginPage.WaitforDirectorypage(); // Step = "Close the YPO app"; //Driver.Quit(); // Step = "Reopen the application"; // Thread.Sleep(59000); /* dc.SetCapability(IOSMobileCapabilityType.BundleId, "com.ypo.connect.qa"); * Driver = new IOSDriver<IOSElement>(new Uri("http://localhost:4723/wd/hub"), dc); * * Step = "Login with YPO_ChapterAdmin"; * pg_LoginPage.Login(TestDataNode.SelectSingleNode("YPOChapterAdmin").InnerText, TestDataNode.SelectSingleNode("Password").InnerText);*/ }
private static bool NodeIsASelectedTest(TestDataNode testDataNode) { return(testDataNode != null && testDataNode.IsTest && testDataNode.IsChecked); }