├── vaadin-testbench-integration-tests ├── .dtrackignore ├── reference-screenshots │ ├── button4_mac_Safari_15.png │ ├── layout_any_firefox_96.png │ ├── layout_mac_Safari_15.png │ ├── layout_windows_msedge_97.png │ ├── button4_windows_chrome_126.png │ ├── button4_windows_chrome_132.png │ ├── button4_windows_firefox_102.png │ ├── button4_windows_msedge_97.png │ ├── layout_windows_chrome_126.png │ ├── layout_windows_chrome_132.png │ └── layout_windows_firefox_102.png ├── config │ └── template_testbench.properties └── src │ ├── test │ └── java │ │ └── com │ │ └── vaadin │ │ └── tests │ │ ├── elements │ │ ├── TemplateViewElement.java │ │ ├── NativeButtonElement.java │ │ ├── LabelPlaceholderElement.java │ │ └── ExecuteJavascriptIT.java │ │ ├── MyComponentWithIdElement.java │ │ ├── CustomGridElement.java │ │ ├── CustomTreeGridElement.java │ │ ├── MyComponentWithClassesElement.java │ │ ├── SVGIT.java │ │ └── TB6TestBrowserFactory.java │ └── main │ ├── java │ └── com │ │ └── vaadin │ │ └── testUI │ │ ├── MyComponentWithId.java │ │ ├── CustomGrid.java │ │ ├── CustomTreeGrid.java │ │ ├── MyComponentWithClasses.java │ │ ├── PerformanceView.java │ │ ├── LabelPlaceholder.java │ │ ├── PageObjectView.java │ │ └── SVGView.java │ └── frontend │ └── label-placeholder.ts ├── vaadin-testbench-integration-tests-junit5 ├── .dtrackignore ├── reference-screenshots │ ├── layout_mac_Safari_15.png │ ├── button4_mac_Safari_15.png │ ├── layout_any_firefox_96.png │ ├── button4_windows_msedge_97.png │ ├── layout_windows_chrome_103.png │ ├── layout_windows_msedge_97.png │ ├── button4_windows_chrome_103.png │ ├── button4_windows_firefox_102.png │ └── layout_windows_firefox_102.png ├── vite.config.ts ├── config │ └── template_testbench.properties └── src │ ├── test │ └── java │ │ └── com │ │ └── vaadin │ │ └── tests │ │ ├── elements │ │ ├── TemplateViewElement.java │ │ ├── NativeButtonElement.java │ │ ├── LabelPlaceholderElement.java │ │ └── ExecuteJavascriptIT.java │ │ ├── MyComponentWithIdElement.java │ │ ├── MyComponentWithClassesElement.java │ │ ├── AbstractSeleniumChromeTB9Test.java │ │ ├── SVGIT.java │ │ └── TB9TestBrowserFactory.java │ └── main │ ├── java │ └── com │ │ └── vaadin │ │ └── testUI │ │ ├── MyComponentWithId.java │ │ ├── MyComponentWithClasses.java │ │ ├── PageObjectView.java │ │ ├── PerformanceView.java │ │ ├── LabelPlaceholder.java │ │ ├── ParameterizedView.java │ │ └── SVGView.java │ └── resources │ └── META-INF │ └── resources │ └── frontend │ └── label-placeholder.ts ├── vaadin-testbench-unit └── src │ └── test │ ├── webapp │ └── VAADIN │ │ └── themes │ │ └── default │ │ └── img │ │ └── 1.txt │ ├── resources │ └── META-INF │ │ └── services │ │ └── com.vaadin.flow.server.VaadinServiceInitListener │ ├── java │ └── com │ │ ├── example │ │ ├── base │ │ │ ├── ParentView.java │ │ │ ├── child │ │ │ │ └── ChildView.java │ │ │ ├── HelloWorldView.java │ │ │ ├── WelcomeView.java │ │ │ ├── ParametrizedView.java │ │ │ └── ErrorView.java │ │ ├── SingleParam.java │ │ └── TemplatedParam.java │ │ ├── vaadin │ │ └── testbench │ │ │ └── unit │ │ │ ├── viewscan4 │ │ │ └── byannotatedclass │ │ │ │ ├── ViewPackagesTest4View.java │ │ │ │ └── DiscoverRoutesInAnnotatedClassPackageTest.java │ │ │ └── TestCustomInstantiatorFactory.java │ │ └── testapp │ │ ├── security │ │ ├── LoginView.java │ │ └── ProtectedView.java │ │ └── MyRouteNotFoundError.java │ └── kotlin │ └── com │ └── vaadin │ └── testbench │ └── unit │ ├── mocks │ └── Utils.kt │ ├── internal │ ├── AttachedTextField.kt │ └── CompositeTest.kt │ └── TestInitListener.kt ├── vaadin-testbench-unit-junit5 └── src │ └── test │ ├── webapp │ └── VAADIN │ │ └── themes │ │ └── default │ │ └── img │ │ └── 1.txt │ ├── resources │ ├── META-INF │ │ └── services │ │ │ └── com.vaadin.flow.server.VaadinServiceInitListener │ └── vaadin-featureflags.properties │ ├── java │ └── com │ │ ├── vaadin │ │ ├── testbench │ │ │ └── unit │ │ │ │ ├── TestComponent.java │ │ │ │ ├── TestComponentForConcreteTester.java │ │ │ │ ├── viewscan │ │ │ │ └── byannotatedclass │ │ │ │ │ └── ViewPackagesTestView.java │ │ │ │ ├── TestTester.java │ │ │ │ ├── NonGenericTestTester.java │ │ │ │ └── TestCustomInstantiatorFactory.java │ │ └── flow │ │ │ └── component │ │ │ ├── html │ │ │ └── testbench │ │ │ │ ├── AnchorView.java │ │ │ │ └── RangeInputView.java │ │ │ ├── notification │ │ │ └── NotificationView.java │ │ │ ├── routerlink │ │ │ ├── AbstractTargetView.java │ │ │ ├── RouterLinkStaticTargetView.java │ │ │ └── RouterLinkUrlParameterTargetView.java │ │ │ ├── button │ │ │ └── ButtonView.java │ │ │ ├── grid │ │ │ ├── CheckBox.java │ │ │ ├── Country.java │ │ │ └── BeanGridView.java │ │ │ ├── datepicker │ │ │ └── DatePickerView.java │ │ │ ├── timepicker │ │ │ └── TimePickerView.java │ │ │ ├── confirmdialog │ │ │ └── ConfirmDialogView.java │ │ │ ├── textfield │ │ │ ├── TextAreaView.java │ │ │ ├── TextFieldView.java │ │ │ └── NumberFieldView.java │ │ │ ├── datetimepicker │ │ │ └── DateTimePickerView.java │ │ │ ├── dialog │ │ │ └── DialogView.java │ │ │ ├── upload │ │ │ ├── UploadView.java │ │ │ └── UploadDeprecatedAPIView.java │ │ │ ├── tabs │ │ │ ├── TabsView.java │ │ │ └── TabSheetView.java │ │ │ ├── details │ │ │ └── DetailsView.java │ │ │ ├── sidenav │ │ │ └── TargetView.java │ │ │ └── listbox │ │ │ └── ListBoxView.java │ │ ├── example │ │ ├── base │ │ │ ├── ParentView.java │ │ │ ├── child │ │ │ │ └── ChildView.java │ │ │ ├── HelloWorldView.java │ │ │ ├── WelcomeView.java │ │ │ ├── ParametrizedView.java │ │ │ └── ErrorView.java │ │ ├── SingleParam.java │ │ └── TemplatedParam.java │ │ └── testapp │ │ ├── security │ │ ├── LoginView.java │ │ └── ProtectedView.java │ │ └── MyRouteNotFoundError.java │ └── kotlin │ └── com │ └── vaadin │ └── testbench │ └── unit │ ├── mocks │ └── Utils.kt │ ├── internal │ ├── AttachedTextField.kt │ └── CompositeTest.kt │ └── TestInitListener.kt ├── README.resources └── JUnit-Configuration-Template.png ├── LICENSE ├── eclipse └── flow.importorder ├── vaadin-testbench-core └── src │ ├── test │ ├── resources │ │ └── com │ │ │ └── vaadin │ │ │ └── testbench │ │ │ └── screenshot │ │ │ ├── 11.png │ │ │ ├── 111.png │ │ │ ├── red.png │ │ │ ├── black.png │ │ │ ├── white.png │ │ │ ├── text-red.png │ │ │ ├── big-image.png │ │ │ ├── cursor-off.png │ │ │ ├── cursor-on.png │ │ │ ├── cursor3-new.png │ │ │ ├── cursor3-ref.png │ │ │ ├── text-blue.png │ │ │ ├── big-image-ss.png │ │ │ ├── purple-border.png │ │ │ ├── 16x16-reference.png │ │ │ ├── 16x16-screenshot.png │ │ │ ├── 17x17-similar-26.png │ │ │ ├── 17x17-similar-31.png │ │ │ ├── masking │ │ │ ├── google1.png │ │ │ ├── google2.png │ │ │ ├── google3.png │ │ │ ├── blank-mask.png │ │ │ ├── google1-masked.png │ │ │ └── google1-masked2.png │ │ │ ├── no-outline-cursor.png │ │ │ ├── outline-no-cursor.png │ │ │ ├── screenshot1008x767.png │ │ │ ├── cursor-bottom-edge-on.png │ │ │ ├── cursor-right-edge-off.png │ │ │ ├── cursor-right-edge-on.png │ │ │ ├── cursor2-on-outline-on.png │ │ │ ├── cursor-bottom-edge-off.png │ │ │ ├── cursor-bottom-right-off.png │ │ │ ├── cursor-bottom-right-on.png │ │ │ ├── cursor2-off-outline-off.png │ │ │ ├── cursor2-off-outline-on.png │ │ │ ├── cursor2-on-outline-off.png │ │ │ ├── purple-border-top-left.png │ │ │ ├── reference │ │ │ └── reference738x624.png │ │ │ ├── cursor-like-diff-at-0x15-new.png │ │ │ ├── cursor-like-diff-at-0x15-ref.png │ │ │ ├── cursor-right-edge-overlap-on.png │ │ │ ├── cursor-on-with-minor-difference.png │ │ │ ├── cursor-right-edge-overlap-off.png │ │ │ ├── white-33x33-cursor-15x1-cursoroff.png │ │ │ ├── white-33x33-cursor-15x1-cursoron.png │ │ │ ├── white-33x33-cursor-15x16-cursoron.png │ │ │ ├── white-33x33-cursor-15x17-cursoron.png │ │ │ ├── white-33x33-cursor-15x16-cursoroff.png │ │ │ └── white-33x33-cursor-15x17-cursoroff.png │ └── java │ │ └── com │ │ └── vaadin │ │ └── testbench │ │ ├── testutils │ │ └── ParentRetryRule.java │ │ ├── RetryRuleTestbenchTest.java │ │ ├── ParentRetryRuleTest.java │ │ ├── RetryRuleAfterTest.java │ │ ├── RetryRuleBeforeTest.java │ │ ├── RetryRuleTestbenchWithParameterTest.java │ │ └── IPAddressTest.java │ └── main │ └── resources │ └── com │ └── vaadin │ └── testbench │ └── testbench.properties ├── vaadin-testbench-core-junit5 └── src │ ├── test │ ├── resources │ │ └── com │ │ │ └── vaadin │ │ │ └── testbench │ │ │ └── screenshot │ │ │ ├── 11.png │ │ │ ├── 111.png │ │ │ ├── red.png │ │ │ ├── black.png │ │ │ ├── white.png │ │ │ ├── big-image.png │ │ │ ├── cursor-on.png │ │ │ ├── text-blue.png │ │ │ ├── text-red.png │ │ │ ├── cursor-off.png │ │ │ ├── cursor3-new.png │ │ │ ├── cursor3-ref.png │ │ │ ├── big-image-ss.png │ │ │ ├── purple-border.png │ │ │ ├── 16x16-reference.png │ │ │ ├── 16x16-screenshot.png │ │ │ ├── 17x17-similar-26.png │ │ │ ├── 17x17-similar-31.png │ │ │ ├── masking │ │ │ ├── google1.png │ │ │ ├── google2.png │ │ │ ├── google3.png │ │ │ ├── blank-mask.png │ │ │ ├── google1-masked.png │ │ │ └── google1-masked2.png │ │ │ ├── no-outline-cursor.png │ │ │ ├── outline-no-cursor.png │ │ │ ├── screenshot1008x767.png │ │ │ ├── cursor-bottom-edge-on.png │ │ │ ├── cursor-right-edge-off.png │ │ │ ├── cursor-right-edge-on.png │ │ │ ├── cursor2-on-outline-on.png │ │ │ ├── cursor-bottom-edge-off.png │ │ │ ├── cursor-bottom-right-off.png │ │ │ ├── cursor-bottom-right-on.png │ │ │ ├── cursor2-off-outline-off.png │ │ │ ├── cursor2-off-outline-on.png │ │ │ ├── cursor2-on-outline-off.png │ │ │ ├── purple-border-top-left.png │ │ │ ├── reference │ │ │ └── reference738x624.png │ │ │ ├── cursor-like-diff-at-0x15-new.png │ │ │ ├── cursor-like-diff-at-0x15-ref.png │ │ │ ├── cursor-right-edge-overlap-off.png │ │ │ ├── cursor-right-edge-overlap-on.png │ │ │ ├── cursor-on-with-minor-difference.png │ │ │ ├── white-33x33-cursor-15x1-cursoroff.png │ │ │ ├── white-33x33-cursor-15x1-cursoron.png │ │ │ ├── white-33x33-cursor-15x16-cursoroff.png │ │ │ ├── white-33x33-cursor-15x16-cursoron.png │ │ │ ├── white-33x33-cursor-15x17-cursoroff.png │ │ │ └── white-33x33-cursor-15x17-cursoron.png │ └── java │ │ └── com │ │ └── vaadin │ │ └── testbench │ │ ├── IPAddressTest.java │ │ └── browser │ │ └── ParameterizedBrowserTestSingleBrowserFromBrowserConfigurationTest.java │ └── main │ ├── resources │ ├── junit-platform.properties │ └── com │ │ └── vaadin │ │ └── testbench │ │ └── testbench.properties │ └── java │ └── com │ └── vaadin │ └── testbench │ ├── DriverSupplier.java │ ├── BrowserTestClass.java │ ├── BrowserTest.java │ └── browser │ └── BrowserTestInfo.java ├── src └── license │ └── vclst │ └── header.txt ├── .dtrack.yml ├── vaadin-testbench-unit-shared └── src │ └── main │ ├── resources │ └── com │ │ └── vaadin │ │ └── testbench │ │ └── unit │ │ └── testbench.properties │ ├── java │ └── com │ │ └── vaadin │ │ ├── flow │ │ └── component │ │ │ ├── html │ │ │ └── testbench │ │ │ │ ├── H2Tester.java │ │ │ │ ├── H3Tester.java │ │ │ │ ├── H4Tester.java │ │ │ │ ├── H5Tester.java │ │ │ │ ├── H6Tester.java │ │ │ │ ├── HrTester.java │ │ │ │ ├── DivTester.java │ │ │ │ ├── H1Tester.java │ │ │ │ ├── PreTester.java │ │ │ │ ├── HtmlClickContainer.java │ │ │ │ ├── ImageTester.java │ │ │ │ ├── SpanTester.java │ │ │ │ ├── EmphasisTester.java │ │ │ │ ├── ListItemTester.java │ │ │ │ ├── ParagraphTester.java │ │ │ │ ├── NativeLabelTester.java │ │ │ │ ├── NativeButtonTester.java │ │ │ │ └── HtmlContainerTester.java │ │ │ ├── login │ │ │ └── LoginFormTester.java │ │ │ ├── button │ │ │ └── ButtonTester.java │ │ │ └── dialog │ │ │ └── DialogTester.java │ │ └── testbench │ │ └── unit │ │ ├── UIUnitTestSetupException.java │ │ ├── mocks │ │ └── SpringSecurityRequestCustomizer.java │ │ ├── CommercialTesterWrappers.java │ │ ├── Tests.java │ │ ├── ComponentTesterPackages.java │ │ └── MouseButton.java │ └── kotlin │ └── com │ └── vaadin │ └── testbench │ └── unit │ └── mocks │ └── MockVaadinSession.kt ├── vaadin-testbench-unit-quarkus └── src │ └── test │ └── java │ └── com │ ├── example │ └── base │ │ ├── DummyService.java │ │ ├── HelloWorldView.java │ │ └── WelcomeView.java │ └── testapp │ └── security │ ├── LoginView.java │ ├── ProtectedView.java │ ├── RoleRestrictedView.java │ └── AnyRoleView.java ├── .gitignore ├── vaadin-testbench-shared └── src │ └── main │ └── java │ └── com │ └── vaadin │ └── testbench │ ├── HasLabelAsText.java │ ├── HasStringValueProperty.java │ ├── HasPlaceholder.java │ ├── parallel │ ├── TestNameSuffix.java │ ├── ExcludeFromSuite.java │ └── Browser.java │ ├── HasCallFunction.java │ ├── HasDriver.java │ ├── HasLabel.java │ ├── HasSelectByText.java │ ├── HasSearchContext.java │ ├── HasTestBenchCommandExecutor.java │ ├── elementsbase │ └── Element.java │ └── annotations │ └── RunOnHub.java ├── testing-support ├── uiunit-test-components │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── vaadin │ │ └── testbench │ │ └── dontscan │ │ ├── noclassdeffound │ │ └── NoClassDefFoundComponent.java │ │ └── typenotpresent │ │ └── TypeNotPresentComponent.java └── uiunit-component-testers │ └── src │ └── main │ └── java │ └── com │ └── vaadin │ └── testbench │ └── dontscan │ ├── noclassdeffound │ └── NoClassDefFoundComponentTester.java │ └── typenotpresent │ └── TypeNotPresentComponentTester.java └── .github └── workflows └── check-permissions.yml /vaadin-testbench-integration-tests/.dtrackignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/.dtrackignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/webapp/VAADIN/themes/default/img/1.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/webapp/VAADIN/themes/default/img/1.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.resources/JUnit-Configuration-Template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/README.resources/JUnit-Configuration-Template.png -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/resources/META-INF/services/com.vaadin.flow.server.VaadinServiceInitListener: -------------------------------------------------------------------------------- 1 | com.vaadin.testbench.unit.TestInitListener 2 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/resources/META-INF/services/com.vaadin.flow.server.VaadinServiceInitListener: -------------------------------------------------------------------------------- 1 | com.vaadin.testbench.unit.TestInitListener 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This program is available under Vaadin Commercial License and Service Terms. 2 | See https://vaadin.com/commercial-license-and-service-terms for the full 3 | license. 4 | -------------------------------------------------------------------------------- /eclipse/flow.importorder: -------------------------------------------------------------------------------- 1 | #Organize Import Order 2 | #Fri Nov 10 13:24:02 EET 2017 3 | 7=\# 4 | 6=elemental 5 | 5=com.vaadin 6 | 4=com.google.gwt 7 | 3= 8 | 2=java 9 | 1=javax 10 | 0=jakarta 11 | -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/11.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/111.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/111.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/red.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/black.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/white.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/reference-screenshots/button4_mac_Safari_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests/reference-screenshots/button4_mac_Safari_15.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/reference-screenshots/layout_any_firefox_96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests/reference-screenshots/layout_any_firefox_96.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/reference-screenshots/layout_mac_Safari_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests/reference-screenshots/layout_mac_Safari_15.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/text-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/text-red.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/reference-screenshots/layout_windows_msedge_97.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests/reference-screenshots/layout_windows_msedge_97.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/11.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/111.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/111.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/red.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/big-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/big-image.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-off.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-on.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor3-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor3-new.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor3-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor3-ref.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/text-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/text-blue.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/reference-screenshots/layout_mac_Safari_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests-junit5/reference-screenshots/layout_mac_Safari_15.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/reference-screenshots/button4_windows_chrome_126.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests/reference-screenshots/button4_windows_chrome_126.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/reference-screenshots/button4_windows_chrome_132.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests/reference-screenshots/button4_windows_chrome_132.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/reference-screenshots/button4_windows_firefox_102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests/reference-screenshots/button4_windows_firefox_102.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/reference-screenshots/button4_windows_msedge_97.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests/reference-screenshots/button4_windows_msedge_97.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/reference-screenshots/layout_windows_chrome_126.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests/reference-screenshots/layout_windows_chrome_126.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/reference-screenshots/layout_windows_chrome_132.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests/reference-screenshots/layout_windows_chrome_132.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/reference-screenshots/layout_windows_firefox_102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests/reference-screenshots/layout_windows_firefox_102.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/black.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/white.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/big-image-ss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/big-image-ss.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/purple-border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/purple-border.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/reference-screenshots/button4_mac_Safari_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests-junit5/reference-screenshots/button4_mac_Safari_15.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/reference-screenshots/layout_any_firefox_96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests-junit5/reference-screenshots/layout_any_firefox_96.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/big-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/big-image.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-on.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/text-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/text-blue.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/text-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/text-red.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/16x16-reference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/16x16-reference.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/16x16-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/16x16-screenshot.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/17x17-similar-26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/17x17-similar-26.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/17x17-similar-31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/17x17-similar-31.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/masking/google1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/masking/google1.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/masking/google2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/masking/google2.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/masking/google3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/masking/google3.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/reference-screenshots/button4_windows_msedge_97.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests-junit5/reference-screenshots/button4_windows_msedge_97.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/reference-screenshots/layout_windows_chrome_103.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests-junit5/reference-screenshots/layout_windows_chrome_103.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/reference-screenshots/layout_windows_msedge_97.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests-junit5/reference-screenshots/layout_windows_msedge_97.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-off.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor3-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor3-new.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor3-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor3-ref.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/masking/blank-mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/masking/blank-mask.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/no-outline-cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/no-outline-cursor.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/outline-no-cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/outline-no-cursor.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/screenshot1008x767.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/screenshot1008x767.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/reference-screenshots/button4_windows_chrome_103.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests-junit5/reference-screenshots/button4_windows_chrome_103.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/reference-screenshots/button4_windows_firefox_102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests-junit5/reference-screenshots/button4_windows_firefox_102.png -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/reference-screenshots/layout_windows_firefox_102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-integration-tests-junit5/reference-screenshots/layout_windows_firefox_102.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/big-image-ss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/big-image-ss.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/purple-border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/purple-border.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-bottom-edge-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-bottom-edge-on.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-right-edge-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-right-edge-off.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-right-edge-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-right-edge-on.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor2-on-outline-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor2-on-outline-on.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/16x16-reference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/16x16-reference.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/16x16-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/16x16-screenshot.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/17x17-similar-26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/17x17-similar-26.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/17x17-similar-31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/17x17-similar-31.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/masking/google1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/masking/google1.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/masking/google2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/masking/google2.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/masking/google3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/masking/google3.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-bottom-edge-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-bottom-edge-off.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-bottom-right-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-bottom-right-off.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-bottom-right-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-bottom-right-on.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor2-off-outline-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor2-off-outline-off.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor2-off-outline-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor2-off-outline-on.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor2-on-outline-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor2-on-outline-off.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/masking/google1-masked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/masking/google1-masked.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/masking/google1-masked2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/masking/google1-masked2.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/purple-border-top-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/purple-border-top-left.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/masking/blank-mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/masking/blank-mask.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/no-outline-cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/no-outline-cursor.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/outline-no-cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/outline-no-cursor.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/screenshot1008x767.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/screenshot1008x767.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/reference/reference738x624.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/reference/reference738x624.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-bottom-edge-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-bottom-edge-on.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-right-edge-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-right-edge-off.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-right-edge-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-right-edge-on.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor2-on-outline-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor2-on-outline-on.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-like-diff-at-0x15-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-like-diff-at-0x15-new.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-like-diff-at-0x15-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-like-diff-at-0x15-ref.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-right-edge-overlap-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-right-edge-overlap-on.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-bottom-edge-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-bottom-edge-off.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-bottom-right-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-bottom-right-off.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-bottom-right-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-bottom-right-on.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor2-off-outline-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor2-off-outline-off.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor2-off-outline-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor2-off-outline-on.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor2-on-outline-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor2-on-outline-off.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/masking/google1-masked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/masking/google1-masked.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/masking/google1-masked2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/masking/google1-masked2.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/purple-border-top-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/purple-border-top-left.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-on-with-minor-difference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-on-with-minor-difference.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-right-edge-overlap-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/cursor-right-edge-overlap-off.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/reference/reference738x624.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/reference/reference738x624.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x1-cursoroff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x1-cursoroff.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x1-cursoron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x1-cursoron.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x16-cursoron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x16-cursoron.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x17-cursoron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x17-cursoron.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-like-diff-at-0x15-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-like-diff-at-0x15-new.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-like-diff-at-0x15-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-like-diff-at-0x15-ref.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-right-edge-overlap-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-right-edge-overlap-off.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-right-edge-overlap-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-right-edge-overlap-on.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x16-cursoroff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x16-cursoroff.png -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x17-cursoroff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x17-cursoroff.png -------------------------------------------------------------------------------- /src/license/vclst/header.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-$YEAR Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-on-with-minor-difference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/cursor-on-with-minor-difference.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x1-cursoroff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x1-cursoroff.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x1-cursoron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x1-cursoron.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x16-cursoroff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x16-cursoroff.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x16-cursoron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x16-cursoron.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x17-cursoroff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x17-cursoroff.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x17-cursoron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/testbench/HEAD/vaadin-testbench-core-junit5/src/test/resources/com/vaadin/testbench/screenshot/white-33x33-cursor-15x17-cursoron.png -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/main/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | junit.jupiter.execution.parallel.enabled = true 2 | junit.jupiter.execution.parallel.config.strategy = custom 3 | junit.jupiter.execution.parallel.config.custom.class = com.vaadin.testbench.parallel.ParallelConfigurationStrategy -------------------------------------------------------------------------------- /.dtrack.yml: -------------------------------------------------------------------------------- 1 | # Specifies which previous versions should be kept in Dependency-Track when 2 | # a new version is uploaded. 3 | # Possible values: NONE/MAJOR/MINOR/PATCH/SUFFIX/BUILD 4 | # 5 | # Also available as dtrack.keepPreviousVersions property/environment variable 6 | keepPreviousVersions: MAJOR 7 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { UserConfigFn } from 'vite'; 2 | import { overrideVaadinConfig } from './vite.generated'; 3 | 4 | const customConfig: UserConfigFn = (env) => ({ 5 | // Here you can add custom Vite parameters 6 | // https://vitejs.dev/config/ 7 | }); 8 | 9 | export default overrideVaadinConfig(customConfig); 10 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/resources/vaadin-featureflags.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2025 Vaadin Ltd 3 | # 4 | # This program is available under Vaadin Commercial License and Service Terms. 5 | # 6 | # See for the full 7 | # license. 8 | # 9 | 10 | com.vaadin.experimental.flowFullstackSignals=true -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/resources/com/vaadin/testbench/unit/testbench.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2022 Vaadin Ltd 3 | # 4 | # This program is available under Vaadin Commercial License and Service Terms. 5 | # 6 | # 7 | # See for the full 8 | # license. 9 | # 10 | 11 | testbench.version=${version} 12 | -------------------------------------------------------------------------------- /vaadin-testbench-core/src/main/resources/com/vaadin/testbench/testbench.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2022 Vaadin Ltd 3 | # 4 | # This program is available under Vaadin Commercial License and Service Terms. 5 | # 6 | # 7 | # See for the full 8 | # license. 9 | # 10 | 11 | testbench.version=${version} 12 | selenium.version=${selenium.version} 13 | -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/main/resources/com/vaadin/testbench/testbench.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2022 Vaadin Ltd 3 | # 4 | # This program is available under Vaadin Commercial License and Service Terms. 5 | # 6 | # 7 | # See for the full 8 | # license. 9 | # 10 | 11 | testbench.version=${version} 12 | selenium.version=${selenium.version} 13 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-quarkus/src/test/java/com/example/base/DummyService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.example.base; 10 | 11 | import jakarta.enterprise.context.ApplicationScoped; 12 | 13 | @ApplicationScoped 14 | public class DummyService { 15 | } 16 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/config/template_testbench.properties: -------------------------------------------------------------------------------- 1 | ; 2 | ; This is an example property file showing how to control how TestBench4. 3 | You should not modify this file since it's 4 | ; under version control. Instead, create a copy of it and name testbench.properties. 5 | 6 | ; Path to firefox exe 7 | firefox.path=/path/firefox 8 | ; Path to firefox profile 9 | firefox.profile.path=/path/profile_name 10 | ; Path to Chrome driver 11 | chrome.driver.path=/path/chromedriver 12 | 13 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/config/template_testbench.properties: -------------------------------------------------------------------------------- 1 | # 2 | # This is an example property file showing how to control how TestBench4. 3 | # You should not modify this file since it's 4 | # under version control. Instead, create a copy of it and name testbench.properties. 5 | 6 | # Path to firefox exe 7 | firefox.path=/path/firefox 8 | # Path to firefox profile 9 | firefox.profile.path=/path/profile_name 10 | # Path to Chrome driver 11 | chrome.driver.path=/path/chromedriver 12 | 13 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/testbench/unit/TestComponent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.unit; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.Tag; 13 | 14 | @Tag("span") 15 | public class TestComponent extends Component { 16 | } 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # / 2 | .classpath 3 | *.project 4 | *.settings 5 | **/bin 6 | **/target 7 | **/error-screenshots 8 | 9 | # Mac 10 | *.DS_Store 11 | 12 | # Intellij Idea files 13 | .idea 14 | *.iml 15 | 16 | # VS Code 17 | .vscode 18 | 19 | # Selenium driver folders 20 | selenium_standalone_zips 21 | driver_zips 22 | driver 23 | 24 | types.d.ts 25 | tsconfig.json 26 | webpack.* 27 | node_modules 28 | .driver 29 | package*json 30 | pnpm* 31 | error-screenshots 32 | .npmrc 33 | 34 | **/frontend/generated 35 | **/frontend/index.html 36 | 37 | **/vite.generated.ts 38 | -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/java/com/vaadin/testbench/testutils/ParentRetryRule.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.testutils; 10 | 11 | import org.junit.Rule; 12 | 13 | import com.vaadin.testbench.RetryRule; 14 | 15 | public class ParentRetryRule { 16 | @Rule 17 | public RetryRule retry = new RetryRule(1); 18 | } 19 | -------------------------------------------------------------------------------- /vaadin-testbench-shared/src/main/java/com/vaadin/testbench/HasLabelAsText.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench; 10 | 11 | import org.openqa.selenium.WebElement; 12 | 13 | /** 14 | * Implemented by elements which support a label via its text, such as buttons. 15 | */ 16 | public interface HasLabelAsText extends WebElement { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/testbench/unit/TestComponentForConcreteTester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.unit; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.Tag; 13 | 14 | @Tag("span") 15 | public class TestComponentForConcreteTester extends Component { 16 | } 17 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/test/java/com/vaadin/tests/elements/TemplateViewElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests.elements; 10 | 11 | import com.vaadin.testbench.TestBenchElement; 12 | import com.vaadin.testbench.elementsbase.Element; 13 | 14 | @Element("template-view") 15 | public class TemplateViewElement extends TestBenchElement { 16 | } 17 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/elements/TemplateViewElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests.elements; 10 | 11 | import com.vaadin.testbench.TestBenchElement; 12 | import com.vaadin.testbench.elementsbase.Element; 13 | 14 | @Element("template-view") 15 | public class TemplateViewElement extends TestBenchElement { 16 | } 17 | -------------------------------------------------------------------------------- /testing-support/uiunit-test-components/src/main/java/com/vaadin/testbench/dontscan/noclassdeffound/NoClassDefFoundComponent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.dontscan.noclassdeffound; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.Tag; 13 | 14 | @Tag("span") 15 | public class NoClassDefFoundComponent extends Component { 16 | } 17 | -------------------------------------------------------------------------------- /testing-support/uiunit-test-components/src/main/java/com/vaadin/testbench/dontscan/typenotpresent/TypeNotPresentComponent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.dontscan.typenotpresent; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.Tag; 13 | 14 | @Tag("span") 15 | public class TypeNotPresentComponent extends Component { 16 | } 17 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/java/com/example/base/ParentView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.example.base; 10 | 11 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 12 | import com.vaadin.flow.router.RoutePrefix; 13 | import com.vaadin.flow.router.RouterLayout; 14 | 15 | @RoutePrefix("parent") 16 | public class ParentView extends VerticalLayout implements RouterLayout { 17 | } 18 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/main/java/com/vaadin/testUI/MyComponentWithId.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testUI; 10 | 11 | import com.vaadin.flow.component.html.Div; 12 | 13 | public class MyComponentWithId extends Div { 14 | 15 | public MyComponentWithId() { 16 | setId("my-component-with-id"); 17 | setText(getClass().getSimpleName()); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/test/java/com/vaadin/tests/MyComponentWithIdElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests; 10 | 11 | import com.vaadin.testbench.TestBenchElement; 12 | import com.vaadin.testbench.annotations.Attribute; 13 | 14 | @Attribute(name = "id", value = Attribute.SIMPLE_CLASS_NAME) 15 | public class MyComponentWithIdElement extends TestBenchElement { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/main/java/com/vaadin/testUI/MyComponentWithId.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testUI; 10 | 11 | import com.vaadin.flow.component.html.Div; 12 | 13 | public class MyComponentWithId extends Div { 14 | 15 | public MyComponentWithId() { 16 | setId("my-component-with-id"); 17 | setText(getClass().getSimpleName()); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/example/base/ParentView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.example.base; 10 | 11 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 12 | import com.vaadin.flow.router.RoutePrefix; 13 | import com.vaadin.flow.router.RouterLayout; 14 | 15 | @RoutePrefix("parent") 16 | public class ParentView extends VerticalLayout implements RouterLayout { 17 | } 18 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/MyComponentWithIdElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests; 10 | 11 | import com.vaadin.testbench.TestBenchElement; 12 | import com.vaadin.testbench.annotations.Attribute; 13 | 14 | @Attribute(name = "id", value = Attribute.SIMPLE_CLASS_NAME) 15 | public class MyComponentWithIdElement extends TestBenchElement { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/test/java/com/vaadin/tests/CustomGridElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests; 10 | 11 | import com.vaadin.testbench.TestBenchElement; 12 | import com.vaadin.testbench.annotations.Attribute; 13 | 14 | @Attribute(name = "hierarchical", exists = false) 15 | @Attribute(name = "grid-element") 16 | public class CustomGridElement extends TestBenchElement { 17 | } 18 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/java/com/example/base/child/ChildView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.example.base.child; 10 | 11 | import com.example.base.ParentView; 12 | 13 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 14 | import com.vaadin.flow.router.Route; 15 | 16 | @Route(value = "child", layout = ParentView.class) 17 | public class ChildView extends VerticalLayout { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/test/java/com/vaadin/tests/CustomTreeGridElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests; 10 | 11 | import com.vaadin.testbench.TestBenchElement; 12 | import com.vaadin.testbench.annotations.Attribute; 13 | 14 | @Attribute(name = "hierarchical", exists = true) 15 | @Attribute(name = "grid-element") 16 | public class CustomTreeGridElement extends TestBenchElement { 17 | } 18 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/example/base/child/ChildView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.example.base.child; 10 | 11 | import com.example.base.ParentView; 12 | 13 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 14 | import com.vaadin.flow.router.Route; 15 | 16 | @Route(value = "child", layout = ParentView.class) 17 | public class ChildView extends VerticalLayout { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/html/testbench/AnchorView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.html.testbench; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.Tag; 13 | import com.vaadin.flow.router.Route; 14 | 15 | @Tag("a") 16 | @Route(value = "anchor", registerAtStartup = false) 17 | public class AnchorView extends Component { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/kotlin/com/vaadin/testbench/unit/mocks/Utils.kt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2022 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * 7 | * See for the full 8 | * license. 9 | */ 10 | package com.vaadin.testbench.unit.mocks 11 | 12 | import java.security.Principal 13 | 14 | data class MockPrincipal(private val name: String, val allowedRoles: List = listOf()) : Principal { 15 | override fun getName(): String = name 16 | 17 | fun isUserInRole(role: String): Boolean = allowedRoles.contains(role) 18 | } 19 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/kotlin/com/vaadin/testbench/unit/mocks/Utils.kt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2022 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * 7 | * See for the full 8 | * license. 9 | */ 10 | package com.vaadin.testbench.unit.mocks 11 | 12 | import java.security.Principal 13 | 14 | data class MockPrincipal(private val name: String, val allowedRoles: List = listOf()) : Principal { 15 | override fun getName(): String = name 16 | 17 | fun isUserInRole(role: String): Boolean = allowedRoles.contains(role) 18 | } 19 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/main/frontend/label-placeholder.ts: -------------------------------------------------------------------------------- 1 | import {html, LitElement} from 'lit'; 2 | import {customElement, property} from 'lit/decorators.js'; 3 | 4 | @customElement('label-placeholder') 5 | class LabelPlaceholder extends LitElement { 6 | @property({ type: String }) 7 | label!: string; 8 | 9 | @property({ type: String }) 10 | placeholder!: string; 11 | 12 | render() { 13 | return html` 14 |
15 |
${this.label}
16 |
${this.placeholder}
17 | 18 |
19 | `; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/main/java/com/vaadin/testUI/CustomGrid.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testUI; 10 | 11 | import com.vaadin.flow.component.html.Div; 12 | 13 | public class CustomGrid extends Div { 14 | public CustomGrid() { 15 | getElement().setAttribute("hierarchical", false); 16 | getElement().setAttribute("grid-element", true); 17 | setText(getClass().getSimpleName()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/kotlin/com/vaadin/testbench/unit/internal/AttachedTextField.kt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2022 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * 7 | * See for the full 8 | * license. 9 | */ 10 | 11 | package com.vaadin.testbench.unit.internal 12 | 13 | import com.vaadin.flow.component.textfield.TextField 14 | 15 | /** 16 | * TextField for testing which returns that it is attached. 17 | */ 18 | class AttachedTextField : TextField() { 19 | override fun isAttached(): Boolean { 20 | return true 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/test/java/com/vaadin/tests/elements/NativeButtonElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests.elements; 10 | 11 | import com.vaadin.testbench.HasLabelAsText; 12 | import com.vaadin.testbench.TestBenchElement; 13 | import com.vaadin.testbench.elementsbase.Element; 14 | 15 | @Element("button") 16 | public class NativeButtonElement extends TestBenchElement 17 | implements HasLabelAsText { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/notification/NotificationView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.notification; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.Tag; 13 | import com.vaadin.flow.router.Route; 14 | 15 | @Tag("div") 16 | @Route(value = "notification", registerAtStartup = false) 17 | public class NotificationView extends Component { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/testbench/unit/viewscan/byannotatedclass/ViewPackagesTestView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.unit.viewscan.byannotatedclass; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.Tag; 13 | import com.vaadin.flow.router.Route; 14 | 15 | @Tag("div") 16 | @Route("view-packages-test") 17 | public class ViewPackagesTestView extends Component { 18 | } 19 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/kotlin/com/vaadin/testbench/unit/internal/AttachedTextField.kt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2022 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * 7 | * See for the full 8 | * license. 9 | */ 10 | 11 | package com.vaadin.testbench.unit.internal 12 | 13 | import com.vaadin.flow.component.textfield.TextField 14 | 15 | /** 16 | * TextField for testing which returns that it is attached. 17 | */ 18 | class AttachedTextField : TextField() { 19 | override fun isAttached(): Boolean { 20 | return true 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/java/com/vaadin/testbench/unit/viewscan4/byannotatedclass/ViewPackagesTest4View.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.unit.viewscan4.byannotatedclass; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.Tag; 13 | import com.vaadin.flow.router.Route; 14 | 15 | @Tag("div") 16 | @Route("view-packages-test4") 17 | public class ViewPackagesTest4View extends Component { 18 | } 19 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/elements/NativeButtonElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests.elements; 10 | 11 | import com.vaadin.testbench.HasLabelAsText; 12 | import com.vaadin.testbench.TestBenchElement; 13 | import com.vaadin.testbench.elementsbase.Element; 14 | 15 | @Element("button") 16 | public class NativeButtonElement extends TestBenchElement 17 | implements HasLabelAsText { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/main/java/com/vaadin/testUI/CustomTreeGrid.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testUI; 10 | 11 | import com.vaadin.flow.component.html.Div; 12 | 13 | public class CustomTreeGrid extends Div { 14 | public CustomTreeGrid() { 15 | getElement().setAttribute("hierarchical", true); 16 | getElement().setAttribute("grid-element", true); 17 | setText(getClass().getSimpleName()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/java/com/testapp/security/LoginView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.testapp.security; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.HasComponents; 13 | import com.vaadin.flow.component.Tag; 14 | import com.vaadin.flow.router.Route; 15 | 16 | @Tag("div") 17 | @Route(value = "login", registerAtStartup = false) 18 | public class LoginView extends Component implements HasComponents { 19 | } 20 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/testapp/security/LoginView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.testapp.security; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.HasComponents; 13 | import com.vaadin.flow.component.Tag; 14 | import com.vaadin.flow.router.Route; 15 | 16 | @Tag("div") 17 | @Route(value = "login", registerAtStartup = false) 18 | public class LoginView extends Component implements HasComponents { 19 | } 20 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/java/com/example/base/HelloWorldView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.example.base; 10 | 11 | import com.vaadin.flow.component.button.Button; 12 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 13 | import com.vaadin.flow.router.Route; 14 | 15 | @Route("helloworld") 16 | public class HelloWorldView extends VerticalLayout { 17 | public HelloWorldView() { 18 | add(new Button("Hello, World!")); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/example/base/HelloWorldView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.example.base; 10 | 11 | import com.vaadin.flow.component.button.Button; 12 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 13 | import com.vaadin.flow.router.Route; 14 | 15 | @Route("helloworld") 16 | public class HelloWorldView extends VerticalLayout { 17 | public HelloWorldView() { 18 | add(new Button("Hello, World!")); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-quarkus/src/test/java/com/testapp/security/LoginView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.testapp.security; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.HasComponents; 13 | import com.vaadin.flow.component.Tag; 14 | import com.vaadin.flow.router.Route; 15 | 16 | @Tag("div") 17 | @Route(value = "login", registerAtStartup = false) 18 | public class LoginView extends Component implements HasComponents { 19 | } 20 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/test/java/com/vaadin/tests/MyComponentWithClassesElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests; 10 | 11 | import com.vaadin.testbench.TestBenchElement; 12 | import com.vaadin.testbench.annotations.Attribute; 13 | 14 | @Attribute(name = "class", contains = Attribute.SIMPLE_CLASS_NAME) 15 | @Attribute(name = "class", contains = "my-component-first") 16 | public class MyComponentWithClassesElement extends TestBenchElement { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/main/resources/META-INF/resources/frontend/label-placeholder.ts: -------------------------------------------------------------------------------- 1 | import { html, LitElement } from 'lit'; 2 | import { customElement, property } from 'lit/decorators.js'; 3 | 4 | @customElement('label-placeholder') 5 | class LabelPlaceholder extends LitElement { 6 | @property({ type: String }) 7 | label!: string; 8 | 9 | @property({ type: String }) 10 | placeholder!: string; 11 | 12 | render() { 13 | return html` 14 |
15 |
${this.label}
16 |
${this.placeholder}
17 | 18 |
19 | `; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/MyComponentWithClassesElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests; 10 | 11 | import com.vaadin.testbench.TestBenchElement; 12 | import com.vaadin.testbench.annotations.Attribute; 13 | 14 | @Attribute(name = "class", contains = Attribute.SIMPLE_CLASS_NAME) 15 | @Attribute(name = "class", contains = "my-component-first") 16 | public class MyComponentWithClassesElement extends TestBenchElement { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/main/java/com/vaadin/testbench/DriverSupplier.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench; 10 | 11 | import org.openqa.selenium.WebDriver; 12 | 13 | /** 14 | * Class implementing this interface can provide own {@link WebDriver} to be 15 | * used during test execution. 16 | */ 17 | public interface DriverSupplier { 18 | 19 | /** 20 | * @return {@link WebDriver} to be used during test execution. 21 | */ 22 | WebDriver createDriver(); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/testbench/unit/TestTester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.unit; 10 | 11 | @Tests(TestComponent.class) 12 | public class TestTester extends ComponentTester { 13 | 14 | /** 15 | * Wrap given component for testing. 16 | * 17 | * @param component 18 | * target component 19 | */ 20 | public TestTester(T component) { 21 | super(component); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/java/com/vaadin/testbench/RetryRuleTestbenchTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench; 10 | 11 | import org.junit.Assert; 12 | import org.junit.Test; 13 | 14 | public class RetryRuleTestbenchTest extends TestBenchTestCase { 15 | 16 | private int count = 0; 17 | 18 | @Test(expected = AssertionError.class) 19 | public void defaultExecution_noRetryRule_testcaseRunOnce() { 20 | count++; 21 | Assert.assertEquals(2, count); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/main/java/com/vaadin/testUI/MyComponentWithClasses.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testUI; 10 | 11 | import com.vaadin.flow.component.html.Div; 12 | 13 | public class MyComponentWithClasses extends Div { 14 | 15 | public MyComponentWithClasses() { 16 | addClassName("my-component-first"); 17 | addClassName("my-component-with-classes"); 18 | addClassName("my-component-last"); 19 | setText(getClass().getSimpleName()); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/main/java/com/vaadin/testUI/MyComponentWithClasses.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testUI; 10 | 11 | import com.vaadin.flow.component.html.Div; 12 | 13 | public class MyComponentWithClasses extends Div { 14 | 15 | public MyComponentWithClasses() { 16 | addClassName("my-component-first"); 17 | addClassName("my-component-with-classes"); 18 | addClassName("my-component-last"); 19 | setText(getClass().getSimpleName()); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/java/com/testapp/security/ProtectedView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.testapp.security; 10 | 11 | import jakarta.annotation.security.PermitAll; 12 | 13 | import com.vaadin.flow.component.Component; 14 | import com.vaadin.flow.component.HasComponents; 15 | import com.vaadin.flow.component.Tag; 16 | import com.vaadin.flow.router.Route; 17 | 18 | @Tag("div") 19 | @Route(value = "", registerAtStartup = false) 20 | @PermitAll 21 | public class ProtectedView extends Component implements HasComponents { 22 | } 23 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/testapp/security/ProtectedView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.testapp.security; 10 | 11 | import jakarta.annotation.security.PermitAll; 12 | 13 | import com.vaadin.flow.component.Component; 14 | import com.vaadin.flow.component.HasComponents; 15 | import com.vaadin.flow.component.Tag; 16 | import com.vaadin.flow.router.Route; 17 | 18 | @Tag("div") 19 | @Route(value = "", registerAtStartup = false) 20 | @PermitAll 21 | public class ProtectedView extends Component implements HasComponents { 22 | } 23 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-quarkus/src/test/java/com/testapp/security/ProtectedView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.testapp.security; 10 | 11 | import jakarta.annotation.security.PermitAll; 12 | 13 | import com.vaadin.flow.component.Component; 14 | import com.vaadin.flow.component.HasComponents; 15 | import com.vaadin.flow.component.Tag; 16 | import com.vaadin.flow.router.Route; 17 | 18 | @Tag("div") 19 | @Route(value = "", registerAtStartup = false) 20 | @PermitAll 21 | public class ProtectedView extends Component implements HasComponents { 22 | } 23 | -------------------------------------------------------------------------------- /vaadin-testbench-shared/src/main/java/com/vaadin/testbench/HasStringValueProperty.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench; 10 | 11 | public interface HasStringValueProperty extends HasPropertySettersGetters { 12 | 13 | default public String getValue() { 14 | return getPropertyString("value"); 15 | } 16 | 17 | default public void setValue(String string) { 18 | setProperty("value", string); 19 | } 20 | 21 | @Override 22 | default public void clear() { 23 | setValue(""); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/routerlink/AbstractTargetView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.routerlink; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.HasComponents; 13 | import com.vaadin.flow.component.html.Span; 14 | 15 | abstract class AbstractTargetView extends Component implements HasComponents { 16 | 17 | final Span message; 18 | 19 | public AbstractTargetView() { 20 | message = new Span(); 21 | add(message); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-quarkus/src/test/java/com/testapp/security/RoleRestrictedView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.testapp.security; 10 | 11 | import jakarta.annotation.security.RolesAllowed; 12 | 13 | import com.vaadin.flow.component.Component; 14 | import com.vaadin.flow.component.HasComponents; 15 | import com.vaadin.flow.component.Tag; 16 | import com.vaadin.flow.router.Route; 17 | 18 | @Tag("div") 19 | @Route(value = "role-restricted", registerAtStartup = false) 20 | @RolesAllowed("PO") 21 | public class RoleRestrictedView extends Component implements HasComponents { 22 | } 23 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-quarkus/src/test/java/com/example/base/HelloWorldView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.example.base; 10 | 11 | import com.vaadin.flow.component.button.Button; 12 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 13 | import com.vaadin.flow.router.Route; 14 | 15 | @Route("helloworld") 16 | public class HelloWorldView extends VerticalLayout { 17 | 18 | public final DummyService service; 19 | 20 | public HelloWorldView(DummyService service) { 21 | this.service = service; 22 | add(new Button("Hello, World!")); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/H2Tester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.html.testbench; 10 | 11 | import com.vaadin.flow.component.html.H2; 12 | import com.vaadin.testbench.unit.Tests; 13 | 14 | @Tests(H2.class) 15 | public class H2Tester extends HtmlClickContainer

{ 16 | /** 17 | * Wrap given component for testing. 18 | * 19 | * @param component 20 | * target component 21 | */ 22 | public H2Tester(H2 component) { 23 | super(component); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/H3Tester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.html.testbench; 10 | 11 | import com.vaadin.flow.component.html.H3; 12 | import com.vaadin.testbench.unit.Tests; 13 | 14 | @Tests(H3.class) 15 | public class H3Tester extends HtmlClickContainer

{ 16 | /** 17 | * Wrap given component for testing. 18 | * 19 | * @param component 20 | * target component 21 | */ 22 | public H3Tester(H3 component) { 23 | super(component); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/H4Tester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.html.testbench; 10 | 11 | import com.vaadin.flow.component.html.H4; 12 | import com.vaadin.testbench.unit.Tests; 13 | 14 | @Tests(H4.class) 15 | public class H4Tester extends HtmlClickContainer

{ 16 | /** 17 | * Wrap given component for testing. 18 | * 19 | * @param component 20 | * target component 21 | */ 22 | public H4Tester(H4 component) { 23 | super(component); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/H5Tester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.html.testbench; 10 | 11 | import com.vaadin.flow.component.html.H5; 12 | import com.vaadin.testbench.unit.Tests; 13 | 14 | @Tests(H5.class) 15 | public class H5Tester extends HtmlClickContainer
{ 16 | /** 17 | * Wrap given component for testing. 18 | * 19 | * @param component 20 | * target component 21 | */ 22 | public H5Tester(H5 component) { 23 | super(component); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/H6Tester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.html.testbench; 10 | 11 | import com.vaadin.flow.component.html.H6; 12 | import com.vaadin.testbench.unit.Tests; 13 | 14 | @Tests(H6.class) 15 | public class H6Tester extends HtmlClickContainer
{ 16 | /** 17 | * Wrap given component for testing. 18 | * 19 | * @param component 20 | * target component 21 | */ 22 | public H6Tester(H6 component) { 23 | super(component); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/HrTester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.html.testbench; 10 | 11 | import com.vaadin.flow.component.html.Hr; 12 | import com.vaadin.testbench.unit.Tests; 13 | 14 | @Tests(Hr.class) 15 | public class HrTester extends HtmlComponentTester
{ 16 | /** 17 | * Wrap given component for testing. 18 | * 19 | * @param component 20 | * target component 21 | */ 22 | public HrTester(Hr component) { 23 | super(component); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/testbench/unit/NonGenericTestTester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.unit; 10 | 11 | @Tests(TestComponentForConcreteTester.class) 12 | public class NonGenericTestTester 13 | extends ComponentTester { 14 | 15 | /** 16 | * Wrap given component for testing. 17 | * 18 | * @param component 19 | * target component 20 | */ 21 | public NonGenericTestTester(TestComponentForConcreteTester component) { 22 | super(component); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/DivTester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.html.testbench; 10 | 11 | import com.vaadin.flow.component.html.Div; 12 | import com.vaadin.testbench.unit.Tests; 13 | 14 | @Tests(Div.class) 15 | public class DivTester extends HtmlClickContainer
{ 16 | /** 17 | * Wrap given component for testing. 18 | * 19 | * @param component 20 | * target component 21 | */ 22 | public DivTester(Div component) { 23 | super(component); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/H1Tester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.html.testbench; 10 | 11 | import com.vaadin.flow.component.html.H1; 12 | import com.vaadin.testbench.unit.Tests; 13 | 14 | @Tests(H1.class) 15 | public class H1Tester extends HtmlClickContainer

{ 16 | /** 17 | * Wrap given component for testing. 18 | * 19 | * @param component 20 | * target component 21 | */ 22 | public H1Tester(H1 component) { 23 | super(component); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/PreTester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.html.testbench; 10 | 11 | import com.vaadin.flow.component.html.Pre; 12 | import com.vaadin.testbench.unit.Tests; 13 | 14 | @Tests(Pre.class) 15 | public class PreTester extends HtmlClickContainer
 {
16 |     /**
17 |      * Wrap given component for testing.
18 |      *
19 |      * @param component
20 |      *            target component
21 |      */
22 |     public PreTester(Pre component) {
23 |         super(component);
24 |     }
25 | }
26 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-shared/src/main/java/com/vaadin/testbench/unit/UIUnitTestSetupException.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.testbench.unit;
10 | 
11 | /**
12 |  * Exception thrown by {@link BaseUIUnitTest} methods when the mock environment
13 |  * has not been set up correctly.
14 |  */
15 | public class UIUnitTestSetupException extends RuntimeException {
16 |     public UIUnitTestSetupException(String message) {
17 |         super(message);
18 |     }
19 | 
20 |     public UIUnitTestSetupException(String message, Throwable cause) {
21 |         super(message, cause);
22 |     }
23 | }
24 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/HtmlClickContainer.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.flow.component.html.testbench;
10 | 
11 | import com.vaadin.flow.component.HtmlContainer;
12 | 
13 | public abstract class HtmlClickContainer
14 |         extends HtmlContainerTester {
15 |     /**
16 |      * Wrap given component for testing.
17 |      *
18 |      * @param component
19 |      *            target component
20 |      */
21 |     public HtmlClickContainer(T component) {
22 |         super(component);
23 |     }
24 | }
25 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/ImageTester.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.flow.component.html.testbench;
10 | 
11 | import com.vaadin.flow.component.html.Image;
12 | import com.vaadin.testbench.unit.Tests;
13 | 
14 | @Tests(Image.class)
15 | public class ImageTester extends HtmlClickContainer {
16 |     /**
17 |      * Wrap given component for testing.
18 |      *
19 |      * @param component
20 |      *            target component
21 |      */
22 |     public ImageTester(Image component) {
23 |         super(component);
24 |     }
25 | }
26 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/SpanTester.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.flow.component.html.testbench;
10 | 
11 | import com.vaadin.flow.component.html.Span;
12 | import com.vaadin.testbench.unit.Tests;
13 | 
14 | @Tests(Span.class)
15 | public class SpanTester extends HtmlClickContainer {
16 |     /**
17 |      * Wrap given component for testing.
18 |      *
19 |      * @param component
20 |      *            target component
21 |      */
22 |     public SpanTester(Span component) {
23 |         super(component);
24 |     }
25 | 
26 | }
27 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/EmphasisTester.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.flow.component.html.testbench;
10 | 
11 | import com.vaadin.flow.component.html.Emphasis;
12 | import com.vaadin.testbench.unit.Tests;
13 | 
14 | @Tests(Emphasis.class)
15 | public class EmphasisTester extends HtmlClickContainer {
16 |     /**
17 |      * Wrap given component for testing.
18 |      *
19 |      * @param component
20 |      *            target component
21 |      */
22 |     public EmphasisTester(Emphasis component) {
23 |         super(component);
24 |     }
25 | }
26 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/ListItemTester.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.flow.component.html.testbench;
10 | 
11 | import com.vaadin.flow.component.html.ListItem;
12 | import com.vaadin.testbench.unit.Tests;
13 | 
14 | @Tests(ListItem.class)
15 | public class ListItemTester extends HtmlClickContainer {
16 |     /**
17 |      * Wrap given component for testing.
18 |      *
19 |      * @param component
20 |      *            target component
21 |      */
22 |     public ListItemTester(ListItem component) {
23 |         super(component);
24 |     }
25 | }
26 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit/src/test/java/com/example/base/WelcomeView.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.example.base;
10 | 
11 | import com.vaadin.flow.component.Text;
12 | import com.vaadin.flow.component.orderedlayout.VerticalLayout;
13 | import com.vaadin.flow.router.Route;
14 | import com.vaadin.flow.router.RouteAlias;
15 | import com.vaadin.flow.server.PWA;
16 | 
17 | @Route("welcome")
18 | @RouteAlias("")
19 | @PWA(name = "My Foo PWA", shortName = "Foo PWA")
20 | public class WelcomeView extends VerticalLayout {
21 |     public WelcomeView() {
22 |         setWidth(null);
23 |         add(new Text("Welcome!"));
24 |     }
25 | }
26 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/button/ButtonView.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.flow.component.button;
10 | 
11 | import com.vaadin.flow.component.Component;
12 | import com.vaadin.flow.component.HasComponents;
13 | import com.vaadin.flow.component.Tag;
14 | import com.vaadin.flow.router.Route;
15 | 
16 | @Tag("div")
17 | @Route(value = "button", registerAtStartup = false)
18 | public class ButtonView extends Component implements HasComponents {
19 |     Button button;
20 | 
21 |     public ButtonView() {
22 |         button = new Button();
23 |         add(button);
24 |     }
25 | }
26 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/grid/CheckBox.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.flow.component.grid;
10 | 
11 | import com.vaadin.flow.component.Component;
12 | import com.vaadin.flow.component.Tag;
13 | 
14 | @Tag("check-box")
15 | public class CheckBox extends Component {
16 |     boolean checked;
17 | 
18 |     public CheckBox(boolean checked) {
19 |         this.checked = checked;
20 |     }
21 | 
22 |     public boolean isChecked() {
23 |         return checked;
24 |     }
25 | 
26 |     public void setChecked(boolean checked) {
27 |         this.checked = checked;
28 |     }
29 | }
30 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/ParagraphTester.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.flow.component.html.testbench;
10 | 
11 | import com.vaadin.flow.component.html.Paragraph;
12 | import com.vaadin.testbench.unit.Tests;
13 | 
14 | @Tests(Paragraph.class)
15 | public class ParagraphTester extends HtmlClickContainer {
16 |     /**
17 |      * Wrap given component for testing.
18 |      *
19 |      * @param component
20 |      *            target component
21 |      */
22 |     public ParagraphTester(Paragraph component) {
23 |         super(component);
24 |     }
25 | }
26 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-shared/src/main/java/com/vaadin/testbench/unit/mocks/SpringSecurityRequestCustomizer.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.testbench.unit.mocks;
10 | 
11 | import com.vaadin.testbench.unit.internal.MockRequestCustomizer;
12 | 
13 | /**
14 |  * Configures mock request with authentication details from Spring Security.
15 |  *
16 |  * For internal use only.
17 |  */
18 | public class SpringSecurityRequestCustomizer implements MockRequestCustomizer {
19 | 
20 |     @Override
21 |     public void apply(MockRequest request) {
22 |         MockSpringServlet.applySpringSecurityIfPresent(request);
23 |     }
24 | }
25 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-junit5/src/test/java/com/example/base/WelcomeView.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.example.base;
10 | 
11 | import com.vaadin.flow.component.Text;
12 | import com.vaadin.flow.component.orderedlayout.VerticalLayout;
13 | import com.vaadin.flow.router.Route;
14 | import com.vaadin.flow.router.RouteAlias;
15 | import com.vaadin.flow.server.PWA;
16 | 
17 | @Route("welcome")
18 | @RouteAlias("")
19 | @PWA(name = "My Foo PWA", shortName = "Foo PWA")
20 | public class WelcomeView extends VerticalLayout {
21 |     public WelcomeView() {
22 |         setWidth(null);
23 |         add(new Text("Welcome!"));
24 |     }
25 | }
26 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/grid/Country.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.flow.component.grid;
10 | 
11 | /**
12 |  * Copied from grid integration-tests.
13 |  */
14 | public enum Country {
15 | 
16 |     FINLAND("Finland"),
17 |     SWEDEN("Sweden"),
18 |     USA("USA"),
19 |     RUSSIA("Russia"),
20 |     NETHERLANDS("Netherlands"),
21 |     SOUTH_AFRICA("South Africa");
22 | 
23 |     private String name;
24 | 
25 |     private Country(String name) {
26 |         this.name = name;
27 |     }
28 | 
29 |     @Override
30 |     public String toString() {
31 |         return name;
32 |     }
33 | }
34 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/NativeLabelTester.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.flow.component.html.testbench;
10 | 
11 | import com.vaadin.flow.component.html.NativeLabel;
12 | import com.vaadin.testbench.unit.Tests;
13 | 
14 | @Tests(NativeLabel.class)
15 | public class NativeLabelTester extends HtmlContainerTester {
16 |     /**
17 |      * Wrap given component for testing.
18 |      *
19 |      * @param component
20 |      *            target component
21 |      */
22 |     public NativeLabelTester(NativeLabel component) {
23 |         super(component);
24 |     }
25 | }
26 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit/src/test/java/com/example/SingleParam.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.example;
10 | 
11 | import com.vaadin.flow.component.Component;
12 | import com.vaadin.flow.component.Tag;
13 | import com.vaadin.flow.router.BeforeEvent;
14 | import com.vaadin.flow.router.HasUrlParameter;
15 | import com.vaadin.flow.router.Route;
16 | 
17 | @Route("param")
18 | @Tag("div")
19 | public class SingleParam extends Component implements HasUrlParameter {
20 |     public String parameter;
21 | 
22 |     @Override
23 |     public void setParameter(BeforeEvent event, String parameter) {
24 |         this.parameter = parameter;
25 |     }
26 | }
27 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/datepicker/DatePickerView.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.flow.component.datepicker;
10 | 
11 | import com.vaadin.flow.component.Component;
12 | import com.vaadin.flow.component.HasComponents;
13 | import com.vaadin.flow.component.Tag;
14 | import com.vaadin.flow.router.Route;
15 | 
16 | @Tag("div")
17 | @Route(value = "date", registerAtStartup = false)
18 | public class DatePickerView extends Component implements HasComponents {
19 |     DatePicker picker;
20 | 
21 |     public DatePickerView() {
22 |         picker = new DatePicker();
23 |         add(picker);
24 |     }
25 | }
26 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/timepicker/TimePickerView.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.flow.component.timepicker;
10 | 
11 | import com.vaadin.flow.component.Component;
12 | import com.vaadin.flow.component.HasComponents;
13 | import com.vaadin.flow.component.Tag;
14 | import com.vaadin.flow.router.Route;
15 | 
16 | @Tag("div")
17 | @Route(value = "time", registerAtStartup = false)
18 | public class TimePickerView extends Component implements HasComponents {
19 |     TimePicker picker;
20 | 
21 |     public TimePickerView() {
22 |         picker = new TimePicker();
23 |         add(picker);
24 |     }
25 | }
26 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-quarkus/src/test/java/com/example/base/WelcomeView.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.example.base;
10 | 
11 | import jakarta.inject.Inject;
12 | 
13 | import com.vaadin.flow.component.Text;
14 | import com.vaadin.flow.component.orderedlayout.VerticalLayout;
15 | import com.vaadin.flow.router.Route;
16 | import com.vaadin.flow.router.RouteAlias;
17 | 
18 | @Route("welcome")
19 | @RouteAlias("")
20 | public class WelcomeView extends VerticalLayout {
21 | 
22 |     @Inject
23 |     public DummyService service;
24 | 
25 |     public WelcomeView() {
26 |         setWidth(null);
27 |         add(new Text("Welcome!"));
28 |     }
29 | 
30 | }
31 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-junit5/src/test/java/com/example/SingleParam.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.example;
10 | 
11 | import com.vaadin.flow.component.Component;
12 | import com.vaadin.flow.component.Tag;
13 | import com.vaadin.flow.router.BeforeEvent;
14 | import com.vaadin.flow.router.HasUrlParameter;
15 | import com.vaadin.flow.router.Route;
16 | 
17 | @Route("param")
18 | @Tag("div")
19 | public class SingleParam extends Component implements HasUrlParameter {
20 |     public String parameter;
21 | 
22 |     @Override
23 |     public void setParameter(BeforeEvent event, String parameter) {
24 |         this.parameter = parameter;
25 |     }
26 | }
27 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/NativeButtonTester.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.flow.component.html.testbench;
10 | 
11 | import com.vaadin.flow.component.html.NativeButton;
12 | import com.vaadin.testbench.unit.Tests;
13 | 
14 | @Tests(NativeButton.class)
15 | public class NativeButtonTester extends HtmlClickContainer {
16 |     /**
17 |      * > Wrap given component for testing.
18 |      *
19 |      * @param component
20 |      *            target component
21 |      */
22 |     public NativeButtonTester(NativeButton component) {
23 |         super(component);
24 |     }
25 | 
26 | }
27 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/confirmdialog/ConfirmDialogView.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.flow.component.confirmdialog;
10 | 
11 | import com.vaadin.flow.component.Component;
12 | import com.vaadin.flow.component.HasComponents;
13 | import com.vaadin.flow.component.Tag;
14 | import com.vaadin.flow.router.Route;
15 | 
16 | @Tag("div")
17 | @Route(value = "confirm-dialog", registerAtStartup = false)
18 | public class ConfirmDialogView extends Component implements HasComponents {
19 | 
20 |     ConfirmDialog dialog;
21 | 
22 |     public ConfirmDialogView() {
23 |         dialog = new ConfirmDialog();
24 |     }
25 | }
26 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/textfield/TextAreaView.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.flow.component.textfield;
10 | 
11 | import com.vaadin.flow.component.Component;
12 | import com.vaadin.flow.component.HasComponents;
13 | import com.vaadin.flow.component.Tag;
14 | import com.vaadin.flow.router.Route;
15 | 
16 | @Tag("div")
17 | @Route(value = "text-area", registerAtStartup = false)
18 | public class TextAreaView extends Component implements HasComponents {
19 | 
20 |     TextArea textArea;
21 | 
22 |     public TextAreaView() {
23 |         this.textArea = new TextArea();
24 |         add(textArea);
25 |     }
26 | }
27 | 


--------------------------------------------------------------------------------
/vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/textfield/TextFieldView.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.flow.component.textfield;
10 | 
11 | import com.vaadin.flow.component.Component;
12 | import com.vaadin.flow.component.HasComponents;
13 | import com.vaadin.flow.component.Tag;
14 | import com.vaadin.flow.router.Route;
15 | 
16 | @Tag("div")
17 | @Route(value = "text-fields", registerAtStartup = false)
18 | public class TextFieldView extends Component implements HasComponents {
19 |     TextField textField;
20 | 
21 |     public TextFieldView() {
22 |         textField = new TextField("Text field");
23 |         add(textField);
24 |     }
25 | }
26 | 


--------------------------------------------------------------------------------
/vaadin-testbench-core/src/test/java/com/vaadin/testbench/ParentRetryRuleTest.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.testbench;
10 | 
11 | import org.junit.Assert;
12 | import org.junit.Rule;
13 | import org.junit.Test;
14 | 
15 | import com.vaadin.testbench.testutils.ParentRetryRule;
16 | 
17 | public class ParentRetryRuleTest extends ParentRetryRule {
18 |     private int count = 0;
19 |     // Override parent RetryRule that uses RetryRule(1)
20 |     @Rule
21 |     public RetryRule retry = new RetryRule(2);
22 | 
23 |     @Test
24 |     public void parentRule_settingRule_overridesParentRule() {
25 |         count++;
26 |         Assert.assertEquals(2, count);
27 |     }
28 | }
29 | 


--------------------------------------------------------------------------------
/vaadin-testbench-shared/src/main/java/com/vaadin/testbench/HasPlaceholder.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.testbench;
10 | 
11 | import java.util.Objects;
12 | 
13 | /**
14 |  * Implement by elements which support a placeholder, i.e. text shown when the
15 |  * field is empty.
16 |  */
17 | public interface HasPlaceholder extends HasPropertySettersGetters {
18 | 
19 |     /**
20 |      * Gets the placeholder for the element.
21 |      *
22 |      * @return the placeholder or an empty string if there is no placeholder
23 |      */
24 |     default String getPlaceholder() {
25 |         return Objects.requireNonNullElse(getPropertyString("placeholder"), "");
26 |     }
27 | }
28 | 


--------------------------------------------------------------------------------
/vaadin-testbench-core/src/test/java/com/vaadin/testbench/RetryRuleAfterTest.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.testbench;
10 | 
11 | import org.junit.After;
12 | import org.junit.Assert;
13 | import org.junit.Rule;
14 | import org.junit.Test;
15 | 
16 | public class RetryRuleAfterTest {
17 |     private int afterExecutedCount = 0;
18 | 
19 |     @Rule
20 |     public RetryRule retry = new RetryRule(3);
21 | 
22 |     @After
23 |     public void cleanUp() {
24 |         afterExecutedCount++;
25 |     }
26 | 
27 |     @Test
28 |     public void afterAnnotation_executedSeveralTimes_whenUsingRetryRule() {
29 |         Assert.assertEquals(2, afterExecutedCount);
30 |     }
31 | 
32 | }
33 | 


--------------------------------------------------------------------------------
/vaadin-testbench-core/src/test/java/com/vaadin/testbench/RetryRuleBeforeTest.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.testbench;
10 | 
11 | import org.junit.Assert;
12 | import org.junit.Before;
13 | import org.junit.Rule;
14 | import org.junit.Test;
15 | 
16 | public class RetryRuleBeforeTest {
17 |     private int beforeExecutedCount = 0;
18 | 
19 |     @Rule
20 |     public RetryRule retry = new RetryRule(3);
21 | 
22 |     @Before
23 |     public void setUp() {
24 |         beforeExecutedCount++;
25 |     }
26 | 
27 |     @Test
28 |     public void beforeAnnotation_executedSeveralTimes_whenUsingRetryRule() {
29 |         Assert.assertEquals(3, beforeExecutedCount);
30 |     }
31 | }
32 | 


--------------------------------------------------------------------------------
/vaadin-testbench-shared/src/main/java/com/vaadin/testbench/parallel/TestNameSuffix.java:
--------------------------------------------------------------------------------
 1 | /**
 2 |  * Copyright (C) 2000-2025 Vaadin Ltd
 3 |  *
 4 |  * This program is available under Vaadin Commercial License and Service Terms.
 5 |  *
 6 |  * See  for the full
 7 |  * license.
 8 |  */
 9 | package com.vaadin.testbench.parallel;
10 | 
11 | import java.lang.annotation.Retention;
12 | import java.lang.annotation.RetentionPolicy;
13 | 
14 | /**
15 |  * Defines a system property to be used as part of the test name.
16 | * It may be useful to add information related to the system or the machine 17 | * itself, such as the OS.
18 | * This will affect, for instance, the names of screenshots taken in case of 19 | * test failure.
20 | */ 21 | @Retention(RetentionPolicy.RUNTIME) 22 | public @interface TestNameSuffix { 23 | 24 | String property(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/datetimepicker/DateTimePickerView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.datetimepicker; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.HasComponents; 13 | import com.vaadin.flow.component.Tag; 14 | import com.vaadin.flow.router.Route; 15 | 16 | @Tag("div") 17 | @Route(value = "date-time", registerAtStartup = false) 18 | public class DateTimePickerView extends Component implements HasComponents { 19 | DateTimePicker picker; 20 | 21 | public DateTimePickerView() { 22 | picker = new DateTimePicker(); 23 | add(picker); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/test/java/com/vaadin/tests/elements/LabelPlaceholderElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests.elements; 10 | 11 | import com.vaadin.testUI.LabelPlaceholder; 12 | import com.vaadin.testbench.HasLabel; 13 | import com.vaadin.testbench.HasPlaceholder; 14 | import com.vaadin.testbench.TestBenchElement; 15 | import com.vaadin.testbench.elementsbase.Element; 16 | 17 | @Element(LabelPlaceholder.TAG) 18 | public class LabelPlaceholderElement extends TestBenchElement 19 | implements HasLabel, HasPlaceholder { 20 | 21 | @Override 22 | public String getText() { 23 | return getPropertyString("textContent"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vaadin-testbench-shared/src/main/java/com/vaadin/testbench/HasCallFunction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench; 10 | 11 | import org.openqa.selenium.WebElement; 12 | 13 | public interface HasCallFunction extends WebElement { 14 | 15 | /** 16 | * Invoke the given method on this element using the given arguments as 17 | * arguments to the method. 18 | * 19 | * @param methodName 20 | * the method to invoke 21 | * @param args 22 | * the arguments to pass to the method 23 | * @return the value returned by the method 24 | */ 25 | public Object callFunction(String methodName, Object... args); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/java/com/example/TemplatedParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.example; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.Tag; 13 | import com.vaadin.flow.router.BeforeEnterEvent; 14 | import com.vaadin.flow.router.BeforeEnterObserver; 15 | import com.vaadin.flow.router.Route; 16 | 17 | @Route("template/:param") 18 | @Tag("div") 19 | public class TemplatedParam extends Component implements BeforeEnterObserver { 20 | public String parameter; 21 | 22 | @Override 23 | public void beforeEnter(BeforeEnterEvent event) { 24 | parameter = event.getRouteParameters().get("param").get(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/elements/LabelPlaceholderElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests.elements; 10 | 11 | import com.vaadin.testUI.LabelPlaceholder; 12 | import com.vaadin.testbench.HasLabel; 13 | import com.vaadin.testbench.HasPlaceholder; 14 | import com.vaadin.testbench.TestBenchElement; 15 | import com.vaadin.testbench.elementsbase.Element; 16 | 17 | @Element(LabelPlaceholder.TAG) 18 | public class LabelPlaceholderElement extends TestBenchElement 19 | implements HasLabel, HasPlaceholder { 20 | 21 | @Override 22 | public String getText() { 23 | return getPropertyString("textContent"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vaadin-testbench-shared/src/main/java/com/vaadin/testbench/HasDriver.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench; 10 | 11 | import org.openqa.selenium.WebDriver; 12 | 13 | /** 14 | * An interface for classes that can provide an instance of a {@link WebDriver} 15 | */ 16 | public interface HasDriver { 17 | 18 | /** 19 | * Return the {@link WebDriver} instance associated with the implementing 20 | * class instance. This can be simply the class itself re-cast as a 21 | * WebDriver, or a reference to some WebDriver obtainable by any other 22 | * means. 23 | * 24 | * @return the contained WebDriver instance 25 | */ 26 | WebDriver getDriver(); 27 | } 28 | -------------------------------------------------------------------------------- /vaadin-testbench-shared/src/main/java/com/vaadin/testbench/HasLabel.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench; 10 | 11 | import java.util.Objects; 12 | 13 | /** 14 | * Implement by elements which support a label, i.e. text shown typically inside 15 | * (when field is empty) or above the field (when the field has a value). 16 | */ 17 | public interface HasLabel extends HasPropertySettersGetters { 18 | 19 | /** 20 | * Gets the label for the element. 21 | * 22 | * @return the label or an empty string if there is no label 23 | */ 24 | default String getLabel() { 25 | return Objects.requireNonNullElse(getPropertyString("label"), ""); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/example/TemplatedParam.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.example; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.Tag; 13 | import com.vaadin.flow.router.BeforeEnterEvent; 14 | import com.vaadin.flow.router.BeforeEnterObserver; 15 | import com.vaadin.flow.router.Route; 16 | 17 | @Route("template/:param") 18 | @Tag("div") 19 | public class TemplatedParam extends Component implements BeforeEnterObserver { 20 | public String parameter; 21 | 22 | @Override 23 | public void beforeEnter(BeforeEnterEvent event) { 24 | parameter = event.getRouteParameters().get("param").get(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/login/LoginFormTester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.login; 10 | 11 | import com.vaadin.testbench.unit.Tests; 12 | 13 | /** 14 | * Tester for LoginForm components. 15 | * 16 | * @param 17 | * component type 18 | */ 19 | @Tests(LoginForm.class) 20 | public class LoginFormTester 21 | extends AbstractLoginTester { 22 | 23 | /** 24 | * Wrap given component for testing. 25 | * 26 | * @param component 27 | * target component 28 | */ 29 | public LoginFormTester(T component) { 30 | super(component); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/button/ButtonTester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.button; 10 | 11 | import com.vaadin.testbench.unit.ComponentTester; 12 | import com.vaadin.testbench.unit.Tests; 13 | 14 | /** 15 | * 16 | * Tester for Button components. 17 | * 18 | * @param 19 | * component type 20 | */ 21 | @Tests(Button.class) 22 | public class ButtonTester extends ComponentTester { 23 | /** 24 | * Wrap given button for testing. 25 | * 26 | * @param component 27 | * target button 28 | */ 29 | public ButtonTester(T component) { 30 | super(component); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vaadin-testbench-shared/src/main/java/com/vaadin/testbench/HasSelectByText.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench; 10 | 11 | /** 12 | * Implemented by elements which support selecting an option by matching the 13 | * text shown to the user. 14 | */ 15 | public interface HasSelectByText { 16 | /** 17 | * Selects the first option matching the given text. 18 | * 19 | * @param text 20 | * the text of the option to select 21 | */ 22 | public void selectByText(String text); 23 | 24 | /** 25 | * Gets the text of the currently selected option. 26 | * 27 | * @return the text of the current option 28 | */ 29 | public String getSelectedText(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/routerlink/RouterLinkStaticTargetView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.routerlink; 10 | 11 | import com.vaadin.flow.component.HasComponents; 12 | import com.vaadin.flow.component.Tag; 13 | import com.vaadin.flow.router.Route; 14 | 15 | @Tag(Tag.DIV) 16 | @Route(value = RouterLinkStaticTargetView.ROUTE, registerAtStartup = false) 17 | public class RouterLinkStaticTargetView extends AbstractTargetView 18 | implements HasComponents { 19 | 20 | public static final String ROUTE = "router-link-static-target"; 21 | 22 | public RouterLinkStaticTargetView() { 23 | message.setText("Static Target View"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vaadin-testbench-shared/src/main/java/com/vaadin/testbench/HasSearchContext.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench; 10 | 11 | import org.openqa.selenium.SearchContext; 12 | 13 | /** 14 | * Interface for classes providing a {@link SearchContext}, i.e. if a class can 15 | * provide a search context while not directly implementing the 16 | * {@link SearchContext} interface, this interface should be implemented 17 | * 18 | */ 19 | public interface HasSearchContext { 20 | 21 | /** 22 | * Get a reference or a new instance of the SearchContext applicable to this 23 | * class 24 | * 25 | * @return a {@link SearchContext} instance 26 | */ 27 | public SearchContext getContext(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/java/com/vaadin/testbench/unit/TestCustomInstantiatorFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.unit; 10 | 11 | import com.vaadin.flow.di.DefaultInstantiator; 12 | import com.vaadin.flow.di.Instantiator; 13 | import com.vaadin.flow.di.InstantiatorFactory; 14 | import com.vaadin.flow.server.VaadinService; 15 | 16 | /** 17 | * A custom {@link InstantiatorFactory} to test 18 | * {@link com.vaadin.flow.di.Lookup} initialization. 19 | */ 20 | public class TestCustomInstantiatorFactory implements InstantiatorFactory { 21 | 22 | @Override 23 | public Instantiator createInstantitor(VaadinService vaadinService) { 24 | return new DefaultInstantiator(vaadinService); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/dialog/DialogView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.dialog; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.HasComponents; 13 | import com.vaadin.flow.component.Tag; 14 | import com.vaadin.flow.component.button.Button; 15 | import com.vaadin.flow.router.Route; 16 | 17 | @Tag("div") 18 | @Route(value = "dialog", registerAtStartup = false) 19 | public class DialogView extends Component implements HasComponents { 20 | 21 | Dialog dialog; 22 | Button button; 23 | 24 | public DialogView() { 25 | dialog = new Dialog(); 26 | button = new Button(); 27 | add(button); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/testbench/unit/TestCustomInstantiatorFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.unit; 10 | 11 | import com.vaadin.flow.di.DefaultInstantiator; 12 | import com.vaadin.flow.di.Instantiator; 13 | import com.vaadin.flow.di.InstantiatorFactory; 14 | import com.vaadin.flow.server.VaadinService; 15 | 16 | /** 17 | * A custom {@link InstantiatorFactory} to test 18 | * {@link com.vaadin.flow.di.Lookup} initialization. 19 | */ 20 | public class TestCustomInstantiatorFactory implements InstantiatorFactory { 21 | 22 | @Override 23 | public Instantiator createInstantitor(VaadinService vaadinService) { 24 | return new DefaultInstantiator(vaadinService); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/main/java/com/vaadin/testUI/PageObjectView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testUI; 10 | 11 | import com.vaadin.flow.component.html.Div; 12 | import com.vaadin.flow.router.Route; 13 | 14 | @Route("PageObjectView") 15 | public class PageObjectView extends Div { 16 | 17 | public PageObjectView() { 18 | Div someDiv = new Div(); 19 | someDiv.setText("Some div"); 20 | 21 | MyComponentWithId idView = new MyComponentWithId(); 22 | MyComponentWithClasses classesView = new MyComponentWithClasses(); 23 | 24 | Div anotherDiv = new Div(); 25 | anotherDiv.setText("Some div"); 26 | 27 | add(someDiv, idView, classesView, anotherDiv); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vaadin-testbench-shared/src/main/java/com/vaadin/testbench/parallel/ExcludeFromSuite.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.parallel; 10 | 11 | import java.lang.annotation.ElementType; 12 | import java.lang.annotation.Inherited; 13 | import java.lang.annotation.Retention; 14 | import java.lang.annotation.RetentionPolicy; 15 | import java.lang.annotation.Target; 16 | 17 | /** 18 | * Marker interface for a TestBench test class which will exclude the test from 19 | * any test suite which automatically scans for test classes. Mostly useful for 20 | * long tests which should not be run in every build. 21 | */ 22 | @Retention(RetentionPolicy.RUNTIME) 23 | @Target(ElementType.TYPE) 24 | @Inherited 25 | public @interface ExcludeFromSuite { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/upload/UploadView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.upload; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.HasComponents; 13 | import com.vaadin.flow.component.Tag; 14 | import com.vaadin.flow.router.Route; 15 | 16 | @Tag("div") 17 | @Route(value = "upload", registerAtStartup = false) 18 | public class UploadView extends Component implements HasComponents { 19 | 20 | final Upload uploadSingle; 21 | final Upload uploadMulti; 22 | 23 | public UploadView() { 24 | uploadSingle = new Upload(); 25 | uploadMulti = new Upload(); 26 | 27 | add(uploadSingle, uploadMulti); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/main/java/com/vaadin/testbench/BrowserTestClass.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench; 10 | 11 | import java.lang.annotation.ElementType; 12 | import java.lang.annotation.Retention; 13 | import java.lang.annotation.RetentionPolicy; 14 | import java.lang.annotation.Target; 15 | 16 | import org.junit.jupiter.api.extension.ExtendWith; 17 | 18 | import com.vaadin.testbench.browser.MultipleBrowsersExtension; 19 | 20 | /** 21 | * Shorthand annotation for enabling 22 | * {@code @ExtendWith(MultipleBrowsersExtension.class)} on test class. 23 | */ 24 | @Target(ElementType.TYPE) 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @ExtendWith(MultipleBrowsersExtension.class) 27 | public @interface BrowserTestClass { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/java/com/vaadin/testbench/RetryRuleTestbenchWithParameterTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench; 10 | 11 | import org.junit.After; 12 | import org.junit.Assert; 13 | import org.junit.Test; 14 | 15 | public class RetryRuleTestbenchWithParameterTest extends TestBenchTestCase { 16 | 17 | static int oldMaxAttempts = Parameters.getMaxAttempts(); 18 | 19 | static { 20 | Parameters.setMaxAttempts(2); 21 | } 22 | 23 | @Test 24 | public void defaultExecution_ParameterSpecified_testPasses() { 25 | Assert.assertEquals(2, maxAttempts.getMaxAttempts()); 26 | } 27 | 28 | @After 29 | public void cleanUp() { 30 | Parameters.setMaxAttempts(oldMaxAttempts); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/main/java/com/vaadin/testUI/PerformanceView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testUI; 10 | 11 | import com.vaadin.flow.component.html.Div; 12 | import com.vaadin.flow.component.html.NativeButton; 13 | import com.vaadin.flow.component.html.Span; 14 | import com.vaadin.flow.router.Route; 15 | 16 | @Route("PerformanceView") 17 | public class PerformanceView extends Div { 18 | 19 | public PerformanceView() { 20 | NativeButton button = new NativeButton("1s delay", e -> { 21 | try { 22 | Thread.sleep(1000); 23 | } catch (InterruptedException e1) { 24 | } 25 | add(new Span("Done sleeping")); 26 | }); 27 | add(button); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /vaadin-testbench-shared/src/main/java/com/vaadin/testbench/HasTestBenchCommandExecutor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench; 10 | 11 | import com.vaadin.testbench.commands.TestBenchCommandExecutor; 12 | 13 | /** 14 | * Interface for classes that have access to a {@link TestBenchCommandExecutor} 15 | * instance. TestBenchCommandExecutor provides the implementation of TestBench's 16 | * client-control code. 17 | * 18 | */ 19 | public interface HasTestBenchCommandExecutor { 20 | 21 | /** 22 | * Return a reference to the related {@link TestBenchCommandExecutor} 23 | * instance. 24 | * 25 | * @return the {@link TestBenchCommandExecutor} instance 26 | */ 27 | public TestBenchCommandExecutor getCommandExecutor(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/main/java/com/vaadin/testUI/PerformanceView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testUI; 10 | 11 | import com.vaadin.flow.component.html.Div; 12 | import com.vaadin.flow.component.html.NativeButton; 13 | import com.vaadin.flow.component.html.Span; 14 | import com.vaadin.flow.router.Route; 15 | 16 | @Route("PerformanceView") 17 | public class PerformanceView extends Div { 18 | 19 | public PerformanceView() { 20 | NativeButton button = new NativeButton("1s delay", e -> { 21 | try { 22 | Thread.sleep(1000); 23 | } catch (InterruptedException e1) { 24 | } 25 | add(new Span("Done sleeping")); 26 | }); 27 | add(button); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/textfield/NumberFieldView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.textfield; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.HasComponents; 13 | import com.vaadin.flow.component.Tag; 14 | import com.vaadin.flow.router.Route; 15 | 16 | @Tag("div") 17 | @Route(value = "number-fields", registerAtStartup = false) 18 | public class NumberFieldView extends Component implements HasComponents { 19 | NumberField numberField; 20 | IntegerField integerField; 21 | 22 | public NumberFieldView() { 23 | numberField = new NumberField(); 24 | integerField = new IntegerField(); 25 | 26 | add(numberField, integerField); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/html/testbench/RangeInputView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.html.testbench; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.HasComponents; 13 | import com.vaadin.flow.component.Tag; 14 | import com.vaadin.flow.component.html.RangeInput; 15 | import com.vaadin.flow.router.Route; 16 | 17 | @Tag("div") 18 | @Route(value = "range-input", registerAtStartup = false) 19 | public class RangeInputView extends Component implements HasComponents { 20 | 21 | RangeInput rangeInput = new RangeInput(); 22 | 23 | public RangeInputView() { 24 | rangeInput.setMin(-20); 25 | rangeInput.setMax(20); 26 | add(rangeInput); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/java/com/example/base/ParametrizedView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.example.base; 10 | 11 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 12 | import com.vaadin.flow.router.BeforeEvent; 13 | import com.vaadin.flow.router.HasUrlParameter; 14 | import com.vaadin.flow.router.QueryParameters; 15 | import com.vaadin.flow.router.Route; 16 | 17 | @Route("params") 18 | public class ParametrizedView extends VerticalLayout 19 | implements HasUrlParameter { 20 | 21 | Integer parameter; 22 | QueryParameters qp; 23 | 24 | @Override 25 | public void setParameter(BeforeEvent event, Integer parameter) { 26 | this.parameter = parameter; 27 | qp = event.getLocation().getQueryParameters(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/example/base/ParametrizedView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.example.base; 10 | 11 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 12 | import com.vaadin.flow.router.BeforeEvent; 13 | import com.vaadin.flow.router.HasUrlParameter; 14 | import com.vaadin.flow.router.QueryParameters; 15 | import com.vaadin.flow.router.Route; 16 | 17 | @Route("params") 18 | public class ParametrizedView extends VerticalLayout 19 | implements HasUrlParameter { 20 | 21 | Integer parameter; 22 | QueryParameters qp; 23 | 24 | @Override 25 | public void setParameter(BeforeEvent event, Integer parameter) { 26 | this.parameter = parameter; 27 | qp = event.getLocation().getQueryParameters(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/grid/BeanGridView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.grid; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.HasComponents; 13 | import com.vaadin.flow.component.Tag; 14 | import com.vaadin.flow.router.Route; 15 | 16 | @Tag("div") 17 | @Route(value = "basic-grid", registerAtStartup = false) 18 | public class BeanGridView extends Component implements HasComponents { 19 | 20 | Grid beanGrid = new Grid<>(Person.class); 21 | Person first = Person.createTestPerson1(); 22 | Person second = Person.createTestPerson2(); 23 | 24 | public BeanGridView() { 25 | beanGrid.setItems(first, second); 26 | 27 | add(beanGrid); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /.github/workflows/check-permissions.yml: -------------------------------------------------------------------------------- 1 | name: Check User Permissions 2 | 3 | on: 4 | workflow_call: 5 | outputs: 6 | has-permission: 7 | description: 'Whether the user has write permission' 8 | value: ${{ jobs.check.outputs.has-permission }} 9 | 10 | jobs: 11 | check: 12 | runs-on: ubuntu-latest 13 | timeout-minutes: 5 14 | outputs: 15 | has-permission: ${{ steps.checkUser.outputs.require-result }} 16 | steps: 17 | - uses: actions-cool/check-user-permission@main 18 | id: checkUser 19 | with: 20 | username: ${{ github.triggering_actor }} 21 | require: 'write' 22 | 23 | - name: Fail on external workflow triggering 24 | if: ${{ steps.checkUser.outputs.require-result != 'true' && github.actor != 'dependabot[bot]' }} 25 | run: | 26 | echo "🚫 **${{ github.actor }}** is an external contributor, a **${{ github.repository }}** team member has to review this changes and re-run this build" \ 27 | | tee -a $GITHUB_STEP_SUMMARY && exit 1 28 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/AbstractSeleniumChromeTB9Test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests; 10 | 11 | import io.github.bonigarcia.seljup.DriverCapabilities; 12 | import org.junit.jupiter.api.BeforeEach; 13 | import org.openqa.selenium.chrome.ChromeDriver; 14 | import org.openqa.selenium.chrome.ChromeOptions; 15 | 16 | /** 17 | * Example of how to use SeleniumJupiter together with TestBench 9+ features. 18 | * 19 | * @author Vaadin Ltd 20 | */ 21 | public abstract class AbstractSeleniumChromeTB9Test 22 | extends AbstractSeleniumTB9Test { 23 | 24 | @DriverCapabilities 25 | ChromeOptions options = new ChromeOptions(); 26 | 27 | @BeforeEach 28 | public void setDriver(ChromeDriver driver) { 29 | super.setDriver(driver); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/tabs/TabsView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.tabs; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.HasComponents; 13 | import com.vaadin.flow.component.Tag; 14 | import com.vaadin.flow.router.Route; 15 | 16 | @Tag("div") 17 | @Route(value = "tabs", registerAtStartup = false) 18 | public class TabsView extends Component implements HasComponents { 19 | 20 | Tabs tabs; 21 | Tab details; 22 | Tab payment; 23 | Tab shipping; 24 | 25 | public TabsView() { 26 | details = new Tab("Details"); 27 | payment = new Tab("Payment"); 28 | shipping = new Tab("Shipping"); 29 | 30 | tabs = new Tabs(details, payment, shipping); 31 | add(tabs); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/main/java/com/vaadin/testUI/LabelPlaceholder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testUI; 10 | 11 | import com.vaadin.flow.component.HasLabel; 12 | import com.vaadin.flow.component.HasPlaceholder; 13 | import com.vaadin.flow.component.HasText; 14 | import com.vaadin.flow.component.Tag; 15 | import com.vaadin.flow.component.dependency.JsModule; 16 | import com.vaadin.flow.component.littemplate.LitTemplate; 17 | 18 | @Tag(LabelPlaceholder.TAG) 19 | @JsModule(LabelPlaceholder.JS_MODULE) 20 | public class LabelPlaceholder extends LitTemplate 21 | implements HasLabel, HasPlaceholder, HasText { 22 | public static final String TAG = "label-placeholder"; 23 | public static final String JS_MODULE = "./" + TAG + ".ts"; 24 | 25 | public LabelPlaceholder() { 26 | // 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/testbench/unit/CommercialTesterWrappers.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.unit; 10 | 11 | import com.vaadin.flow.component.charts.Chart; 12 | import com.vaadin.flow.component.charts.ChartTester; 13 | 14 | /** 15 | * Provides factory method to create testers for commercial components. 16 | */ 17 | @SuppressWarnings("unchecked") 18 | public interface CommercialTesterWrappers { 19 | 20 | /** 21 | * Create a tester for the given Chart instance. 22 | * 23 | * @param chart 24 | * the chart instance to be tested 25 | * @return a ChartTester instance wrapping the given chart 26 | */ 27 | default ChartTester test(Chart chart) { 28 | return BaseUIUnitTest.internalWrap(ChartTester.class, chart); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/main/java/com/vaadin/testUI/LabelPlaceholder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testUI; 10 | 11 | import com.vaadin.flow.component.HasLabel; 12 | import com.vaadin.flow.component.HasPlaceholder; 13 | import com.vaadin.flow.component.HasText; 14 | import com.vaadin.flow.component.Tag; 15 | import com.vaadin.flow.component.dependency.JsModule; 16 | import com.vaadin.flow.component.littemplate.LitTemplate; 17 | 18 | @Tag(LabelPlaceholder.TAG) 19 | @JsModule(LabelPlaceholder.JS_MODULE) 20 | public class LabelPlaceholder extends LitTemplate 21 | implements HasLabel, HasPlaceholder, HasText { 22 | public static final String TAG = "label-placeholder"; 23 | public static final String JS_MODULE = "./" + TAG + ".ts"; 24 | 25 | public LabelPlaceholder() { 26 | // 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vaadin-testbench-shared/src/main/java/com/vaadin/testbench/elementsbase/Element.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.elementsbase; 10 | 11 | import java.lang.annotation.ElementType; 12 | import java.lang.annotation.Inherited; 13 | import java.lang.annotation.Retention; 14 | import java.lang.annotation.RetentionPolicy; 15 | import java.lang.annotation.Target; 16 | 17 | import com.vaadin.testbench.ElementQuery; 18 | 19 | /** 20 | * Defines the tag name of the element class. 21 | *

22 | * Used when looking up elements using {@link ElementQuery}. 23 | */ 24 | @Retention(RetentionPolicy.RUNTIME) 25 | @Target(ElementType.TYPE) 26 | @Inherited 27 | public @interface Element { 28 | 29 | /** 30 | * The tag for the element. 31 | * 32 | * @return the tag for the element 33 | */ 34 | String value(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/details/DetailsView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.details; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.HasComponents; 13 | import com.vaadin.flow.component.Tag; 14 | import com.vaadin.flow.router.Route; 15 | 16 | @Tag("div") 17 | @Route(value = "details", registerAtStartup = false) 18 | public class DetailsView extends Component implements HasComponents { 19 | 20 | Details details; 21 | DetailsContents contents; 22 | 23 | public DetailsView() { 24 | contents = new DetailsContents(); 25 | details = new Details("Members", contents); 26 | add(details); 27 | } 28 | 29 | @Tag("div") 30 | public static class DetailsContents extends Component { 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /testing-support/uiunit-component-testers/src/main/java/com/vaadin/testbench/dontscan/noclassdeffound/NoClassDefFoundComponentTester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.dontscan.noclassdeffound; 10 | 11 | import com.vaadin.testbench.unit.ComponentTester; 12 | import com.vaadin.testbench.unit.Tests; 13 | 14 | /** 15 | * Dummy tester referencing a class from a third-party JAR that might not be 16 | * available at runtime. This is used to verify that scanning for testers does 17 | * not fail when the referenced component class is not on the classpath. 18 | */ 19 | @Tests(NoClassDefFoundComponent.class) 20 | public class NoClassDefFoundComponentTester 21 | extends ComponentTester { 22 | 23 | public NoClassDefFoundComponentTester(T component) { 24 | super(component); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/sidenav/TargetView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.sidenav; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.Tag; 13 | import com.vaadin.flow.router.BeforeEnterEvent; 14 | import com.vaadin.flow.router.BeforeEnterObserver; 15 | import com.vaadin.flow.router.Route; 16 | import com.vaadin.flow.router.RouteAlias; 17 | 18 | @Tag("div") 19 | @Route(value = "sidenav-target", registerAtStartup = false) 20 | @RouteAlias("sidenav-target/:param") 21 | public class TargetView extends Component implements BeforeEnterObserver { 22 | 23 | String parameter; 24 | 25 | @Override 26 | public void beforeEnter(BeforeEnterEvent event) { 27 | parameter = event.getRouteParameters().get("param").orElse("N/A"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-quarkus/src/test/java/com/testapp/security/AnyRoleView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.testapp.security; 10 | 11 | import jakarta.annotation.security.RolesAllowed; 12 | 13 | import com.vaadin.flow.component.Component; 14 | import com.vaadin.flow.component.HasComponents; 15 | import com.vaadin.flow.component.Tag; 16 | import com.vaadin.flow.router.Route; 17 | 18 | @Tag("div") 19 | @Route(value = "any-role", registerAtStartup = false) 20 | // Quarkus interprets @PermitAll annotation differently from Flow 21 | // In Flow @PermitAll means all authenticated uses, whereas in Quarkus it lets 22 | // everybody in, even without authentication. 23 | // In Quarkus, the Flow @PermitAll behaviour can be obtained with 24 | // @RolesAllowed("**"). 25 | @RolesAllowed("**") 26 | public class AnyRoleView extends Component implements HasComponents { 27 | } 28 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/java/com/example/base/ErrorView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.example.base; 10 | 11 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 12 | import com.vaadin.flow.router.BeforeEnterEvent; 13 | import com.vaadin.flow.router.ErrorParameter; 14 | import com.vaadin.flow.router.HasErrorParameter; 15 | import com.vaadin.flow.router.NotFoundException; 16 | 17 | public class ErrorView extends VerticalLayout 18 | implements HasErrorParameter { 19 | @Override 20 | public int setErrorParameter(BeforeEnterEvent event, 21 | ErrorParameter parameter) { 22 | if (parameter.getException() instanceof NotFoundException) { 23 | throw (NotFoundException) parameter.getException(); 24 | } 25 | throw new RuntimeException(parameter.getCaughtException()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/example/base/ErrorView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.example.base; 10 | 11 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 12 | import com.vaadin.flow.router.BeforeEnterEvent; 13 | import com.vaadin.flow.router.ErrorParameter; 14 | import com.vaadin.flow.router.HasErrorParameter; 15 | import com.vaadin.flow.router.NotFoundException; 16 | 17 | public class ErrorView extends VerticalLayout 18 | implements HasErrorParameter { 19 | @Override 20 | public int setErrorParameter(BeforeEnterEvent event, 21 | ErrorParameter parameter) { 22 | if (parameter.getException() instanceof NotFoundException) { 23 | throw (NotFoundException) parameter.getException(); 24 | } 25 | throw new RuntimeException(parameter.getCaughtException()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /testing-support/uiunit-component-testers/src/main/java/com/vaadin/testbench/dontscan/typenotpresent/TypeNotPresentComponentTester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.dontscan.typenotpresent; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.testbench.unit.ComponentTester; 13 | import com.vaadin.testbench.unit.Tests; 14 | 15 | /** 16 | * Dummy tester whose annotation references a class from a third-party JAR that 17 | * might not be available at runtime. This is used to verify that scanning for 18 | * testers does not fail when the referenced component class is not on the 19 | * classpath. 20 | */ 21 | @Tests(TypeNotPresentComponent.class) 22 | public class TypeNotPresentComponentTester extends ComponentTester { 23 | 24 | public TypeNotPresentComponentTester(Component component) { 25 | super(component); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/dialog/DialogTester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.dialog; 10 | 11 | import com.vaadin.testbench.unit.ComponentTester; 12 | import com.vaadin.testbench.unit.Tests; 13 | 14 | @Tests(Dialog.class) 15 | public class DialogTester extends ComponentTester

{ 16 | /** 17 | * Wrap given component for testing. 18 | * 19 | * @param component 20 | * target component 21 | */ 22 | public DialogTester(Dialog component) { 23 | super(component); 24 | } 25 | 26 | /** 27 | * Open the dialog. 28 | */ 29 | public void open() { 30 | getComponent().open(); 31 | roundTrip(); 32 | } 33 | 34 | /** 35 | * Close the dialog. 36 | */ 37 | public void close() { 38 | getComponent().close(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/main/java/com/vaadin/testbench/BrowserTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench; 10 | 11 | import java.lang.annotation.ElementType; 12 | import java.lang.annotation.Retention; 13 | import java.lang.annotation.RetentionPolicy; 14 | import java.lang.annotation.Target; 15 | 16 | import org.junit.jupiter.api.TestTemplate; 17 | import org.junit.jupiter.api.extension.ExtendWith; 18 | 19 | import com.vaadin.testbench.browser.MultipleBrowsersExtension; 20 | 21 | /** 22 | * Shorthand annotation for marking test methods in test class. 23 | *

24 | * Combines JUnit 5+ {@code @TestTemplate} together with 25 | * {@code @ExtendWith(CapabilitiesInvocationContextProvider.class)}. 26 | */ 27 | @Target(ElementType.METHOD) 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @TestTemplate 30 | @ExtendWith(MultipleBrowsersExtension.class) 31 | public @interface BrowserTest { 32 | 33 | } 34 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/main/java/com/vaadin/testUI/PageObjectView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testUI; 10 | 11 | import com.vaadin.flow.component.html.Div; 12 | import com.vaadin.flow.router.Route; 13 | 14 | @Route("PageObjectView") 15 | public class PageObjectView extends Div { 16 | 17 | public PageObjectView() { 18 | Div someDiv = new Div(); 19 | someDiv.setText("Some div"); 20 | 21 | MyComponentWithId idView = new MyComponentWithId(); 22 | MyComponentWithClasses classesView = new MyComponentWithClasses(); 23 | 24 | Div anotherDiv = new Div(); 25 | anotherDiv.setText("Some div"); 26 | 27 | add(someDiv, idView, classesView, anotherDiv); 28 | 29 | CustomGrid customGrid = new CustomGrid(); 30 | CustomTreeGrid customTreeGrid = new CustomTreeGrid(); 31 | add(customGrid, customTreeGrid); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/java/com/testapp/MyRouteNotFoundError.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.testapp; 10 | 11 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 12 | import com.vaadin.flow.router.BeforeEnterEvent; 13 | import com.vaadin.flow.router.ErrorParameter; 14 | import com.vaadin.flow.router.HasErrorParameter; 15 | import com.vaadin.flow.router.NotFoundException; 16 | 17 | /** 18 | * Having an app-custom [NotFoundException] handler should not crash the mocking 19 | * process: https://github.com/mvysny/karibu-testing/issues/50 20 | */ 21 | public class MyRouteNotFoundError extends VerticalLayout 22 | implements HasErrorParameter { 23 | @Override 24 | public int setErrorParameter(BeforeEnterEvent event, 25 | ErrorParameter parameter) { 26 | throw new RuntimeException(parameter.getException()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/main/java/com/vaadin/testUI/ParameterizedView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testUI; 10 | 11 | import com.vaadin.flow.component.html.Div; 12 | import com.vaadin.flow.component.html.Span; 13 | import com.vaadin.flow.router.BeforeEvent; 14 | import com.vaadin.flow.router.HasUrlParameter; 15 | import com.vaadin.flow.router.Route; 16 | 17 | @Route("ParameterizedView") 18 | public class ParameterizedView extends Div implements HasUrlParameter { 19 | 20 | private final Span parameterHolder; 21 | 22 | public ParameterizedView() { 23 | parameterHolder = new Span("EMPTY"); 24 | parameterHolder.setId("parameter-holder"); 25 | add(parameterHolder); 26 | } 27 | 28 | @Override 29 | public void setParameter(BeforeEvent event, String parameter) { 30 | parameterHolder.setText("PARAMETER: " + parameter); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/testapp/MyRouteNotFoundError.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.testapp; 10 | 11 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 12 | import com.vaadin.flow.router.BeforeEnterEvent; 13 | import com.vaadin.flow.router.ErrorParameter; 14 | import com.vaadin.flow.router.HasErrorParameter; 15 | import com.vaadin.flow.router.NotFoundException; 16 | 17 | /** 18 | * Having an app-custom [NotFoundException] handler should not crash the mocking 19 | * process: https://github.com/mvysny/karibu-testing/issues/50 20 | */ 21 | public class MyRouteNotFoundError extends VerticalLayout 22 | implements HasErrorParameter { 23 | @Override 24 | public int setErrorParameter(BeforeEnterEvent event, 25 | ErrorParameter parameter) { 26 | throw new RuntimeException(parameter.getException()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/test/java/com/vaadin/tests/SVGIT.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests; 10 | 11 | import org.junit.Assert; 12 | import org.junit.Test; 13 | import org.openqa.selenium.By; 14 | 15 | import com.vaadin.flow.component.Component; 16 | import com.vaadin.testUI.SVGView; 17 | import com.vaadin.testbench.parallel.BrowserUtil; 18 | 19 | public class SVGIT extends AbstractTB6Test { 20 | 21 | @Override 22 | protected Class getTestView() { 23 | return SVGView.class; 24 | } 25 | 26 | @Test 27 | public void click() { 28 | if (BrowserUtil.isSafari(this.getDesiredCapabilities())) { 29 | return; // Skip for Safari 11. 30 | } 31 | openTestURL(); 32 | findElement(By.id("ball")).click(); 33 | Assert.assertEquals("clicked", 34 | findElement(By.tagName("body")).getText()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vaadin-testbench-shared/src/main/java/com/vaadin/testbench/parallel/Browser.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.parallel; 10 | 11 | import org.openqa.selenium.remote.DesiredCapabilities; 12 | 13 | import com.vaadin.testbench.annotations.RunLocally; 14 | 15 | /** 16 | * Enumerates the most commonly used browsers. This enumeration can be used in 17 | * the {@link RunLocally} annotation 18 | */ 19 | public enum Browser { 20 | FIREFOX, CHROME, SAFARI, EDGE; 21 | 22 | private Browser() { 23 | } 24 | 25 | public DesiredCapabilities getDesiredCapabilities() { 26 | switch (this) { 27 | case CHROME: 28 | return BrowserUtil.chrome(); 29 | case EDGE: 30 | return BrowserUtil.edge(); 31 | case SAFARI: 32 | return BrowserUtil.safari(); 33 | case FIREFOX: 34 | default: 35 | return BrowserUtil.firefox(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/flow/component/html/testbench/HtmlContainerTester.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.html.testbench; 10 | 11 | import com.vaadin.flow.component.HtmlContainer; 12 | 13 | public class HtmlContainerTester 14 | extends HtmlComponentTester { 15 | /** 16 | * Wrap given component for testing. 17 | * 18 | * @param component 19 | * target component 20 | */ 21 | public HtmlContainerTester(T component) { 22 | super(component); 23 | } 24 | 25 | /** 26 | * Get the text for target html component. 27 | * 28 | * @return text of component 29 | * @throws IllegalStateException 30 | * if component not visible 31 | */ 32 | @Override 33 | public String getText() { 34 | ensureVisible(); 35 | return getComponent().getText(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/test/java/com/vaadin/tests/elements/ExecuteJavascriptIT.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests.elements; 10 | 11 | import org.junit.Assert; 12 | import org.junit.Test; 13 | 14 | import com.vaadin.flow.component.Component; 15 | import com.vaadin.testUI.ElementQueryView; 16 | import com.vaadin.testbench.TestBenchElement; 17 | import com.vaadin.tests.AbstractTB6Test; 18 | 19 | public class ExecuteJavascriptIT extends AbstractTB6Test { 20 | 21 | @Override 22 | protected Class getTestView() { 23 | return ElementQueryView.class; 24 | } 25 | 26 | @Test 27 | public void getProperty() throws Exception { 28 | openTestURL(); 29 | 30 | TestBenchElement button = $(NativeButtonElement.class).first(); 31 | Long offsetTop = button.getPropertyDouble("offsetTop").longValue(); 32 | Assert.assertEquals(Long.valueOf(0), offsetTop); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/SVGIT.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests; 10 | 11 | import org.junit.jupiter.api.Assertions; 12 | import org.openqa.selenium.By; 13 | 14 | import com.vaadin.flow.component.Component; 15 | import com.vaadin.testUI.SVGView; 16 | import com.vaadin.testbench.BrowserTest; 17 | import com.vaadin.testbench.parallel.BrowserUtil; 18 | 19 | public class SVGIT extends AbstractBrowserTB9Test { 20 | 21 | @Override 22 | protected Class getTestView() { 23 | return SVGView.class; 24 | } 25 | 26 | @BrowserTest 27 | public void click() { 28 | if (BrowserUtil.isSafari(getCapabilities())) { 29 | return; // Skip for Safari 11. 30 | } 31 | openTestURL(); 32 | findElement(By.id("ball")).click(); 33 | Assertions.assertEquals("clicked", 34 | findElement(By.tagName("body")).getText()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vaadin-testbench-shared/src/main/java/com/vaadin/testbench/annotations/RunOnHub.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.annotations; 10 | 11 | import java.lang.annotation.ElementType; 12 | import java.lang.annotation.Inherited; 13 | import java.lang.annotation.Retention; 14 | import java.lang.annotation.RetentionPolicy; 15 | import java.lang.annotation.Target; 16 | 17 | import org.openqa.selenium.WebDriver; 18 | 19 | /** 20 | *

21 | * Test classes annotated with RunOnHub will be run on the hub whose host is 22 | * defined by its value. Default value is "localhost". 23 | *

24 | * 25 | *

26 | * This parameter will be used to instantiate the {@link WebDriver}.
27 | *

28 | * 29 | * Usage:
30 | * 31 | * @RunOnHub("hub.host.example.com"); 32 | * 33 | */ 34 | @Retention(RetentionPolicy.RUNTIME) 35 | @Target(ElementType.TYPE) 36 | @Inherited 37 | public @interface RunOnHub { 38 | 39 | public String value() default "localhost"; 40 | } 41 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/elements/ExecuteJavascriptIT.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests.elements; 10 | 11 | import org.junit.jupiter.api.Assertions; 12 | 13 | import com.vaadin.flow.component.Component; 14 | import com.vaadin.testUI.ElementQueryView; 15 | import com.vaadin.testbench.BrowserTest; 16 | import com.vaadin.testbench.TestBenchElement; 17 | import com.vaadin.tests.AbstractBrowserTB9Test; 18 | 19 | public class ExecuteJavascriptIT extends AbstractBrowserTB9Test { 20 | 21 | @Override 22 | protected Class getTestView() { 23 | return ElementQueryView.class; 24 | } 25 | 26 | @BrowserTest 27 | public void getProperty() { 28 | openTestURL(); 29 | 30 | TestBenchElement button = $(NativeButtonElement.class).first(); 31 | Long offsetTop = button.getPropertyDouble("offsetTop").longValue(); 32 | Assertions.assertEquals(Long.valueOf(0), offsetTop); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vaadin-testbench-core/src/test/java/com/vaadin/testbench/IPAddressTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench; 10 | 11 | import org.junit.Assert; 12 | import org.junit.Test; 13 | 14 | public class IPAddressTest { 15 | 16 | @Test 17 | public void siteLocalAddress() { 18 | // Can't know if the machine running the test actually has a site local 19 | // address... 20 | try { 21 | String address = IPAddress.findSiteLocalAddress(); 22 | Assert.assertTrue(address.startsWith("10.") 23 | // 172.16.0.0/12 IP addresses: 172.16.0.0 – 172.31.255.255 24 | || address.matches("172\\.(1[6-9]|2[0-9]|3[0-1])\\..*") 25 | || address.startsWith("192.168.")); 26 | } catch (RuntimeException e) { 27 | Assert.assertEquals( 28 | "No compatible (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) IP address found.", 29 | e.getMessage()); 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/listbox/ListBoxView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.listbox; 10 | 11 | import java.util.Arrays; 12 | import java.util.List; 13 | 14 | import com.vaadin.flow.component.Component; 15 | import com.vaadin.flow.component.HasComponents; 16 | import com.vaadin.flow.component.Tag; 17 | import com.vaadin.flow.router.Route; 18 | 19 | @Tag("div") 20 | @Route(value = "list-boxes", registerAtStartup = false) 21 | public class ListBoxView extends Component implements HasComponents { 22 | ListBox listBox; 23 | MultiSelectListBox multiSelectListBox; 24 | 25 | List selection = Arrays.asList("one", "two"); 26 | 27 | public ListBoxView() { 28 | listBox = new ListBox<>(); 29 | listBox.setItems(selection); 30 | 31 | multiSelectListBox = new MultiSelectListBox<>(); 32 | multiSelectListBox.setItems(selection); 33 | 34 | add(listBox, multiSelectListBox); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/testbench/unit/Tests.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.unit; 10 | 11 | import java.lang.annotation.ElementType; 12 | import java.lang.annotation.Retention; 13 | import java.lang.annotation.RetentionPolicy; 14 | import java.lang.annotation.Target; 15 | 16 | import com.vaadin.flow.component.Component; 17 | 18 | /** 19 | * Wrapper annotation for indicating which components a wrapper implementation 20 | * supports. 21 | *

22 | * This is used for automatically selecting a wrapper implementation for a given 23 | * component. 24 | */ 25 | @Target({ ElementType.TYPE }) 26 | @Retention(RetentionPolicy.RUNTIME) 27 | public @interface Tests { 28 | 29 | /** 30 | * Array of the classes that is wrapped by the annotated 31 | * {@link ComponentTester} 32 | * 33 | * @return {@link Component} classes that can be wrapped 34 | */ 35 | Class[] value() default {}; 36 | 37 | String[] fqn() default {}; 38 | } 39 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/kotlin/com/vaadin/testbench/unit/mocks/MockVaadinSession.kt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2022 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * 7 | * See for the full 8 | * license. 9 | */ 10 | package com.vaadin.testbench.unit.mocks 11 | 12 | import com.vaadin.flow.server.VaadinService 13 | import com.vaadin.flow.server.VaadinSession 14 | import com.vaadin.testbench.unit.internal.MockVaadin 15 | import com.vaadin.testbench.unit.internal.UIFactory 16 | 17 | /** 18 | * A Vaadin Session with one important difference: 19 | * 20 | * * Creates a new session when this one is closed. This is used to simulate a logout 21 | * which closes the session - we need to have a new fresh session to be able to continue testing. 22 | * In order to do that, simply override [close], call `super.close()` then call 23 | * [MockVaadin.afterSessionClose]. 24 | */ 25 | open class MockVaadinSession(service: VaadinService, 26 | val uiFactory: UIFactory 27 | ) : VaadinSession(service) { 28 | override fun close() { 29 | super.close() 30 | MockVaadin.afterSessionClose(this, uiFactory) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/java/com/vaadin/testbench/IPAddressTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench; 10 | 11 | import org.junit.jupiter.api.Assertions; 12 | import org.junit.jupiter.api.Test; 13 | 14 | public class IPAddressTest { 15 | 16 | @Test 17 | public void siteLocalAddress() { 18 | // Can't know if the machine running the test actually has a site local 19 | // address... 20 | try { 21 | String address = IPAddress.findSiteLocalAddress(); 22 | Assertions.assertTrue(address.startsWith("10.") 23 | // 172.16.0.0/12 IP addresses: 172.16.0.0 – 172.31.255.255 24 | || address.matches("172\\.(1[6-9]|2[0-9]|3[0-1])\\..*") 25 | || address.startsWith("192.168.")); 26 | } catch (RuntimeException e) { 27 | Assertions.assertEquals( 28 | "No compatible (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) IP address found.", 29 | e.getMessage()); 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/main/java/com/vaadin/testbench/browser/BrowserTestInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.browser; 10 | 11 | import org.openqa.selenium.Capabilities; 12 | import org.openqa.selenium.WebDriver; 13 | 14 | import com.vaadin.testbench.parallel.Browser; 15 | 16 | /** 17 | * Record that is automatically resolved by {@link BrowserExtension} providing 18 | * most important information on currently run test. 19 | * 20 | * @param driver 21 | * reference to {@link WebDriver} 22 | * @param capabilities 23 | * immutable list of capabilities 24 | * @param hubHostname 25 | * hostname of the hub 26 | * @param runLocallyBrowser 27 | * {@link Browser} used for local execution 28 | * @param runLocallyBrowserVersion 29 | * version of {@link Browser} used for local execution 30 | */ 31 | public record BrowserTestInfo(WebDriver driver, Capabilities capabilities, 32 | String hubHostname, Browser runLocallyBrowser, 33 | String runLocallyBrowserVersion) { 34 | 35 | } 36 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/routerlink/RouterLinkUrlParameterTargetView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.routerlink; 10 | 11 | import com.vaadin.flow.component.HasComponents; 12 | import com.vaadin.flow.component.Tag; 13 | import com.vaadin.flow.router.BeforeEvent; 14 | import com.vaadin.flow.router.HasUrlParameter; 15 | import com.vaadin.flow.router.OptionalParameter; 16 | import com.vaadin.flow.router.Route; 17 | 18 | @Tag(Tag.DIV) 19 | @Route(value = RouterLinkUrlParameterTargetView.ROUTE, registerAtStartup = false) 20 | public class RouterLinkUrlParameterTargetView extends AbstractTargetView 21 | implements HasComponents, HasUrlParameter { 22 | 23 | public static final String ROUTE = "router-link-url-parameter-target"; 24 | 25 | @Override 26 | public void setParameter(BeforeEvent event, 27 | @OptionalParameter String parameter) { 28 | message.setText("URL Parameter Target View: { " 29 | + (parameter != null ? parameter : "") + " }"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/kotlin/com/vaadin/testbench/unit/internal/CompositeTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000-2024 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | 10 | package com.vaadin.testbench.unit.internal 11 | 12 | import com.vaadin.flow.component.Component 13 | import com.vaadin.flow.component.Composite 14 | import com.vaadin.flow.component.Tag 15 | import com.vaadin.flow.component.html.Span 16 | import com.github.mvysny.dynatest.DynaNodeGroup 17 | import com.github.mvysny.dynatest.DynaTestDsl 18 | 19 | @DynaTestDsl 20 | internal fun DynaNodeGroup.compositeTests() { 21 | beforeEach { MockVaadin.setup() } 22 | afterEach { MockVaadin.tearDown() } 23 | 24 | test("Composite<*> causes virtual children to be fetched twice") { 25 | class MyComposite : Composite() 26 | 27 | val comp = MyComposite() 28 | comp._expectOne { text = "virtual child" } 29 | } 30 | } 31 | 32 | @Tag("my-test") 33 | class VirtualChildComponent : Component() { 34 | init { 35 | val child = Span("virtual child") 36 | element.appendVirtualChild(child.element) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/kotlin/com/vaadin/testbench/unit/internal/CompositeTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000-2024 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | 10 | package com.vaadin.testbench.unit.internal 11 | 12 | import com.vaadin.flow.component.Component 13 | import com.vaadin.flow.component.Composite 14 | import com.vaadin.flow.component.Tag 15 | import com.vaadin.flow.component.html.Span 16 | import com.github.mvysny.dynatest.DynaNodeGroup 17 | import com.github.mvysny.dynatest.DynaTestDsl 18 | 19 | @DynaTestDsl 20 | internal fun DynaNodeGroup.compositeTests() { 21 | beforeEach { MockVaadin.setup() } 22 | afterEach { MockVaadin.tearDown() } 23 | 24 | test("Composite<*> causes virtual children to be fetched twice") { 25 | class MyComposite : Composite() 26 | 27 | val comp = MyComposite() 28 | comp._expectOne { text = "virtual child" } 29 | } 30 | } 31 | 32 | @Tag("my-test") 33 | class VirtualChildComponent : Component() { 34 | init { 35 | val child = Span("virtual child") 36 | element.appendVirtualChild(child.element) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/upload/UploadDeprecatedAPIView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.upload; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.HasComponents; 13 | import com.vaadin.flow.component.Tag; 14 | import com.vaadin.flow.component.upload.receivers.MemoryBuffer; 15 | import com.vaadin.flow.component.upload.receivers.MultiFileMemoryBuffer; 16 | import com.vaadin.flow.router.Route; 17 | 18 | @Tag("div") 19 | @Route(value = "upload", registerAtStartup = false) 20 | @Deprecated 21 | public class UploadDeprecatedAPIView extends Component 22 | implements HasComponents { 23 | 24 | MemoryBuffer receiver = new MemoryBuffer(); 25 | MultiFileMemoryBuffer multiReceiver = new MultiFileMemoryBuffer(); 26 | Upload uploadSingle; 27 | Upload uploadMulti; 28 | 29 | public UploadDeprecatedAPIView() { 30 | uploadSingle = new Upload(receiver); 31 | uploadMulti = new Upload(multiReceiver); 32 | 33 | add(uploadSingle, uploadMulti); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/testbench/unit/ComponentTesterPackages.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.unit; 10 | 11 | import java.lang.annotation.ElementType; 12 | import java.lang.annotation.Retention; 13 | import java.lang.annotation.RetentionPolicy; 14 | import java.lang.annotation.Target; 15 | 16 | /** 17 | * Annotation to use to scan given packages for component wrappers outside the 18 | * default {@code com.vaadin.flow.component}. 19 | *

20 | * This makes adding custom component wrappers simpler as they can then use 21 | * package protected fields and methods. 22 | */ 23 | @Target({ ElementType.TYPE }) 24 | @Retention(RetentionPolicy.RUNTIME) 25 | public @interface ComponentTesterPackages { 26 | 27 | /** 28 | * Array of packages to scan for {@link ComponentTester} implementations. 29 | *

30 | * Implementation should use the {@link Tests} annotation to be used 31 | * automatically in the {@code wraps(Component)} method. 32 | * 33 | * @return String array of packages to scan 34 | */ 35 | String[] value(); 36 | } 37 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/main/java/com/vaadin/testUI/SVGView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testUI; 10 | 11 | import com.vaadin.flow.component.AttachEvent; 12 | import com.vaadin.flow.component.html.Div; 13 | import com.vaadin.flow.router.Route; 14 | 15 | @Route("SVGView") 16 | public class SVGView extends Div { 17 | 18 | private Div placeholder; 19 | 20 | @Override 21 | protected void onAttach(AttachEvent attachEvent) { 22 | super.onAttach(attachEvent); 23 | add(placeholder = new Div()); 24 | 25 | placeholder.getElement().setProperty("innerHTML", 26 | "\n" 27 | + " \n" 28 | + " Sorry, your browser does not support inline SVG." 29 | + ""); 30 | attachEvent.getUI().getPage().executeJs( 31 | "document.getElementById('ball').addEventListener('click', function() {document.body.innerText='clicked';})"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/java/com/vaadin/flow/component/tabs/TabSheetView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.flow.component.tabs; 10 | 11 | import com.vaadin.flow.component.Component; 12 | import com.vaadin.flow.component.HasComponents; 13 | import com.vaadin.flow.component.Tag; 14 | import com.vaadin.flow.component.html.Span; 15 | import com.vaadin.flow.router.Route; 16 | 17 | @Tag("div") 18 | @Route(value = "tabsheet", registerAtStartup = false) 19 | public class TabSheetView extends Component implements HasComponents { 20 | 21 | TabSheet tabs; 22 | Tab details; 23 | Span detailsContent = new Span("Details contents"); 24 | Tab payment; 25 | Span paymentContent = new Span("Payment contents"); 26 | 27 | Tab shipping; 28 | Span shippingContent = new Span("Shipping contents"); 29 | 30 | public TabSheetView() { 31 | tabs = new TabSheet(); 32 | details = tabs.add(new Tab("Details"), detailsContent); 33 | payment = tabs.add("Payment", paymentContent); 34 | shipping = tabs.add("Shipping", shippingContent); 35 | add(tabs); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/main/java/com/vaadin/testUI/SVGView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testUI; 10 | 11 | import com.vaadin.flow.component.AttachEvent; 12 | import com.vaadin.flow.component.html.Div; 13 | import com.vaadin.flow.router.Route; 14 | 15 | @Route("SVGView") 16 | public class SVGView extends Div { 17 | 18 | private Div placeholder; 19 | 20 | @Override 21 | protected void onAttach(AttachEvent attachEvent) { 22 | super.onAttach(attachEvent); 23 | add(placeholder = new Div()); 24 | 25 | placeholder.getElement().setProperty("innerHTML", 26 | "\n" 27 | + " \n" 28 | + " Sorry, your browser does not support inline SVG." 29 | + ""); 30 | attachEvent.getUI().getPage().executeJs( 31 | "document.getElementById('ball').addEventListener('click', function() {document.body.innerText='clicked';})"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vaadin-testbench-core-junit5/src/test/java/com/vaadin/testbench/browser/ParameterizedBrowserTestSingleBrowserFromBrowserConfigurationTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.browser; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | import org.openqa.selenium.remote.DesiredCapabilities; 15 | 16 | import com.vaadin.testbench.annotations.BrowserConfiguration; 17 | import com.vaadin.testbench.annotations.RunOnHub; 18 | import com.vaadin.testbench.parallel.Browser; 19 | import com.vaadin.testbench.parallel.BrowserUtil; 20 | 21 | @RunOnHub("remote.host") 22 | class ParameterizedBrowserTestSingleBrowserFromBrowserConfigurationTest 23 | extends ParameterizedBrowserTestTest.Support { 24 | 25 | @BrowserConfiguration 26 | public List getBrowserConfiguration() { 27 | ArrayList capabilities = new ArrayList<>(); 28 | capabilities.add(BrowserUtil.chrome()); 29 | return capabilities; 30 | } 31 | 32 | public ParameterizedBrowserTestSingleBrowserFromBrowserConfigurationTest() { 33 | super(Browser.CHROME); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests/src/test/java/com/vaadin/tests/TB6TestBrowserFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests; 10 | 11 | import org.openqa.selenium.Platform; 12 | import org.openqa.selenium.remote.DesiredCapabilities; 13 | 14 | import com.vaadin.testbench.parallel.Browser; 15 | import com.vaadin.testbench.parallel.DefaultBrowserFactory; 16 | import com.vaadin.testbench.parallel.SauceLabsIntegration; 17 | 18 | /** 19 | * Specifies default browser configuration for {@link AbstractTB6Test} tests. 20 | */ 21 | public class TB6TestBrowserFactory extends DefaultBrowserFactory { 22 | 23 | @Override 24 | public DesiredCapabilities create(Browser browser, String version, 25 | Platform platform) { 26 | if (browser != Browser.SAFARI) { 27 | platform = Platform.WIN10; 28 | } 29 | DesiredCapabilities desiredCapabilities = super.create(browser, version, 30 | platform); 31 | 32 | SauceLabsIntegration.setSauceLabsOption(desiredCapabilities, 33 | "screenResolution", "1600x1200"); 34 | return desiredCapabilities; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/TB9TestBrowserFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.tests; 10 | 11 | import org.openqa.selenium.Platform; 12 | import org.openqa.selenium.remote.DesiredCapabilities; 13 | 14 | import com.vaadin.testbench.parallel.Browser; 15 | import com.vaadin.testbench.parallel.DefaultBrowserFactory; 16 | import com.vaadin.testbench.parallel.SauceLabsIntegration; 17 | 18 | /** 19 | * Specifies default browser configuration for {@link AbstractTB9Test} tests. 20 | */ 21 | public class TB9TestBrowserFactory extends DefaultBrowserFactory { 22 | 23 | @Override 24 | public DesiredCapabilities create(Browser browser, String version, 25 | Platform platform) { 26 | if (browser != Browser.SAFARI) { 27 | platform = Platform.WIN10; 28 | } 29 | DesiredCapabilities desiredCapabilities = super.create(browser, version, 30 | platform); 31 | 32 | SauceLabsIntegration.setSauceLabsOption(desiredCapabilities, 33 | "screenResolution", "1600x1200"); 34 | return desiredCapabilities; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-shared/src/main/java/com/vaadin/testbench/unit/MouseButton.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.unit; 10 | 11 | /** 12 | * Enums for mouse button values in click events. 13 | *

14 | * Default button values are as follows: 15 | *

16 | *
-1: No button
17 | *
0: The primary button, typically the left mouse button
18 | *
1: The middle button,
19 | *
2: The secondary button, typically the right mouse button
20 | *
3: The first additional button, typically the back button
21 | *
4: The second additional button, typically the forward button
22 | *
5+: More additional buttons without any typical meanings
23 | *
24 | */ 25 | public enum MouseButton { 26 | 27 | NO_BUTTON(-1), LEFT(0), MIDDLE(1), RIGHT(2), BACK(3), FORWARD(4); 28 | 29 | private int button; 30 | 31 | MouseButton(int button) { 32 | this.button = button; 33 | } 34 | 35 | /** 36 | * Get value associated with the button by default. 37 | * 38 | * @return button value 39 | */ 40 | public int getButton() { 41 | return button; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/kotlin/com/vaadin/testbench/unit/TestInitListener.kt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2022 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * 7 | * See for the full 8 | * license. 9 | */ 10 | package com.vaadin.testbench.unit 11 | 12 | import com.vaadin.flow.server.ServiceInitEvent 13 | import com.vaadin.flow.server.VaadinServiceInitListener 14 | 15 | /** 16 | * This class is picked up automatically by Vaadin (since it's registered via META-INF/services). We then test elsewhere 17 | * that MockVaadin-mocked env indeed picked up this init listener and executed it. 18 | */ 19 | class TestInitListener : VaadinServiceInitListener { 20 | override fun serviceInit(event: ServiceInitEvent) { 21 | serviceInitCalled = true 22 | event.source.addUIInitListener { e -> 23 | uiInitCalled = true 24 | e.ui.addBeforeEnterListener { uiBeforeEnterCalled = true } 25 | } 26 | } 27 | 28 | companion object { 29 | var serviceInitCalled: Boolean = false 30 | var uiInitCalled = false 31 | var uiBeforeEnterCalled = false 32 | fun clearInitFlags() { 33 | serviceInitCalled = false 34 | uiInitCalled = false 35 | uiBeforeEnterCalled = false 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vaadin-testbench-unit-junit5/src/test/kotlin/com/vaadin/testbench/unit/TestInitListener.kt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2022 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * 7 | * See for the full 8 | * license. 9 | */ 10 | package com.vaadin.testbench.unit 11 | 12 | import com.vaadin.flow.server.ServiceInitEvent 13 | import com.vaadin.flow.server.VaadinServiceInitListener 14 | 15 | /** 16 | * This class is picked up automatically by Vaadin (since it's registered via META-INF/services). We then test elsewhere 17 | * that MockVaadin-mocked env indeed picked up this init listener and executed it. 18 | */ 19 | class TestInitListener : VaadinServiceInitListener { 20 | override fun serviceInit(event: ServiceInitEvent) { 21 | serviceInitCalled = true 22 | event.source.addUIInitListener { e -> 23 | uiInitCalled = true 24 | e.ui.addBeforeEnterListener { uiBeforeEnterCalled = true } 25 | } 26 | } 27 | 28 | companion object { 29 | var serviceInitCalled: Boolean = false 30 | var uiInitCalled = false 31 | var uiBeforeEnterCalled = false 32 | fun clearInitFlags() { 33 | serviceInitCalled = false 34 | uiInitCalled = false 35 | uiBeforeEnterCalled = false 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vaadin-testbench-unit/src/test/java/com/vaadin/testbench/unit/viewscan4/byannotatedclass/DiscoverRoutesInAnnotatedClassPackageTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2025 Vaadin Ltd 3 | * 4 | * This program is available under Vaadin Commercial License and Service Terms. 5 | * 6 | * See for the full 7 | * license. 8 | */ 9 | package com.vaadin.testbench.unit.viewscan4.byannotatedclass; 10 | 11 | import java.util.Set; 12 | import java.util.stream.Collectors; 13 | 14 | import org.junit.Assert; 15 | import org.junit.Test; 16 | 17 | import com.vaadin.flow.component.Component; 18 | import com.vaadin.flow.router.RouteBaseData; 19 | import com.vaadin.flow.server.VaadinService; 20 | import com.vaadin.testbench.unit.UIUnit4Test; 21 | import com.vaadin.testbench.unit.ViewPackages; 22 | 23 | @ViewPackages 24 | public class DiscoverRoutesInAnnotatedClassPackageTest extends UIUnit4Test { 25 | 26 | @Test 27 | public void extendingBaseClass_runTest_routesAreDiscovered() { 28 | Set> routes = VaadinService.getCurrent() 29 | .getRouter().getRegistry().getRegisteredRoutes().stream() 30 | .map(RouteBaseData::getNavigationTarget) 31 | .collect(Collectors.toSet()); 32 | Assert.assertEquals(1, routes.size()); 33 | Assert.assertTrue(routes.contains(ViewPackagesTest4View.class)); 34 | } 35 | } 36 | --------------------------------------------------------------------------------