add scenario1 test

This commit is contained in:
ucrhh 2021-02-27 22:19:55 +01:00
parent b058ee037c
commit 6c291ce271
7 changed files with 44 additions and 1 deletions

View File

@ -157,4 +157,35 @@ public class ScreenshotIT extends AbstractIT {
assertTrue("Screenshot comparison for 'exportLatexWithAssumptions' (stage 3) failed", assertTrue("Screenshot comparison for 'exportLatexWithAssumptions' (stage 3) failed",
testBench().compareScreen("exportLatexWithAssumptions3")); testBench().compareScreen("exportLatexWithAssumptions3"));
} }
@Test
public void testScenario1() throws IOException {
InputBarElement inputBar = $(InputBarElement.class).first();
String term = "λx. f x";
inputBar.setCurrentValue(term);
// check if the correct term is entered
Assert.assertEquals(term, inputBar.getCurrentValue());
inputBar.typeInfer();
ControlPanelElement controlPanelElement = $(ControlPanelElement.class).first();
assertTrue(testBench().compareScreen("testScenario1_step0"));
controlPanelElement.nextStep();
assertTrue(testBench().compareScreen("testScenario1_step1"));
controlPanelElement.nextStep();
assertTrue(testBench().compareScreen("testScenario1_step2"));
controlPanelElement.nextStep();
assertTrue(testBench().compareScreen("testScenario1_step3"));
controlPanelElement.nextStep();
assertTrue(testBench().compareScreen("testScenario1_step4"));
controlPanelElement.previousStep();
assertTrue(testBench().compareScreen("testScenario1_step3"));
controlPanelElement.previousStep();
assertTrue(testBench().compareScreen("testScenario1_step2"));
controlPanelElement.firstStep();
assertTrue(testBench().compareScreen("testScenario1_step0"));
controlPanelElement.lastStep();
assertTrue(testBench().compareScreen("testScenario1_step4gi"));
}
} }

View File

@ -6,7 +6,19 @@ import com.vaadin.testbench.annotations.Attribute;
@Attribute(name = "id", value = "control-panel") @Attribute(name = "id", value = "control-panel")
public class ControlPanelElement extends HorizontalLayoutElement { public class ControlPanelElement extends HorizontalLayoutElement {
public void firstStep() {
$(ButtonElement.class).get(1).click();
}
public void previousStep() {
$(ButtonElement.class).get(2).click();
}
public void nextStep() {
$(ButtonElement.class).get(3).click();
}
public void lastStep() { public void lastStep() {
$(ButtonElement.class).get(4).click(); $(ButtonElement.class).get(4).click();
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB