Skip to content

Commit

Permalink
[java] Running some screenshot tests only on CI
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
diemol committed Nov 9, 2021
1 parent 2eb9231 commit 0088930
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions java/test/org/openqa/selenium/TakesScreenshotTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,21 @@

package org.openqa.selenium;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;
import static org.openqa.selenium.support.ui.ExpectedConditions.frameToBeAvailableAndSwitchToIt;
import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs;
import static org.openqa.selenium.support.ui.ExpectedConditions.visibilityOfAllElementsLocatedBy;
import static org.openqa.selenium.testing.drivers.Browser.CHROME;
import static org.openqa.selenium.testing.drivers.Browser.EDGE;
import static org.openqa.selenium.testing.drivers.Browser.FIREFOX;
import static org.openqa.selenium.testing.drivers.Browser.IE;
import static org.openqa.selenium.testing.drivers.Browser.LEGACY_FIREFOX_XPI;
import static org.openqa.selenium.testing.drivers.Browser.SAFARI;

import com.google.common.collect.Sets;

import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
Expand All @@ -28,7 +42,6 @@
import org.openqa.selenium.testing.NotYetImplemented;
import org.openqa.selenium.testing.SwitchToTopAfterTest;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.awt.image.Raster;
import java.io.ByteArrayInputStream;
Expand All @@ -38,18 +51,7 @@
import java.util.Set;
import java.util.TreeSet;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;
import static org.openqa.selenium.support.ui.ExpectedConditions.frameToBeAvailableAndSwitchToIt;
import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs;
import static org.openqa.selenium.support.ui.ExpectedConditions.visibilityOfAllElementsLocatedBy;
import static org.openqa.selenium.testing.drivers.Browser.CHROME;
import static org.openqa.selenium.testing.drivers.Browser.EDGE;
import static org.openqa.selenium.testing.drivers.Browser.LEGACY_FIREFOX_XPI;
import static org.openqa.selenium.testing.drivers.Browser.IE;
import static org.openqa.selenium.testing.drivers.Browser.FIREFOX;
import static org.openqa.selenium.testing.drivers.Browser.SAFARI;
import javax.imageio.ImageIO;

/**
* Test screenshot feature.
Expand Down Expand Up @@ -120,6 +122,7 @@ public void testGetScreenshotAsBinary() {
}

@Test
@Ignore(value = CHROME, gitHubActions = true)
public void testShouldCaptureScreenshotOfCurrentViewport() {
driver.get(appServer.whereIs("screen/screen.html"));

Expand All @@ -138,6 +141,7 @@ public void testShouldCaptureScreenshotOfCurrentViewport() {
}

@Ignore(LEGACY_FIREFOX_XPI)
@Ignore(value = CHROME, gitHubActions = true)
@Test
public void testShouldCaptureScreenshotOfAnElement() throws Exception {
driver.get(appServer.whereIs("screen/screen.html"));
Expand Down Expand Up @@ -276,6 +280,7 @@ public void testShouldCaptureScreenshotOfPageWithTooLongXandY() {
}

@Test
@Ignore(value = CHROME, gitHubActions = true)
public void testShouldCaptureScreenshotAtFramePage() {
driver.get(appServer.whereIs("screen/screen_frames.html"));
wait.until(frameToBeAvailableAndSwitchToIt(By.id("frame1")));
Expand Down Expand Up @@ -336,6 +341,7 @@ public void testShouldCaptureScreenshotAtIFramePage() {
@SwitchToTopAfterTest
@Test
@Ignore(FIREFOX)
@Ignore(value = CHROME, gitHubActions = true)
public void testShouldCaptureScreenshotAtFramePageAfterSwitching() {
driver.get(appServer.whereIs("screen/screen_frames.html"));

Expand Down

0 comments on commit 0088930

Please sign in to comment.