Skip to content

Commit

Permalink
Merge pull request #1 from Batch-697-Adam-Ranieri/domi
Browse files Browse the repository at this point in the history
should be able to do cucumber stuffs
  • Loading branch information
dmrochon authored Feb 25, 2020
2 parents 44bbbc6 + 5bfb675 commit 8c9288b
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 0 deletions.
43 changes: 43 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,49 @@
<scope>runtime</scope>
</dependency>

<!-- add ons that may work -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java8</artifactId>
<version>4.2.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-spring</artifactId>
<version>4.2.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>4.2.0</version>
<scope>test</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>

<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.4</version>
<scope>test</scope>
</dependency>


</dependencies>

</project>
7 changes: 7 additions & 0 deletions resources/login.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Feature:
Background: On homepage
Given: The user is on the Rideshare homepage
Scenario: User Logins in
When: The user clicks on Login Button
Then:

Binary file added src/main/resources/chromedriver.exe
Binary file not shown.
14 changes: 14 additions & 0 deletions src/test/java/com/revature/pages/Homepage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.revature.pages;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.PageFactory;

public class Homepage {
WebDriver driver;

public Homepage(WebDriver driver) {
this.driver = driver;
PageFactory.initElements(driver, this);
}

}
33 changes: 33 additions & 0 deletions src/test/java/com/revature/runners/Runner.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.revature.runners;

import java.io.File;

import org.junit.AfterClass;
import org.junit.runner.RunWith;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

import com.revature.pages.Homepage;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(features = "src/test/resources", glue = "com.revature.steps")
public class Runner {

public static WebDriver driver;
public static Homepage homepage;

static {
File file = new File("src/main/resources/chromedriver.exe");
System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());
driver = new ChromeDriver();
homepage = new Homepage(driver);
}

@AfterClass
public void shutdown() {
driver.quit();
}
}
7 changes: 7 additions & 0 deletions src/test/resources/login.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Feature:
Background: On homepage
Given: The user is on the Rideshare homepage
Scenario: User Logins in
When: The user clicks on Login Button
Then:

0 comments on commit 8c9288b

Please sign in to comment.