-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b55cf53
commit 73d97b1
Showing
7 changed files
with
105 additions
and
43 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,11 +1,45 @@ | ||
import base.BaseTests; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
import pages.SortableDataTablesPage; | ||
|
||
public class TheInternetTests extends BaseTests { | ||
|
||
private SortableDataTablesPage page = new SortableDataTablesPage(driver); | ||
|
||
@BeforeClass | ||
public static void startVisualTestSuite(){ | ||
eyesManager.setBatchName("Sort Table"); | ||
driver.get(System.getProperty("sites.tables.url")); | ||
} | ||
|
||
@Test | ||
public void testSortByLastName(){ | ||
page.sortLastNameColumn(); | ||
eyesManager.validateElement(page.getTableElementLocator()); | ||
} | ||
|
||
@Test | ||
public void testSortByFirstName(){ | ||
page.sortFirstNameColumn(); | ||
eyesManager.validateElement(page.getTableElementLocator()); | ||
} | ||
|
||
@Test | ||
public void testSortByEmail(){ | ||
page.sortEmailColumn(); | ||
eyesManager.validateElement(page.getTableElementLocator()); | ||
} | ||
|
||
@Test | ||
public void testSortByDueDate(){ | ||
page.sortDueColumn(); | ||
eyesManager.validateElement(page.getTableElementLocator()); | ||
} | ||
|
||
@Test | ||
public void testBottomFrame(){ | ||
driver.get(System.getProperty("site.frames.url")); | ||
validateFrame("frame-bottom"); | ||
public void testSortByWebsite(){ | ||
page.sortWebsiteColumn(); | ||
eyesManager.validateElement(page.getTableElementLocator()); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package base; | ||
|
||
import com.applitools.eyes.BatchInfo; | ||
import com.applitools.eyes.selenium.Eyes; | ||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.WebDriver; | ||
|
||
public class EyesManager { | ||
|
||
private Eyes eyes; | ||
private String appName; | ||
private WebDriver driver; | ||
|
||
public EyesManager(WebDriver driver, String appName){ | ||
this.driver = driver; | ||
this.appName = appName; | ||
|
||
eyes = new Eyes(); | ||
eyes.setApiKey(System.getProperty("applitools.api.key")); | ||
} | ||
|
||
public void setBatchName(String batchName){ | ||
eyes.setBatch(new BatchInfo(batchName)); | ||
} | ||
|
||
public void setTestGroup(String group){ | ||
eyes.addProperty("Test Group", group); | ||
} | ||
|
||
public void validateWindow(){ | ||
eyes.open(driver, appName, Thread.currentThread().getStackTrace()[2].getMethodName()); | ||
eyes.checkWindow(); | ||
eyes.close(); | ||
} | ||
|
||
public void validateElement(By locator){ | ||
eyes.open(driver, appName, Thread.currentThread().getStackTrace()[2].getMethodName()); | ||
eyes.checkElement(locator); | ||
eyes.close(); | ||
} | ||
|
||
public void validateFrame(String locator){ | ||
eyes.open(driver, appName, Thread.currentThread().getStackTrace()[2].getMethodName()); | ||
eyes.checkFrame(locator); | ||
eyes.close(); | ||
} | ||
|
||
public void abort(){ | ||
eyes.abortIfNotClosed(); | ||
} | ||
|
||
public Eyes getEyes(){ | ||
return eyes; | ||
} | ||
} |