-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new assertTextContainsLoop method in Commands class.
- Loading branch information
dwhit88
committed
Sep 20, 2018
1 parent
6051ae2
commit 43e5fc2
Showing
8 changed files
with
158 additions
and
75 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
45 changes: 45 additions & 0 deletions
45
src/test/java/frameworkSandbox/AssertTextContainsLoop.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,45 @@ | ||
package frameworkSandbox; | ||
|
||
import framework.Commands; | ||
import framework.Drivers; | ||
import framework.PropsSystem; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.support.FindBy; | ||
import org.openqa.selenium.support.PageFactory; | ||
import org.testng.annotations.BeforeTest; | ||
import org.testng.annotations.Test; | ||
|
||
import java.io.File; | ||
import java.util.List; | ||
|
||
public class AssertTextContainsLoop { | ||
|
||
public static WebDriver d; | ||
|
||
@BeforeTest | ||
public static void beforeTest(){ | ||
// d = Drivers.safariDriver("https://www.newegg.com/"); | ||
// d = Drivers.safariDriver(d, "http://sl-test.herokuapp.com/guinea_pig/file_upload"); | ||
// d = Drivers.firefoxDriver(d, "http://sl-test.herokuapp.com/guinea_pig/file_upload"); | ||
// d = Drivers.chromeDriver("http://sl-test.herokuapp.com/guinea_pig/file_upload"); | ||
File f = new File("/Users/darrinwhitley/Documents/workspace/slCreds"); | ||
d = Drivers.sauceLabsConfig(f, PropsSystem.chrome, "Windows 10", "https://www.xkcd.com"); | ||
d.manage().window().maximize(); | ||
PageFactory.initElements(d, AssertTextContainsLoop.class); | ||
} | ||
|
||
@Test | ||
public static void test(){ | ||
waitPageLoad(); | ||
Commands.assertTextContainsLoop(nav, "Prev", ""); | ||
} | ||
|
||
@FindBy(className = "comicNav") | ||
public static List<WebElement> nav = null; | ||
|
||
public static void waitPageLoad(){ | ||
Commands.waitForURL(d, "xkcd"); | ||
Commands.waitForEl(d, nav.get(0)); | ||
} | ||
} |