Skip to content

Commit

Permalink
chore: close orphand browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
manolo committed Aug 7, 2023
1 parent 7daf221 commit 5d626d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.vaadin.testbenchexample.junit5;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
Expand Down Expand Up @@ -34,6 +35,11 @@ public void setUp() {
getDriver().get("http://" + IPAddress.findSiteLocalAddress() + ":8080");
}

@AfterEach
public void afterEach() {
getDriver().close();
}

// IT test for demo purposes
protected void calculate_resultEquals(String a, String op, String b, String result) {
$(ButtonElement.class).id("button_" + a).click();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.vaadin.testbenchexample.junit5;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.openqa.selenium.SearchContext;
Expand Down Expand Up @@ -37,6 +38,11 @@ public void beforeEach(BrowserTestInfo browserTestInfo) { // driver injection
this.driver.get("http://" + IPAddress.findSiteLocalAddress() + ":8080");
}

@AfterEach
public void afterEach() {
this.driver.close();
}

@BrowserTest // test with TestBench 9 annotation
public void calculateOnePlusTwo() {
$(ButtonElement.class).id("button_1").click();
Expand Down

0 comments on commit 5d626d0

Please sign in to comment.