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
import org.junit.rules.MethodRule; | |
import org.junit.runners.model.FrameworkMethod; | |
import org.junit.runners.model.Statement; | |
public class ExemploMethodRule implements MethodRule { | |
@Override | |
public Statement apply(final Statement base, FrameworkMethod method, Object target) { | |
System.out.println("ExemploMethodRule#apply() - base: " + base); | |
System.out.println("ExemploMethodRule#apply() - method (metodo de teste atual): " + method); |
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
import org.junit.*; | |
public class ExemploTest { | |
@Rule | |
public ExemploMethodRule exemploRule = new ExemploMethodRule(); | |
@BeforeClass | |
public static void beforeClass() { | |
System.out.println("@BeforeClass"); |
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
function ParsedUrl(url) { | |
var parser = document.createElement("a"); | |
parser.href = url; | |
// IE 8 and 9 dont load the attributes "protocol" and "host" in case the source URL | |
// is just a pathname, that is, "/example" and not "http://domain.com/example". | |
parser.href = parser.href; | |
// IE 7 and 6 wont load "protocol" and "host" even with the above workaround, | |
// so we take the protocol/host from window.location and place them manually |
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
<!-- | |
Notes: | |
- Using this file, the tools are "$dateTool" etc. not "$date" as default -- if needed, change the <key>. | |
- Apparently, this format is deprecated in Velocity Tools 2.0, but still works. I didn't manage to get the new | |
format working (http://velocity.apache.org/tools/devel/config-xml.html) so... | |
--> | |
<toolbox> |
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
<dependencies> | |
... | |
<!-- Test Dependencies Only --> | |
<!-- Last updated: 2015-10-29 --> | |
<dependency> | |
<groupId>junit</groupId> | |
<artifactId>junit</artifactId> | |
<version>4.12</version> | |
<scope>test</scope> |
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
<bean id="configProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> | |
<property name="location"> | |
<value>/WEB-INF/applicationContext.properties</value> | |
</property> | |
</bean> | |
<context:property-placeholder properties-ref="configProperties" /> | |
<!-- Now create a .properties file with the name above and reference its properties by | |
${propertyName} in .xml files or use @Value annotation to inject them in beans --> |
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
import static io.github.seleniumquery.SeleniumQuery.$; // this will allow the short syntax | |
public class SeleniumQueryExample { | |
public static void main(String[] args) { | |
// The WebDriver will be instantiated only when first used | |
$.driver() | |
.useChrome() // sets Chrome as the driver (this is optional, if omitted, will default to HtmlUnit) | |
.headless() // configures chrome to be headless | |
.autoDriverDownload() // automatically downloads and configures chromedriver.exe | |
.autoQuitDriver(); // automatically quits the driver when the JVM shuts down |
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
$(document).on("keyup.escKeyClosesModal", function(e) { ... }); |
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
<build>...<plugins>... | |
<plugin> | |
<groupId>org.wildfly.plugins</groupId> | |
<artifactId>wildfly-maven-plugin</artifactId> | |
<version>1.0.2.Final</version> | |
<configuration> | |
<afterDeployment> | |
<commands> | |
<command>/subsystem=security/security-domain="unused-domain":remove</command> | |
</commands> |
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
private String getXPathVersion(WebDriver context) { | |
try { | |
By.xpath("/nobody[@attr=lower-case('A')]").findElement(context); | |
return "2.0"; | |
} catch (Exception e) { | |
return "1.0"; | |
} | |
} |
OlderNewer