blob: 0008e78351239039e44c957af73ea627c4831e72 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
package com.vaadin.tests.components.upload;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.UploadElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
public class UploadHtmlCaptionTest extends MultiBrowserTest {
@Test
public void htmlCaptionToggle() {
openTestURL();
UploadElement upload = $(UploadElement.class).first();
WebElement submitButtonCaption = upload
.findElement(By.className("v-button-caption"));
WebElement componentCaption = findElement(By.className("v-caption"));
ButtonElement toggleButtonCaption = $(ButtonElement.class)
.id("toggleButtonCaption");
ButtonElement toggleComponentCaption = $(ButtonElement.class)
.id("toggleComponentCaption");
assertTrue(
"Unexpected submit button caption: "
+ submitButtonCaption.getText(),
submitButtonCaption.getText().contains("<b>"));
assertTrue(
"Unexpected component caption: " + componentCaption.getText(),
componentCaption.getText().contains("<b>"));
toggleButtonCaption.click();
assertFalse(
"Unexpected submit button caption: "
+ submitButtonCaption.getText(),
submitButtonCaption.getText().contains("<b>"));
assertTrue(
"Unexpected component caption: " + componentCaption.getText(),
componentCaption.getText().contains("<b>"));
toggleComponentCaption.click();
assertFalse(
"Unexpected submit button caption: "
+ submitButtonCaption.getText(),
submitButtonCaption.getText().contains("<b>"));
assertFalse(
"Unexpected component caption: " + componentCaption.getText(),
componentCaption.getText().contains("<b>"));
toggleButtonCaption.click();
assertTrue(
"Unexpected submit button caption: "
+ submitButtonCaption.getText(),
submitButtonCaption.getText().contains("<b>"));
assertFalse(
"Unexpected component caption: " + componentCaption.getText(),
componentCaption.getText().contains("<b>"));
}
}
|