Skip to content

Commit

Permalink
Fixing ignores in Safari specific tests
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Feb 27, 2018
1 parent b71725c commit be4bcf5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
19 changes: 8 additions & 11 deletions java/client/test/org/openqa/selenium/safari/CleanSessionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.openqa.selenium.testing.Driver.SAFARI;

import org.junit.AfterClass;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.Cookie;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NeedsLocalEnvironment;
import org.openqa.selenium.testing.NotYetImplemented;

@NeedsLocalEnvironment(reason = "Requires local browser launching environment")
public class CleanSessionTest extends JUnit4TestBase {
Expand All @@ -36,26 +38,20 @@ public class CleanSessionTest extends JUnit4TestBase {

@AfterClass
public static void quitDriver() {
JUnit4TestBase.removeDriver();
removeDriver();
}

private void createCleanSession() {
quitDriver();

SafariOptions safariOptions = new SafariOptions();
safariOptions.setUseCleanSession(true);
WebDriver otherDriver = null;
try {
otherDriver = new SafariDriver(safariOptions);
driver.get(pages.alertsPage);
} finally {
if (otherDriver != null) {
otherDriver.quit();
}
}
driver = new SafariDriver(safariOptions);
driver.get(pages.alertsPage);
}

@Test
@NotYetImplemented(SAFARI)
public void shouldClearCookiesWhenStartingWithACleanSession() {
createCleanSession();
assertNoCookies();
Expand Down Expand Up @@ -86,6 +82,7 @@ private void runFunctionRedefinitionTest(String script) {
}

@Test
@Ignore(SAFARI)
public void executeAsyncScriptIsResilientToPagesRedefiningSetTimeout() {
driver.get(appServer.whereIs("messages.html"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class CrossDomainTest extends JUnit4TestBase {

@AfterClass
public static void quitDriver() {
JUnit4TestBase.removeDriver();
removeDriver();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

@RunWith(Suite.class)
@Suite.SuiteClasses({
StandardSeleniumTests.class,
AlertsTest.class,
//StandardSeleniumTests.class,
//AlertsTest.class,
CleanSessionTest.class,
CrossDomainTest.class,
SafariOptionsTest.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,21 @@ public void checkTechnologyPreviewInstalled() {

@Test
public void canStartTechnologyPreview() {
removeDriver();
SafariOptions options = new SafariOptions();
options.setUseTechnologyPreview(true);

WebDriver driver = new SafariDriver(options);

driver.get(pages.xhtmlTestPage);
assertEquals("XHTML Test Page", driver.getTitle());
WebDriver driver2 = null;
try {
driver2 = new SafariDriver(options);

driver2.get(pages.xhtmlTestPage);
assertEquals("XHTML Test Page", driver2.getTitle());
} finally {
if (driver2 != null) {
driver2.quit();
}
}
}

}

0 comments on commit be4bcf5

Please sign in to comment.