// Search the extension and assert the list of dependencies.
ExtensionAdministrationPage adminPage = ExtensionAdministrationPage.gotoPage().clickAddExtensionsSection();
ExtensionPane extensionPane =
adminPage.getSearchBar().clickAdvancedSearch().search(extensionId).getExtension(0);
ExtensionDependenciesPane dependenciesPane = extensionPane.openDependenciesSection();
List<DependencyPane> directDependencies = dependenciesPane.getDirectDependencies();
Assert.assertEquals(5, directDependencies.size());
Assert.assertEquals(dependency.getName(), directDependencies.get(0).getName());
Assert.assertEquals(dependencyId.getVersion().getValue(), directDependencies.get(0).getVersion());
Assert.assertEquals("remote", directDependencies.get(0).getStatus());
Assert.assertNull(directDependencies.get(0).getStatusMessage());
Assert.assertNull(directDependencies.get(1).getLink());
Assert.assertEquals("missing-dependency", directDependencies.get(1).getName());
Assert.assertEquals("135", directDependencies.get(1).getVersion());
Assert.assertEquals("unknown", directDependencies.get(1).getStatus());
Assert.assertNull(directDependencies.get(1).getStatusMessage());
Assert.assertNotNull(directDependencies.get(2).getLink());
Assert.assertEquals("XWiki Platform - Sheet - API", directDependencies.get(2).getName());
Assert.assertEquals("[3.2,)", directDependencies.get(2).getVersion());
Assert.assertEquals("core", directDependencies.get(2).getStatus());
Assert.assertEquals("Provided", directDependencies.get(2).getStatusMessage());
Assert.assertNotNull(directDependencies.get(3).getLink());
Assert.assertEquals("XWiki Commons - Diff API", directDependencies.get(3).getName());
Assert.assertEquals("2.7", directDependencies.get(3).getVersion());
Assert.assertEquals("remote-core", directDependencies.get(3).getStatus());
Assert.assertTrue(directDependencies.get(3).getStatusMessage().matches("Version [^\\s]+ is provided"));
Assert.assertEquals("XWiki Platform - Display API", directDependencies.get(4).getName());
Assert.assertEquals("100.1", directDependencies.get(4).getVersion());
Assert.assertEquals("remote-core-incompatible", directDependencies.get(4).getStatus());
Assert.assertTrue(directDependencies.get(4).getStatusMessage()
.matches("Incompatible with provided version [^\\s]+"));
Assert.assertTrue(dependenciesPane.getBackwardDependencies().isEmpty());
// Follow the link to a dependency.
directDependencies.get(0).getLink().click();
adminPage = new ExtensionAdministrationPage();
extensionPane = adminPage.getSearchResults().getExtension(0);