Skip to content

Commit

Permalink
test: ensure session expired notificaiton is not show (#118) (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollovati authored Jul 28, 2024
1 parent a081e44 commit bddb824
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
import com.vaadin.flow.router.Route;
import com.vaadin.flow.router.RouteAlias;
import com.vaadin.flow.router.RouterLayout;
import com.vaadin.flow.server.DefaultSystemMessagesProvider;
import com.vaadin.flow.server.VaadinService;
import com.vaadin.flow.server.VaadinServlet;
import com.vaadin.flow.server.VaadinSession;
import com.vaadin.flow.server.WrappedSession;
Expand Down Expand Up @@ -157,6 +159,8 @@ public static Stream<Class<? extends Component>> getViewClasses() {
public abstract static class MyAbstractView extends Div {

protected MyAbstractView() {
// Ensure session expired notification is not shown
VaadinService.getCurrent().setSystemMessagesProvider(DefaultSystemMessagesProvider.get());
getViewClasses().forEach(c -> {
String viewName = c.getSimpleName();
Element div = ElementFactory.createDiv();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
package com.vaadin.flow.uitest.ui;

import com.vaadin.flow.testutil.ChromeBrowserTest;

import net.jcip.annotations.NotThreadSafe;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
Expand All @@ -42,6 +44,7 @@
* @author Vaadin Ltd
* @since 1.0.
*/
@NotThreadSafe
public class InternalErrorIT extends ChromeBrowserTest {

private static final String UPDATE = "update";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@
package com.vaadin.flow.uitest.ui;

import com.vaadin.flow.testutil.ChromeBrowserTest;

import net.jcip.annotations.NotThreadSafe;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.openqa.selenium.By;

@NotThreadSafe
public class RouterSessionExpirationIT extends ChromeBrowserTest {

@Override
Expand All @@ -49,7 +52,6 @@ public void should_HaveANewSessionId_when_NavigationAfterSessionExpired() {
// be a new session
String currentSessionId = sessionId;
waitUntil(d -> !currentSessionId.equals(getSessionId()));
//Assert.assertNotEquals(sessionId, getSessionId());
sessionId = getSessionId();
navigateToAnotherView();
// session is preserved
Expand Down

0 comments on commit bddb824

Please sign in to comment.