Skip to content

Commit

Permalink
test: make integration tests work with new headless mode (23.5) (#6871)
Browse files Browse the repository at this point in the history
* test: make integration tests work with new headless mode

* fix time picker IT
  • Loading branch information
sissbruecker authored Nov 27, 2024
1 parent e29a781 commit ca064d5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public abstract class AbstractItemCountComboBoxIT extends AbstractComboBoxIT {

// changing the dimension might get combo box change what it fetches and
// how many items it shows, so changing this is a bad idea ...
private static final Dimension TARGET_SIZE = new Dimension(1000, 900);
private static final Dimension TARGET_SIZE = new Dimension(1000, 1100);
protected ComboBoxElement comboBoxElement;
protected int countIncreasePageCount = 4;
protected int pageSize = new ComboBox<String>().getPageSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,11 @@ protected int getDeploymentPort() {
return 8080;
}

@Override
public void setup() throws Exception {
super.setup();

// Set a default window size
testBench().resizeViewPortTo(1024, 800);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ public void documentScroll_overlayPosition() {
// Make sure to use a small enough viewport so that the document needs
// to be scrolled to see the cell
getDriver().manage().window().setSize(WINDOW_SIZE_SMALL);
// Scroll the document horizontally
executeScript("document.documentElement.scrollLeft = 100");
// Scroll the document so the cell is visible
executeScript(
"document.documentElement.scrollLeft = 100;document.documentElement.scrollTop = 200;");

var cell = getSpreadsheet().getCellAt("B2");
// Open context menu for the cell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@ public void timePickerWithMinAndMaxSetting() {
Assert.assertEquals(
"The first item in the dropdown should be the min value",
"5:00 AM", picker.getItemText(0));
// Make sure the item is in the viewport / rendered
picker.scrollToItem(1000);
Assert.assertEquals(
"The last item in the dropdown should be the max value",
"4:00 PM", picker.getLastItemText());
"6:00 PM", picker.getLastItemText());
}

@Test
Expand Down

0 comments on commit ca064d5

Please sign in to comment.