public void Comps_Graph_S05_TC05_CanPostDeleteGroup() { GraphPages.Navigation.Select("Graph explorer"); int waitTime = Int32.Parse(GraphUtility.GetConfigurationValue("WaitTime")); int retryCount = Int32.Parse(GraphUtility.GetConfigurationValue("RetryCount")); string userName = GraphUtility.GetConfigurationValue("GraphExplorerUserName"); if (!GraphUtility.IsLoggedIn()) { GraphUtility.ClickLogin(); GraphUtility.Login( userName, GraphUtility.GetConfigurationValue("GraphExplorerPassword")); } //Change the operation from GET to POST GraphUtility.ClickButton("GET"); GraphUtility.Click("POST"); Dictionary <string, string> postProperties = new Dictionary <string, string>(); postProperties.Add("description", "A group for test"); string groupDisplayName = "TestGroup_" + DateTime.Now.ToString("M/d/yyyy/hh/mm/ss"); postProperties.Add("displayName", groupDisplayName); postProperties.Add("mailEnabled", "false"); postProperties.Add("securityEnabled", "true"); postProperties.Add("mailNickname", "TestGroupMail"); GraphUtility.InputExplorerJSONBody(postProperties); GraphUtility.InputExplorerQueryString("https://graph.microsoft.com/v1.0/groups" + "\n"); GraphBrowser.WaitForExploreResponse(); string postResponse = GraphUtility.GetExplorerResponse(); string postID = GraphUtility.GetProperty(postResponse, "id"); string postDisplayName = GraphUtility.GetProperty(postResponse, "displayName"); // Reload the page to empty the response GraphBrowser.Refresh(); //Check whether the created group can be gotten GraphUtility.InputExplorerQueryString("https://graph.microsoft.com/v1.0/groups/" + postID + "\n"); GraphBrowser.WaitForExploreResponse(); string getResponse = GraphUtility.GetExplorerResponse(); string getDisplayName = GraphUtility.GetProperty(getResponse, "displayName"); Assert.AreEqual( postDisplayName, getDisplayName, "The posted group should be able to GET"); // Reload the page to empty the response GraphBrowser.Refresh(); GraphUtility.ClickButton("GET"); GraphUtility.Click("DELETE"); GraphUtility.InputExplorerQueryString("https://graph.microsoft.com/v1.0/groups/" + postID + "\n"); GraphBrowser.WaitForExploreResponse(); string deleteResponse = GraphUtility.GetExplorerResponse(); GraphUtility.Click("DELETE"); GraphUtility.ClickButton("GET"); GraphUtility.InputExplorerQueryString("https://graph.microsoft.com/v1.0/groups/" + postID + "\n"); int i = 0; do { GraphBrowser.Wait(TimeSpan.FromSeconds(waitTime)); getResponse = GraphUtility.GetExplorerResponse(); i++; } while (i < retryCount && getResponse.Equals(deleteResponse)); Assert.IsTrue( getResponse.Contains("Request_ResourceNotFound"), "The group should be deleted successfully"); }