when(pageExtensionMock.getInstallationDetectionScript()).thenReturn(JavaScript.fromString("return ((typeof document.Graphene2 != 'undefined') && document.Graphene2 == 2);"));
List<String> requirements = new ArrayList<String>();
requirements.add(SimplePageExtension.class.getName());
when(pageExtensionMock.getRequired()).thenReturn(requirements);
// registry
PageExtensionRegistry registry = context().getPageExtensionRegistry();
registry.register(new SimplePageExtension());
registry.register(pageExtensionMock);
// test
context().getPageExtensionInstallatorProvider().installator(pageExtensionMock.getName()).install();
Assert.assertTrue(context().getPageExtensionInstallatorProvider().installator(SimplePageExtension.class.getName()).isInstalled());
Assert.assertTrue(context().getPageExtensionInstallatorProvider().installator(pageExtensionMock.getName()).isInstalled());
}