Skip to content

Commit

Permalink
can run tests in Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
asolntsev committed Dec 30, 2015
1 parent 38fbdd4 commit 289ae39
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion README.md
Expand Up @@ -7,12 +7,18 @@ This is a sample project demonstrating how to test Google search UI with Selenid

### How to run

To run Google tests, just type from command line:
To run Google tests (in Firefox), just type from command line:

```
./gradle
```

To run tests in Chrome, type:

```
./gradle chrome
```

_Feel free to share your feedback!_

### Video
Expand Down
4 changes: 4 additions & 0 deletions build.gradle
Expand Up @@ -43,3 +43,7 @@ test {
]
testLogging.showStandardStreams = true
}

task chrome(type: Test) {
systemProperties['selenide.browser'] = 'chrome'
}
Expand Up @@ -4,6 +4,7 @@
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.PageFactory;

Expand All @@ -14,7 +15,8 @@ public class GoogleTest {

@Before
public void setUp() {
driver = new FirefoxDriver();
driver = "chrome".equals(System.getProperty("selenide.browser")) ?
new ChromeDriver() : new FirefoxDriver();
}

@After
Expand Down

0 comments on commit 289ae39

Please sign in to comment.