18
18
import org .junit .After ;
19
19
import org .junit .Assert ;
20
20
import org .junit .Before ;
21
+ import org .junit .Ignore ;
21
22
import org .junit .Test ;
22
23
import org .openqa .selenium .By ;
23
24
import org .openqa .selenium .WebElement ;
29
30
/**
30
31
* Class for testing issues in a spring-boot container.
31
32
*/
33
+ @ Ignore ("Ignored because of https://github.com/vaadin/flow/issues/9751" )
32
34
public class AppViewIT extends ChromeBrowserTest {
33
35
34
36
private void openTestUrl (String url ) {
@@ -38,6 +40,7 @@ private void openTestUrl(String url) {
38
40
private TestBenchElement testComponent ;
39
41
private WebElement content ;
40
42
43
+ @ Override
41
44
@ Before
42
45
public void setup () throws Exception {
43
46
super .setup ();
@@ -54,13 +57,15 @@ public void tearDown() {
54
57
*/
55
58
@ Test
56
59
public void should_load_web_component () {
57
- WebElement button = testComponent .$ (TestBenchElement .class ).id ("button" );
60
+ WebElement button = testComponent .$ (TestBenchElement .class )
61
+ .id ("button" );
58
62
button .click ();
59
63
verifyContent ("Hello World" );
60
64
}
61
65
62
66
/**
63
67
* Just a control test that assures that webcomponents is working.
68
+ *
64
69
* @throws Exception
65
70
*/
66
71
@ Test
@@ -73,9 +78,10 @@ public void should_request_connect_service() throws Exception {
73
78
}
74
79
75
80
@ Test
76
- public void should_request_packagePrivate_connect_service () throws Exception {
77
- WebElement button = testComponent .$ (TestBenchElement .class ).id (
78
- "helloFromPackagePrivate" );
81
+ public void should_request_packagePrivate_connect_service ()
82
+ throws Exception {
83
+ WebElement button = testComponent .$ (TestBenchElement .class )
84
+ .id ("helloFromPackagePrivate" );
79
85
button .click ();
80
86
81
87
// Wait for the server connect response
@@ -84,33 +90,35 @@ public void should_request_packagePrivate_connect_service() throws Exception {
84
90
85
91
@ Test
86
92
public void should_requestAnonymously_connect_service () throws Exception {
87
- WebElement button = testComponent .$ (TestBenchElement .class ). id (
88
- "helloAnonymous" );
93
+ WebElement button = testComponent .$ (TestBenchElement .class )
94
+ . id ( "helloAnonymous" );
89
95
button .click ();
90
96
91
97
// Wait for the server connect response
92
98
verifyContent ("Hello, stranger!" );
93
99
}
94
100
95
101
@ Test
96
- public void should_requestAnonymously_packagePrivate_connect_service () throws Exception {
97
- WebElement button = testComponent .$ (TestBenchElement .class ).id (
98
- "helloAnonymousFromPackagePrivate" );
102
+ public void should_requestAnonymously_packagePrivate_connect_service ()
103
+ throws Exception {
104
+ WebElement button = testComponent .$ (TestBenchElement .class )
105
+ .id ("helloAnonymousFromPackagePrivate" );
99
106
button .click ();
100
107
101
108
// Wait for the server connect response
102
109
verifyContent ("Hello from package private endpoint!" );
103
110
}
104
111
105
112
@ Test
106
- public void should_requestAnonymously_when_CallConnectServiceFromANestedUrl () throws Exception {
113
+ public void should_requestAnonymously_when_CallConnectServiceFromANestedUrl ()
114
+ throws Exception {
107
115
openTestUrl ("/more/levels/url" );
108
116
109
117
testComponent = $ ("test-component" ).first ();
110
118
content = testComponent .$ (TestBenchElement .class ).id ("content" );
111
119
112
- WebElement button = testComponent .$ (TestBenchElement .class ). id (
113
- "helloAnonymous" );
120
+ WebElement button = testComponent .$ (TestBenchElement .class )
121
+ . id ( "helloAnonymous" );
114
122
button .click ();
115
123
116
124
// Wait for the server connect response
@@ -119,8 +127,8 @@ public void should_requestAnonymously_when_CallConnectServiceFromANestedUrl() th
119
127
120
128
@ Test
121
129
public void should_useSendNull_when_paramterIsUndefined () {
122
- WebElement button = testComponent .$ (TestBenchElement .class ). id (
123
- "echoWithOptional" );
130
+ WebElement button = testComponent .$ (TestBenchElement .class )
131
+ . id ( "echoWithOptional" );
124
132
button .click ();
125
133
126
134
// Wait for the server connect response
@@ -198,6 +206,7 @@ public void should_checkUser() {
198
206
testComponent .$ (TestBenchElement .class ).id ("checkUser" ).click ();
199
207
verifyCheckUser ("user" );
200
208
}
209
+
201
210
@ Test
202
211
public void should_checkAdminUser () {
203
212
login ("admin" );
@@ -208,14 +217,15 @@ public void should_checkAdminUser() {
208
217
@ Test
209
218
public void should_checkUserFromVaadinRequest () {
210
219
login ("user" );
211
- testComponent .$ (TestBenchElement .class ).id ("checkUserFromVaadinRequest" ).click ();
220
+ testComponent .$ (TestBenchElement .class ).id ("checkUserFromVaadinRequest" )
221
+ .click ();
212
222
verifyCheckUserFromVaadinRequest ("user" );
213
223
}
214
224
215
225
@ Test
216
- public void should_updateTitleInDOMWithInjectedService (){
217
- Assert .assertEquals ("titleRetrievedFromAService" ,
218
- driver .findElement (By .tagName ("title" )).getAttribute ("textContent" ));
226
+ public void should_updateTitleInDOMWithInjectedService () {
227
+ Assert .assertEquals ("titleRetrievedFromAService" , driver
228
+ .findElement (By .tagName ("title" )).getAttribute ("textContent" ));
219
229
}
220
230
221
231
@ Test
@@ -230,8 +240,8 @@ public void should_requestAnonymously_after_logout() throws Exception {
230
240
Assert .assertNotEquals ("CSRF token should change for the new session" ,
231
241
originalCsrfToken , csrfToken );
232
242
233
- WebElement button = testComponent .$ (TestBenchElement .class ). id (
234
- "helloAnonymous" );
243
+ WebElement button = testComponent .$ (TestBenchElement .class )
244
+ . id ( "helloAnonymous" );
235
245
button .click ();
236
246
237
247
// Wait for the server connect response
@@ -278,7 +288,8 @@ private void verifyCheckUser(String expectedMessage) {
278
288
}
279
289
280
290
private void verifyCheckUserFromVaadinRequest (String expectedMessage ) {
281
- testComponent .$ (TestBenchElement .class ).id ("checkUserFromVaadinRequest" ).click ();
291
+ testComponent .$ (TestBenchElement .class ).id ("checkUserFromVaadinRequest" )
292
+ .click ();
282
293
verifyContent (expectedMessage );
283
294
}
284
295
0 commit comments