[JBoss JIRA] (ARQGRA-472) TestCases are copy-pasted
by Matous Jobanek (JIRA)
[ https://issues.jboss.org/browse/ARQGRA-472?page=com.atlassian.jira.plugin... ]
Matous Jobanek commented on ARQGRA-472:
---------------------------------------
PR: https://github.com/arquillian/arquillian-graphene/pull/151
> TestCases are copy-pasted
> -------------------------
>
> Key: ARQGRA-472
> URL: https://issues.jboss.org/browse/ARQGRA-472
> Project: Arquillian Graphene
> Issue Type: Bug
> Components: unit-test
> Affects Versions: 2.1-Tracking
> Reporter: Vitalii Grygoryuk
> Fix For: 2.1-Tracking
>
>
> TestHandlingOfStaleElements.testDeletion() and TestHandlingOfStaleElements.testReplacement() are both testing deletion, so there is no test case for node replacement logic:
> {code}
> @Test
> public void testDeletion() {
> rootElement.isDisplayed();
> executor.executeScript("return arguments[0].parentNode.removeChild(arguments[0])", rootElement);
> try {
> rootElement.isDisplayed();
> fail("rootElement should not be found");
> } catch (NoSuchElementException e) {
> }
> }
> @Test
> public void testReplacement() {
> rootElement.isDisplayed();
> executor.executeScript("return arguments[0].parentNode.removeChild(arguments[0])", rootElement);
> try {
> rootElement.isDisplayed();
> fail("rootElement should not be found");
> } catch (NoSuchElementException e) {
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ARQGRA-454) NPE in WebElementEnricher.enrich() with Arquillian 1.1.5.Final
by Matous Jobanek (JIRA)
[ https://issues.jboss.org/browse/ARQGRA-454?page=com.atlassian.jira.plugin... ]
Matous Jobanek commented on ARQGRA-454:
---------------------------------------
Here is PR with the test case https://github.com/arquillian/arquillian-graphene/pull/148
> NPE in WebElementEnricher.enrich() with Arquillian 1.1.5.Final
> --------------------------------------------------------------
>
> Key: ARQGRA-454
> URL: https://issues.jboss.org/browse/ARQGRA-454
> Project: Arquillian Graphene
> Issue Type: Bug
> Components: core
> Affects Versions: 2.0.3.Final, 2.1.0.Alpha2
> Reporter: Juergen Zimmermann
> Assignee: Lukáš Fryč
> Fix For: 2.0.4.Final, 2.1-Tracking
>
>
> I'm getting a GrapheneTestEnricherException caused by a NPE (see stacktrace below) after upgrading Arquillian to 1.1.5.Final. The issue doesn't exist with Arquillian 1.1.4.Final.
> The stacktrace:
> {code}
> org.jboss.arquillian.graphene.enricher.exception.GrapheneTestEnricherException:
> Error while initializing: class de.shop.util.IndexPage
> at org.jboss.arquillian.graphene.location.LocationEnricher.goTo(LocationEnricher.java:78)
> at org.jboss.arquillian.graphene.DefaultGrapheneRuntime.goTo(DefaultGrapheneRuntime.java:125)
> at org.jboss.arquillian.graphene.DefaultGrapheneRuntime.goTo(DefaultGrapheneRuntime.java:120)
> at org.jboss.arquillian.graphene.Graphene.goTo(Graphene.java:291)
> at de.shop.util.AbstractWebTest.before(AbstractWebTest.java:54)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:483)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
> at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:267)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:193)
> at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:345)
> at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:49)
> at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:207)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:155)
> at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
> at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
> at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
> at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
> at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
> Caused by: java.lang.NullPointerException
> at org.jboss.arquillian.graphene.enricher.WebElementEnricher.enrich(WebElementEnricher.java:68)
> at org.jboss.arquillian.graphene.enricher.AbstractSearchContextEnricher.enrichRecursively(AbstractSearchContextEnricher.java:73)
> at org.jboss.arquillian.graphene.enricher.PageObjectEnricher.setupPage(PageObjectEnricher.java:97)
> at org.jboss.arquillian.graphene.location.LocationEnricher.goTo(LocationEnricher.java:76)
> ... 34 more
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ARQ-1937) Class loading issue with injected deployer
by Matous Jobanek (JIRA)
[ https://issues.jboss.org/browse/ARQ-1937?page=com.atlassian.jira.plugin.s... ]
Matous Jobanek commented on ARQ-1937:
-------------------------------------
Hi,
yeah, I have to admit that the warning wasn't good idea - I will fix it.
> Class loading issue with injected deployer
> -------------------------------------------
>
> Key: ARQ-1937
> URL: https://issues.jboss.org/browse/ARQ-1937
> Project: Arquillian
> Issue Type: Bug
> Components: Deployable Containers SPI
> Affects Versions: 1.1.1.Final
> Reporter: Martin Gencur
> Assignee: Aslak Knutsen
> Fix For: 1.1.11.Final
>
>
> Steps to reproduce:
> 1) inject a Deployer via @ArquillianResource
> 2) declare a deployment as managed=false, use the deployer to deploy artifacts to a managed container
> 3) run a test method that operates on the deployment
> 4) check that classes inside the test method have the same classloader as the test class itself (see the code below where I call cache.getClass().getClassLoader())
> 5) this does not happen when the deployment is managed=true and deployer API is NOT used. In this case, the classes have a different class loader
> In the test below, I tried to load different versions of Infinispan in two deployments and test backward compatibility. However, due to this class loading issue the Infinispan classes are of the latest version regardless of libraries bundled in the WAR. This is probably due to the fact that the Maven test module has the latest Infinispan libraries defined in <dependencies> while the older version is downloaded separately via Maven dependency plugin.
> {code}
> package com.jboss.datagrid.test.backwardcompatibility;
> @RunWith(Arquillian.class)
> public class SingleFileStoreBackwardCompatibilityIT {
> private DefaultCacheManager dfc;
> private String cacheName = "testCache";
> private static final String OLD_ISPN = "dep1_with_old_ispn";
> private static final String NEW_ISPN = "dep2_with_new_ispn";
> private static Map<String, String> storedMap;
> @ArquillianResource
> Deployer deployer;
> @Deployment(name = OLD_ISPN, testable = true, managed = true, order=1)
> @TargetsContainer("container1")
> public static WebArchive createDeploymentOld() {
> WebArchive jar = DeploymentBuilder.createTestArchiveWithPreviousJDG("test1.war", "previous");
> System.out.println("ClassLoader: " + SingleFileStoreBackwardCompatibilityIT.class.getClassLoader());
> return jar;
> }
> @Deployment(name = NEW_ISPN, testable = true, managed = true, order=2)
> @TargetsContainer("container2")
> public static WebArchive createDeploymentNew() {
> WebArchive jar = DeploymentBuilder.createTestArchive("test2.war", "current");
> return jar;
> }
> private DefaultCacheManager configureCacheManager(boolean clearCacheStore) throws Exception {
> GlobalConfiguration glob = new GlobalConfigurationBuilder().nonClusteredDefault()
> .globalJmxStatistics().allowDuplicateDomains(true).
> build();
> ConfigurationBuilder c = new ConfigurationBuilder();
> c.clustering().cacheMode(CacheMode.LOCAL);
> File tmpStore = new File("/tmp/cache/" + cacheName + ".dat");
> if (clearCacheStore && tmpStore.exists()) {
> tmpStore.delete();
> }
> c.persistence().passivation(false).addSingleFileStore().purgeOnStartup(false).location("/tmp/cache/");
> Configuration cnf = c.build();
> DefaultCacheManager manager = new DefaultCacheManager(glob);
> manager.defineConfiguration(cacheName, cnf);
> return manager;
> }
> @Test
> @OperateOnDeployment(OLD_ISPN)
> @InSequence(1)
> public void testStoreWithOldJDG() throws Exception {
> deployer.deploy(OLD_ISPN);
> dfc = configureCacheManager(true);
> dfc.start();
> Cache<Object, Object> cache = dfc.getCache(cacheName);
> System.out.println("Version: " + cache.getVersion());
> System.out.println("ClassLoader: " + cache.getClass().getClassLoader());
> storedMap = new HashMap<String, String>();
> storedMap.put("k", "v");
> cache.put("mapKey", storedMap);
> dfc.stop();
> deployer.undeploy(OLD_ISPN);
> }
> @Test
> @OperateOnDeployment(NEW_ISPN)
> @InSequence(2)
> public void testReadWithNewJDG() throws Exception {
> deployer.deploy(NEW_ISPN);
> dfc = configureCacheManager(false);
> dfc.start();
> Cache<Object, Object> cache = dfc.getCache(cacheName);
> System.out.println("ClassLoader: " + cache.getClass().getClassLoader());
> System.out.println("Version: " + cache.getVersion());
> assertEquals(storedMap, cache.get("mapKey"));
> dfc.stop();
> deployer.undeploy(NEW_ISPN);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ARQ-1937) Class loading issue with injected deployer
by Ladislav Thon (JIRA)
[ https://issues.jboss.org/browse/ARQ-1937?page=com.atlassian.jira.plugin.s... ]
Ladislav Thon commented on ARQ-1937:
------------------------------------
After looking at Arquillian code and my project where I'm getting the warnings, I need to clarify my previous comment -- I'm only getting warnings when there is no {{@Deployment}} at all. This might be a corner case, but I actually have quite a lot of tests like that :-)
> Class loading issue with injected deployer
> -------------------------------------------
>
> Key: ARQ-1937
> URL: https://issues.jboss.org/browse/ARQ-1937
> Project: Arquillian
> Issue Type: Bug
> Components: Deployable Containers SPI
> Affects Versions: 1.1.1.Final
> Reporter: Martin Gencur
> Assignee: Aslak Knutsen
> Fix For: 1.1.11.Final
>
>
> Steps to reproduce:
> 1) inject a Deployer via @ArquillianResource
> 2) declare a deployment as managed=false, use the deployer to deploy artifacts to a managed container
> 3) run a test method that operates on the deployment
> 4) check that classes inside the test method have the same classloader as the test class itself (see the code below where I call cache.getClass().getClassLoader())
> 5) this does not happen when the deployment is managed=true and deployer API is NOT used. In this case, the classes have a different class loader
> In the test below, I tried to load different versions of Infinispan in two deployments and test backward compatibility. However, due to this class loading issue the Infinispan classes are of the latest version regardless of libraries bundled in the WAR. This is probably due to the fact that the Maven test module has the latest Infinispan libraries defined in <dependencies> while the older version is downloaded separately via Maven dependency plugin.
> {code}
> package com.jboss.datagrid.test.backwardcompatibility;
> @RunWith(Arquillian.class)
> public class SingleFileStoreBackwardCompatibilityIT {
> private DefaultCacheManager dfc;
> private String cacheName = "testCache";
> private static final String OLD_ISPN = "dep1_with_old_ispn";
> private static final String NEW_ISPN = "dep2_with_new_ispn";
> private static Map<String, String> storedMap;
> @ArquillianResource
> Deployer deployer;
> @Deployment(name = OLD_ISPN, testable = true, managed = true, order=1)
> @TargetsContainer("container1")
> public static WebArchive createDeploymentOld() {
> WebArchive jar = DeploymentBuilder.createTestArchiveWithPreviousJDG("test1.war", "previous");
> System.out.println("ClassLoader: " + SingleFileStoreBackwardCompatibilityIT.class.getClassLoader());
> return jar;
> }
> @Deployment(name = NEW_ISPN, testable = true, managed = true, order=2)
> @TargetsContainer("container2")
> public static WebArchive createDeploymentNew() {
> WebArchive jar = DeploymentBuilder.createTestArchive("test2.war", "current");
> return jar;
> }
> private DefaultCacheManager configureCacheManager(boolean clearCacheStore) throws Exception {
> GlobalConfiguration glob = new GlobalConfigurationBuilder().nonClusteredDefault()
> .globalJmxStatistics().allowDuplicateDomains(true).
> build();
> ConfigurationBuilder c = new ConfigurationBuilder();
> c.clustering().cacheMode(CacheMode.LOCAL);
> File tmpStore = new File("/tmp/cache/" + cacheName + ".dat");
> if (clearCacheStore && tmpStore.exists()) {
> tmpStore.delete();
> }
> c.persistence().passivation(false).addSingleFileStore().purgeOnStartup(false).location("/tmp/cache/");
> Configuration cnf = c.build();
> DefaultCacheManager manager = new DefaultCacheManager(glob);
> manager.defineConfiguration(cacheName, cnf);
> return manager;
> }
> @Test
> @OperateOnDeployment(OLD_ISPN)
> @InSequence(1)
> public void testStoreWithOldJDG() throws Exception {
> deployer.deploy(OLD_ISPN);
> dfc = configureCacheManager(true);
> dfc.start();
> Cache<Object, Object> cache = dfc.getCache(cacheName);
> System.out.println("Version: " + cache.getVersion());
> System.out.println("ClassLoader: " + cache.getClass().getClassLoader());
> storedMap = new HashMap<String, String>();
> storedMap.put("k", "v");
> cache.put("mapKey", storedMap);
> dfc.stop();
> deployer.undeploy(OLD_ISPN);
> }
> @Test
> @OperateOnDeployment(NEW_ISPN)
> @InSequence(2)
> public void testReadWithNewJDG() throws Exception {
> deployer.deploy(NEW_ISPN);
> dfc = configureCacheManager(false);
> dfc.start();
> Cache<Object, Object> cache = dfc.getCache(cacheName);
> System.out.println("ClassLoader: " + cache.getClass().getClassLoader());
> System.out.println("Version: " + cache.getVersion());
> assertEquals(storedMap, cache.get("mapKey"));
> dfc.stop();
> deployer.undeploy(NEW_ISPN);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ARQ-1937) Class loading issue with injected deployer
by Ladislav Thon (JIRA)
[ https://issues.jboss.org/browse/ARQ-1937?page=com.atlassian.jira.plugin.s... ]
Ladislav Thon commented on ARQ-1937:
------------------------------------
I'd like to understand more about this.
In my tests, I'm often intentionally setting my {{@Deployment}} to {{testable = false}}, or I have no {{@Deployment}} at all, with the intention that the test will run as client. I never use {{@RunAsClient}}, simply because it's superfluous. Yet I started to get warnings now.
Am I absolutely positively supposed to use {{@RunAsClient}} when I want the test to run as client?
> Class loading issue with injected deployer
> -------------------------------------------
>
> Key: ARQ-1937
> URL: https://issues.jboss.org/browse/ARQ-1937
> Project: Arquillian
> Issue Type: Bug
> Components: Deployable Containers SPI
> Affects Versions: 1.1.1.Final
> Reporter: Martin Gencur
> Assignee: Aslak Knutsen
> Fix For: 1.1.11.Final
>
>
> Steps to reproduce:
> 1) inject a Deployer via @ArquillianResource
> 2) declare a deployment as managed=false, use the deployer to deploy artifacts to a managed container
> 3) run a test method that operates on the deployment
> 4) check that classes inside the test method have the same classloader as the test class itself (see the code below where I call cache.getClass().getClassLoader())
> 5) this does not happen when the deployment is managed=true and deployer API is NOT used. In this case, the classes have a different class loader
> In the test below, I tried to load different versions of Infinispan in two deployments and test backward compatibility. However, due to this class loading issue the Infinispan classes are of the latest version regardless of libraries bundled in the WAR. This is probably due to the fact that the Maven test module has the latest Infinispan libraries defined in <dependencies> while the older version is downloaded separately via Maven dependency plugin.
> {code}
> package com.jboss.datagrid.test.backwardcompatibility;
> @RunWith(Arquillian.class)
> public class SingleFileStoreBackwardCompatibilityIT {
> private DefaultCacheManager dfc;
> private String cacheName = "testCache";
> private static final String OLD_ISPN = "dep1_with_old_ispn";
> private static final String NEW_ISPN = "dep2_with_new_ispn";
> private static Map<String, String> storedMap;
> @ArquillianResource
> Deployer deployer;
> @Deployment(name = OLD_ISPN, testable = true, managed = true, order=1)
> @TargetsContainer("container1")
> public static WebArchive createDeploymentOld() {
> WebArchive jar = DeploymentBuilder.createTestArchiveWithPreviousJDG("test1.war", "previous");
> System.out.println("ClassLoader: " + SingleFileStoreBackwardCompatibilityIT.class.getClassLoader());
> return jar;
> }
> @Deployment(name = NEW_ISPN, testable = true, managed = true, order=2)
> @TargetsContainer("container2")
> public static WebArchive createDeploymentNew() {
> WebArchive jar = DeploymentBuilder.createTestArchive("test2.war", "current");
> return jar;
> }
> private DefaultCacheManager configureCacheManager(boolean clearCacheStore) throws Exception {
> GlobalConfiguration glob = new GlobalConfigurationBuilder().nonClusteredDefault()
> .globalJmxStatistics().allowDuplicateDomains(true).
> build();
> ConfigurationBuilder c = new ConfigurationBuilder();
> c.clustering().cacheMode(CacheMode.LOCAL);
> File tmpStore = new File("/tmp/cache/" + cacheName + ".dat");
> if (clearCacheStore && tmpStore.exists()) {
> tmpStore.delete();
> }
> c.persistence().passivation(false).addSingleFileStore().purgeOnStartup(false).location("/tmp/cache/");
> Configuration cnf = c.build();
> DefaultCacheManager manager = new DefaultCacheManager(glob);
> manager.defineConfiguration(cacheName, cnf);
> return manager;
> }
> @Test
> @OperateOnDeployment(OLD_ISPN)
> @InSequence(1)
> public void testStoreWithOldJDG() throws Exception {
> deployer.deploy(OLD_ISPN);
> dfc = configureCacheManager(true);
> dfc.start();
> Cache<Object, Object> cache = dfc.getCache(cacheName);
> System.out.println("Version: " + cache.getVersion());
> System.out.println("ClassLoader: " + cache.getClass().getClassLoader());
> storedMap = new HashMap<String, String>();
> storedMap.put("k", "v");
> cache.put("mapKey", storedMap);
> dfc.stop();
> deployer.undeploy(OLD_ISPN);
> }
> @Test
> @OperateOnDeployment(NEW_ISPN)
> @InSequence(2)
> public void testReadWithNewJDG() throws Exception {
> deployer.deploy(NEW_ISPN);
> dfc = configureCacheManager(false);
> dfc.start();
> Cache<Object, Object> cache = dfc.getCache(cacheName);
> System.out.println("ClassLoader: " + cache.getClass().getClassLoader());
> System.out.println("Version: " + cache.getVersion());
> assertEquals(storedMap, cache.get("mapKey"));
> dfc.stop();
> deployer.undeploy(NEW_ISPN);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ARQ-413) Investigate possibility of reusing RHQ plugins to implement managed containers.
by Ondrej Zizka (JIRA)
[ https://issues.jboss.org/browse/ARQ-413?page=com.atlassian.jira.plugin.sy... ]
Ondrej Zizka reassigned ARQ-413:
--------------------------------
Assignee: (was: Ondrej Zizka)
> Investigate possibility of reusing RHQ plugins to implement managed containers.
> -------------------------------------------------------------------------------
>
> Key: ARQ-413
> URL: https://issues.jboss.org/browse/ARQ-413
> Project: Arquillian
> Issue Type: Task
> Reporter: Ondrej Zizka
> Priority: Optional
>
> (01:23:17) OndejZizka: aslak: One more thing, do you know RHQ project?
> (01:23:25) aslak: OndejZizka, yea?
> (01:23:50) OndejZizka: Well then you probably know that it has plugins for many containers
> (01:24:06) OndejZizka: So I thought, this could be re-used to make managed contaiers
> (01:24:26) aslak: hmm.. possible
> (01:24:27) OndejZizka: Basically, they have all it needs - starting, stopping, deploy/undeploy, config
> (01:24:34) OndejZizka: + some extras where possible
> (01:25:01) aslak: OndejZizka, got a url for source?
> (01:25:05) OndejZizka: Sure, sec
> (01:25:08) aslak: container source
> (01:25:21) OndejZizka: aslak: http://git.fedorahosted.org/git/?p=rhq/rhq.git;
> (01:26:00) OndejZizka: aslak: The source is vast. Not easy to locate concrete functionality, but plugins are separated as modules
> (01:37:52) jshaughn: ozizka-here: The CLI speaks only to the server
> (01:38:12) jshaughn: The only thing that comes close perhaps to what you're asking is the standalone plugin container
> jsanda_afk jshaughn
> (01:38:30) ozizka-here: jshaughn: Sounds promising, continue pls :)
> (01:38:36) jshaughn: this is a tool that is typically used to help rapid devleopment of plugins
> (01:39:14) jshaughn: it allows a plugin to basically run and gives a command line interface for executing its implementd factes
> (01:39:24) jshaughn: sorry, "facets"
> (01:39:42) jshaughn: I actually have not used it but let me see if I can track down a link
> (01:40:17) jshaughn: Heiko (pilhuhn) is the implementor and resident expert.
> (01:47:53) jshaughn: there is a video of it here: http://wiki.rhq-project.org/display/RHQ/Videos "Using the standalone plugin-container when developing RHQ plugins"
> (01:51:05) jshaughn: http://community.jboss.org/en/jopr/blog/2011/01/20/using-the-standalone-c...
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ARQGRA-417) Support for automatic scrolling to element before its usage
by Jiří Štefek (JIRA)
[ https://issues.jboss.org/browse/ARQGRA-417?page=com.atlassian.jira.plugin... ]
Jiří Štefek commented on ARQGRA-417:
------------------------------------
Imho the {{window.scrollTo(x,y)}} function cannot handle elements inside scrollable areas/elements (e.g. div#innerMiddle in https://gist.github.com/jstefek/3bfccc622dfe7c93fe3b). The better choice should be {{element.scrollIntoView()}} ([link|https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView]).
So the code would look like:
{code:java}
jsExecutor.executeScript("arguments[0].scrollIntoView();",element);
{code}
> Support for automatic scrolling to element before its usage
> -----------------------------------------------------------
>
> Key: ARQGRA-417
> URL: https://issues.jboss.org/browse/ARQGRA-417
> Project: Arquillian Graphene
> Issue Type: Feature Request
> Components: core
> Affects Versions: 2.0.1.Final
> Reporter: Juraj Húska
> Priority: Minor
> Fix For: 2.2-Tracking
>
>
> It would be nice if Graphene supports automatic scrolling of browser window to {{WebElement}} / Page Fragment before its is used.
> It can be useful for interactions with various popups web components: contextMenu, tooltip, ...
> Those components can not be interacted correctly when they are not in the viewport, and thus one needs to scroll to them manually in his test.
> It is often problem in CI environment, where tests run on screens with lower resolution (smaller part of the page fit the browser window, and lot of elements are not in the viewport).
> My naive implementation of this would look like:
> * intercept all calls to {{WebElements}} and PageFragments root elements
> * in the interceptor method get the location of the element by: {{Point location = element.getLocation();}}
> * a then scroll to it: {{jsExecutor.executeScript("window.scrollTo("" + location.getX() +", " + location.getY() + ")");}}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months