-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARQGRA-345: GrapheneElement can not be used as @Root - fixed #90
Merged
+415
−252
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
ftest/src/test/java/org/jboss/arquillian/graphene/ftest/issues/ARQGRA345.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/** | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2013, Red Hat, Inc. and individual contributors | ||
* by the @authors tag. See the copyright.txt in the distribution for a | ||
* full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.jboss.arquillian.graphene.ftest.issues; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import java.net.URL; | ||
|
||
import org.jboss.arquillian.container.test.api.Deployment; | ||
import org.jboss.arquillian.container.test.api.RunAsClient; | ||
import org.jboss.arquillian.drone.api.annotation.Drone; | ||
import org.jboss.arquillian.graphene.GrapheneElement; | ||
import org.jboss.arquillian.graphene.fragment.Root; | ||
import org.jboss.arquillian.graphene.ftest.Resource; | ||
import org.jboss.arquillian.graphene.ftest.Resources; | ||
import org.jboss.arquillian.junit.Arquillian; | ||
import org.jboss.arquillian.test.api.ArquillianResource; | ||
import org.jboss.shrinkwrap.api.spec.WebArchive; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.support.FindBy; | ||
|
||
/** | ||
* @author <a href="mailto:jhuska@redhat.com">Juraj Huska</a> | ||
*/ | ||
@RunWith(Arquillian.class) | ||
@RunAsClient | ||
public class ARQGRA345 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please rename the test cases meaningfully and structure them appropriately to respective test packages? |
||
|
||
@ArquillianResource | ||
private URL contextRoot; | ||
|
||
@Drone | ||
private WebDriver browser; | ||
|
||
@FindBy(id = "root") | ||
private PageFragmentWithGrapheneElementAsRoot fragment; | ||
|
||
private static final String SAMPLE_PACKAGE = "org.jboss.arquillian.graphene.ftest.enricher"; | ||
|
||
@Deployment | ||
public static WebArchive createTestArchive() { | ||
return Resources.inPackage(SAMPLE_PACKAGE).all().buildWar("test.war"); | ||
} | ||
|
||
@Before | ||
public void loadPage() { | ||
Resource.inPackage(SAMPLE_PACKAGE).find("sample.html").loadPage(browser, contextRoot); | ||
} | ||
|
||
@Test | ||
public void graphene_element_should_be_able_to_be_used_as_root_of_page_fragment() { | ||
assertEquals(fragment.getInnerElement().getText(), "pseudo root"); | ||
} | ||
|
||
public class PageFragmentWithGrapheneElementAsRoot { | ||
|
||
@Root | ||
private GrapheneElement root; | ||
|
||
@FindBy(id = "pseudoroot") | ||
private GrapheneElement innerElement; | ||
|
||
public GrapheneElement getInnerElement() { | ||
return innerElement; | ||
} | ||
|
||
public GrapheneElement getRoot() { | ||
return root; | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document the interface.