Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1799 restore test case for full-size screenshots in Grid
- Loading branch information
Showing
5 changed files
with
67 additions
and
6 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
50 changes: 50 additions & 0 deletions
50
modules/grid/src/test/java/integration/FullScreenshotsGridTest.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,50 @@ | ||
package integration; | ||
|
||
import com.codeborne.selenide.Configuration; | ||
import com.codeborne.selenide.Selenide; | ||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.openqa.selenium.OutputType; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
import static com.codeborne.selenide.Selenide.webdriver; | ||
import static com.codeborne.selenide.WebDriverConditions.title; | ||
import static integration.ScreenshotTestHelper.verifyScreenshotSize; | ||
|
||
public class FullScreenshotsGridTest extends AbstractGridTest { | ||
private static final int width = 2200; | ||
private static final int height = 3300; | ||
|
||
@BeforeEach | ||
void setUp() { | ||
Configuration.remote = "http://localhost:" + hubPort + "/wd/hub"; | ||
} | ||
|
||
@AfterEach | ||
void tearDown() { | ||
Configuration.remote = null; | ||
} | ||
|
||
/* | ||
In non-local browser (grid), | ||
It fails or takes a screenshot of the wrong tab. | ||
See https://github.com/SeleniumHQ/selenium/issues/10810 | ||
*/ | ||
@Test | ||
void canTakeFullScreenshotWithTwoTabs() throws IOException { | ||
openFile("page_of_fixed_size_2200x3300.html"); | ||
webdriver().shouldHave(title("Test::page of fixed size 2200x3300")); | ||
|
||
Selenide.executeJavaScript("window.open()"); | ||
Selenide.switchTo().window(1); | ||
openFile("file_upload_form.html"); | ||
|
||
Selenide.switchTo().window(0); | ||
|
||
File screenshot = Selenide.screenshot(OutputType.FILE); | ||
verifyScreenshotSize(screenshot, width, height); | ||
} | ||
} |
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