Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@

<jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>

<appium.version>8.0.0-beta2</appium.version>
<commons-lang3.version>3.9</commons-lang3.version>
<extentreports.version>4.1.5</extentreports.version>
<extent.cucumber.reports.version>1.1.0</extent.cucumber.reports.version>
Expand All @@ -89,15 +90,15 @@
<io.cucumber.version>5.6.0</io.cucumber.version>
<de.monochromata.cucumber.version>4.0.42</de.monochromata.cucumber.version>
<jackson2.version>2.9.9</jackson2.version>
<junit.version>5.5.1</junit.version>
<junit.version>5.8.2</junit.version>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional changes nee to be made to support moving to JUnit 5 and have Cucumber work.

https://medium.com/codex/bdd-testing-with-cucumber-junit-5-fb5a1c4354f9

<log4j2.version>2.16.0</log4j2.version>
<lombok.version>1.18.8</lombok.version>
<mashape.unirest.version>1.4.9</mashape.unirest.version>
<pdfbox.version>2.0.24</pdfbox.version>
<sauce_junit.version>2.1.21</sauce_junit.version>
<selenium-java.version>3.141.59</selenium-java.version>
<selenium-java.version>4.1.1</selenium-java.version>
<swagger-parser.version>2.0.14</swagger-parser.version>
<webdrivermanager.version>4.4.1</webdrivermanager.version>
<webdrivermanager.version>5.0.3</webdrivermanager.version>

<sonar.projectKey>dougnoel_sentinel</sonar.projectKey>
<sonar.organization>dougnoel</sonar.organization>
Expand Down Expand Up @@ -392,6 +393,12 @@
<version>${httpclient.version}</version>
</dependency>

<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>${appium.version}</version>
</dependency>

<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
Expand Down Expand Up @@ -565,6 +572,11 @@
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
</dependency>

<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/dougnoel/sentinel/elements/Element.java
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public Element dragAndDrop(Element target) throws IOException {
*/
public boolean isDisplayed() {
try {
return new WebDriverWait(driver(), Time.out().toSeconds(), Time.interval().toMillis())
return new WebDriverWait(driver(), Time.out(), Time.interval())
.ignoring(StaleElementReferenceException.class)
.until(ExpectedConditions.visibilityOf(element())).isDisplayed();
}
Expand All @@ -472,7 +472,7 @@ public boolean isDisplayed() {
*/
public boolean isHidden() {
try {
return new WebDriverWait(driver(), Time.out().toSeconds(), Time.interval().toMillis())
return new WebDriverWait(driver(), Time.out(), Time.interval())
.ignoring(StaleElementReferenceException.class)
.until(ExpectedConditions.invisibilityOf(element()));
}
Expand All @@ -494,7 +494,7 @@ public boolean isHidden() {
*/
public boolean isEnabled() {
try {
return new WebDriverWait(driver(), Time.out().toSeconds(), Time.interval().toMillis())
return new WebDriverWait(driver(), Time.out(), Time.interval())
.ignoring(StaleElementReferenceException.class)
.until(d -> element().isEnabled());
}
Expand All @@ -516,7 +516,7 @@ public boolean isEnabled() {
*/
public boolean isDisabled() {
try {
return new WebDriverWait(driver(), Time.out().toSeconds(), Time.interval().toMillis())
return new WebDriverWait(driver(), Time.out(), Time.interval())
.ignoring(StaleElementReferenceException.class)
.until(ExpectedConditions.attributeContains(element(), "disabled", ""));
}
Expand All @@ -535,7 +535,7 @@ public boolean isDisabled() {
*/
public boolean isSelected() {
try {
return new WebDriverWait(driver(), Time.out().toSeconds(), Time.interval().toMillis())
return new WebDriverWait(driver(), Time.out(), Time.interval())
.ignoring(StaleElementReferenceException.class)
.until(ExpectedConditions.elementToBeSelected(element()));
}
Expand All @@ -554,7 +554,7 @@ public boolean isSelected() {
*/
public boolean isNotSelected() {
try {
return new WebDriverWait(driver(), Time.out().toSeconds(), Time.interval().toMillis())
return new WebDriverWait(driver(), Time.out(), Time.interval())
.ignoring(StaleElementReferenceException.class)
.until(ExpectedConditions.elementSelectionStateToBe(element(), false));
}
Expand Down Expand Up @@ -602,7 +602,7 @@ public String getText() {
* @return true if the attribute exists for the element; otherwise false
*/
public boolean hasAttribute(String attribute) {
return new WebDriverWait(driver(), Time.out().toSeconds(), Time.interval().toMillis())
return new WebDriverWait(driver(), Time.out(), Time.interval())
.ignoring(StaleElementReferenceException.class)
.until(ExpectedConditions.attributeToBeNotEmpty(element(), attribute));
}
Expand All @@ -619,7 +619,7 @@ public boolean hasAttribute(String attribute) {
* @return true if the attribute does not exist for the element; otherwise false
*/
public boolean doesNotHaveAttribute(String attribute) {
return new WebDriverWait(driver(), Time.out().toSeconds(), Time.interval().toMillis())
return new WebDriverWait(driver(), Time.out(), Time.interval())
.ignoring(StaleElementReferenceException.class)
.until(ExpectedConditions.not(
ExpectedConditions.attributeToBeNotEmpty(element(), attribute)));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.dougnoel.sentinel.pages;

import java.util.Set;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.NoSuchFrameException;
import org.openqa.selenium.NoSuchWindowException;
Expand Down Expand Up @@ -311,7 +310,7 @@ public static String getCurrentUrl() {
* @throws InterruptedException if the thread gets interrupted
*/
public static boolean waitForPageLoad() throws InterruptedException {
driver().manage().timeouts().pageLoadTimeout(Time.out().toSeconds(), TimeUnit.SECONDS);
driver().manage().timeouts().pageLoadTimeout(Time.out());
while (!isPageLoaded()) {
Thread.sleep(20);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ private static String getDefaultBrowserVersion(URL url){
var cap = driver.getCapabilities();
driver.quit();

return cap.getVersion();
return cap.getBrowserVersion();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ public static WebDriver instantiateWebDriver() {
case "internetexplorer":
var ieOptions = new InternetExplorerOptions();
ieOptions.ignoreZoomSettings();
WebDriverManager.iedriver().setup();
// TODO: Removed call to WebDriverManager when we upgraded to 5.0.3 and logged a bug: https://github.com/bonigarcia/webdrivermanager/issues/771
// When this bug gets resolved we should put the call back and remove the hard-coded IEServerDriver from the resources directory.
System.setProperty("webdriver.ie.driver", "src/main/resources/drivers/windows/IEDriverServer.exe");
driver = new InternetExplorerDriver(ieOptions);
break;
case "opera":
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void tearDownAfterEachTest() {
WebDriverFactory.quit();
}

@Test(expected = org.openqa.selenium.remote.UnreachableBrowserException.class)
@Test(expected = org.openqa.selenium.SessionNotCreatedException.class)
public void createGridShouldFailTest() {
System.setProperty(BROWSERVERSION,"1234567");
System.setProperty(GRIDURL,"http://gridrul.com");
Expand Down