Skip to content

Instantly share code, notes, and snippets.

@antonio
Created December 10, 2010 12:53
Show Gist options
  • Save antonio/736170 to your computer and use it in GitHub Desktop.
Save antonio/736170 to your computer and use it in GitHub Desktop.
SeleniumMagic
public void drupalNodeCollectionXmlValidationWithContents()
throws IOException, DocumentException, InterruptedException {
DrupalGenerateContentsPage page = PageFactory.initElements(driver,
DrupalGenerateContentsPage.class);
page.open(drupalUrl);
page.unselectAllTypeCheckboxes();
page.selectCheckbox("node_types[node_test]");
page.selectCheckbox("kill_content");
page.setNumNodes(10);
page.setNodesNow();
page.generate();
Wait wait = new Wait() {
@Override
public boolean until() {
Selenium selenium = new WebDriverBackedSelenium(driver,
drupalUrl + DrupalUrls.GENERATE_CONTENT);
return !selenium.isTextPresent("Generating Content");
}
};
wait.wait("Waiting for nodes to be generated", 120000);
Document xmlDocument = reader.read(drupalUrl + drupalIcmsHandler + "/"
+ NODES_COLLECTION);
validateOpenSearch(xmlDocument);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment