@Test public void testGetItemsResponseCode() throws Exception { String relativeUri = "/items"; WebElement itemsGetTab = console.itemsGetTab(); itemsGetTab.click(); WebElement itemsGetTryIt; Boolean present; try { itemsGetTryIt = console.tryIt(); itemsGetTryIt.click(); present = true; } catch (NoSuchElementException e) { present = false; } WebElement itemsGetButton = console.itemsGetButton(); itemsGetButton.click(); // String responseCode = console.getResponseCode().getText(); // System.out.println("ResponseCode: " + responseCode); // // String urlItems = raml.getBaseUri() + relativeUri; // System.out.println("HttpClient url: " + urlItems); // // CloseableHttpClient httpClient = HttpClients.createDefault(); // HttpGet httpget = new HttpGet(urlItems); // CloseableHttpResponse response = httpClient.execute(httpget); // // Integer statusCode = response.getStatusLine().getStatusCode(); // // WebElement closePopup = console.popupCloseButton(); // closePopup.click(); // // Assert.assertEquals(responseCode, Integer.toString(statusCode)); }
@BeforeClass public void deployAndRunMule() throws IOException, InterruptedException { raml = Utilities.getRamlFromFile(); console = new Console(); console.loadRaml(raml); Utilities.updateConfig(mule_home, applicationName); Utilities.executeCommand("touch " + mule_home + "/apps/" + applicationName + "mule-config.xml"); Thread.sleep(20000); System.out.println( "Config after updates is: \n" + Utilities.getStringFromFile( mule_home + "/apps/" + applicationName + "mule-config.xml")); }
@Test public void testDocumentationTitle() { WebElement documentationTitle = console.getDocumentationTitle(); assert documentationTitle.getText().equals("Interop documentation"); }
@Test public void testTitle() throws InterruptedException { WebElement title = console.getTitle(); assert title.getText().equals(raml.getTitle()); }