Skip to content
Permalink
Browse files

Merge pull request #14 from lukasz-aw/downloading-driver-using-plugin

changed port to avoid permission issue
  • Loading branch information
lukasz-aw committed Jan 12, 2020
2 parents 7012435 + e749174 commit b63d11f6a9465fe421c1ea8405fb701daefb611f
@@ -1,4 +1,5 @@
target/
drivers/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
@@ -7,7 +7,7 @@

public class MoxProxyServiceConfigurationImpl implements MoxProxyServiceConfiguration {

private int port = 89;
private int port = 8089;
private List<String> urlWhiteListForTrafficRecorder;
private boolean matchSessionIdStrategy;
private boolean recordBodies;
@@ -10,6 +10,12 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>moxproxy.local.examples</artifactId>

<properties>
<drivers.location>${project.parent.basedir}/drivers</drivers.location>
<driver>geckodriver-linux-64bit</driver>
<webdriver.location>${drivers.location}/${driver}</webdriver.location>
</properties>

<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
@@ -60,6 +66,13 @@

<build>
<plugins>
<plugin>
<groupId>com.github.webdriverextensions</groupId>
<artifactId>webdriverextensions-maven-plugin</artifactId>
<configuration>
<installationDirectory>${project.parent.basedir}/drivers</installationDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
@@ -70,6 +83,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<webdriver.gecko.driver>${webdriver.location}</webdriver.gecko.driver>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
@@ -189,7 +189,7 @@ void whenBodyRemoved_thenNoResultsReturned() throws InterruptedException {
void whenRequestModified_thenModificationApplied() throws InterruptedException {

String ipadAgent = "Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3";
String xpath = "//a[@href='/wiki/Special:MobileMenu']";
String xpath = "//img[@src='/static/images/mobile/copyright/wikipedia-wordmark-en.png']";

MoxProxyRule rule = MoxProxyRule.builder()
.withDirection(MoxProxyDirection.REQUEST)
@@ -12,7 +12,7 @@
class TestBase {

static final int SLEEP_TIME = 2000;
static final int PROXY_PORT = 89;
static final int PROXY_PORT = 8089;
static final String WIKI_URL = "https://en.wikipedia.org";
static final String WIKIPEDIA = "wikipedia";
static final String WIKIPEDIA_ORG_PATTERN = "wikipedia\\.org";
@@ -28,7 +28,6 @@ static void beforeAllTests() {
((Logger)LoggerFactory.getLogger("org.bouncycastle")).setLevel(Level.OFF);
((Logger)LoggerFactory.getLogger("org.openqa.selenium")).setLevel(Level.OFF);
((Logger)LoggerFactory.getLogger("addons")).setLevel(Level.OFF);
System.setProperty("webdriver.gecko.driver", "D:\\webdriver\\geckodriver.exe");
}

FirefoxOptions setupFirefox() {
@@ -12,6 +12,12 @@
<artifactId>moxproxy.web.service</artifactId>
<packaging>jar</packaging>

<properties>
<drivers.location>${project.parent.basedir}/drivers</drivers.location>
<driver>geckodriver-linux-64bit</driver>
<webdriver.location>${drivers.location}/${driver}</webdriver.location>
</properties>

<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
@@ -79,6 +85,13 @@

<build>
<plugins>
<plugin>
<groupId>com.github.webdriverextensions</groupId>
<artifactId>webdriverextensions-maven-plugin</artifactId>
<configuration>
<installationDirectory>${drivers.location}</installationDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
@@ -105,6 +118,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<webdriver.gecko.driver>${webdriver.location}</webdriver.gecko.driver>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
@@ -11,7 +11,7 @@ logging:
server:
port: 8081
proxy:
proxyPort: 89
proxyPort: 8089
sessionIdMatchStrategy: true
recordContent: false
urlWhiteListForTrafficRecorder: []
@@ -12,7 +12,7 @@
class TestBase {

static final int SLEEP_TIME = 2000;
private static final int PROXY_PORT = 89;
private static final int PROXY_PORT = 8089;
static final String WIKI_URL = "https://en.wikipedia.org";
static final String WIKIPEDIA_ORG_PATTERN = "wikipedia\\.org";
static final String SEARCH_PROXY = "search=proxy";
@@ -26,7 +26,6 @@ static void beforeAllTests() {
((Logger)LoggerFactory.getLogger("org.littleshoot")).setLevel(Level.OFF);
((Logger)LoggerFactory.getLogger("org.bouncycastle")).setLevel(Level.OFF);
((Logger)LoggerFactory.getLogger("org.openqa.selenium")).setLevel(Level.OFF);
System.setProperty("webdriver.gecko.driver", "D:\\webdriver\\geckodriver.exe");
}

FirefoxOptions setupFirefox() {
@@ -137,7 +137,7 @@ void whenResponseModified_thenModificationApplied() throws InterruptedException
void whenRequestModified_thenModificationApplied() throws InterruptedException {

String ipadAgent = "Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3";
String xpath = "//a[@href='/wiki/Special:MobileMenu']";
String xpath = "//img[@src='/static/images/mobile/copyright/wikipedia-wordmark-en.png']";

MoxProxyRule rule = MoxProxyRule.builder()
.withSessionId(sessionId)
27 pom.xml
@@ -63,6 +63,7 @@
<dagger.version>2.24</dagger.version>
<netty.version>4.1.42.Final</netty.version>
<cache2k.version>1.2.2.Final</cache2k.version>
<webdriver.extensions.maven.plugin.version>3.2.0</webdriver.extensions.maven.plugin.version>
</properties>

<distributionManagement>
@@ -324,6 +325,32 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.webdriverextensions</groupId>
<artifactId>webdriverextensions-maven-plugin</artifactId>
<version>${webdriver.extensions.maven.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>install-drivers</goal>
</goals>
</execution>
</executions>
<configuration>
<drivers>
<driver>
<name>geckodriver</name>
<platform>windows</platform>
<bit>32</bit>
</driver>
<driver>
<name>geckodriver</name>
<platform>linux</platform>
<bit>64</bit>
</driver>
</drivers>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>

0 comments on commit b63d11f

Please sign in to comment.
You can’t perform that action at this time.