vaadin / testbench

Vaadin TestBench is a tool for automated user interface testing of Vaadin applications.
https://vaadin.com/testbench
Other
20 stars 22 forks source link

feat: add VirtualListTester #1797

Closed joelpop closed 6 months ago

joelpop commented 6 months ago

Description

Added VirtualListTester to enable VirtualLists to be unit tested with TestBench.

As this tester and GridTester both support LitRenderers, the common code from GridTester was extracted to an interface HasLitRenderer so it could be shared by both testers.

Because a VirtualList is used to display a large list of rows, for its testing Instancio was added as a test dependency to the project to facilitate randomized generation of values.

Fixes #1721

Type of change

Checklist

Additional for Feature type of change

ZheSun88 commented 6 months ago

Hi @joelpop and all,

Vaadin 24.4 RC release is scheduled on this week Wednesday. Can we make sure that this PR will be merged before that?

Thanks.

joelpop commented 6 months ago

Hi @joelpop and all,

Vaadin 24.4 RC release is scheduled on this week Wednesday. Can we make sure that this PR will be merged before that?

Thanks.

I will do my best. I have fixed and resolved most of the issues I knew about and that @mcollovati requested. I have just one item left.

ZheSun88 commented 6 months ago

if the PR is ready, remember to mark it ready for review (it is still a draft at the moment.)

joelpop commented 6 months ago

if the PR is ready, remember to mark it ready for review (it is still a draft at the moment.)

Yes, it is still draft pending one outstanding implementation question.

joelpop commented 6 months ago



Some change requests. Also, locally VirtualListTesterTest.virtualList_verifyComponentRenderer is failing with IllegalState Span[#first-name, text='AFIOSVXE'] is not visible!

Yes, this is why I had left the PR as draft. The reason this test was failing is because ComponentRenderer test methods in both GridTester and VirtualListTester return a copy of the component–not the actual rendered component, so if you then attempt to use that component's tester, you get that "not visible" error.

ZheSun88 commented 6 months ago

build failed with Vaadin Testbench UI Unit Test Shared module

 Failed to execute goal org.jetbrains.dokka:dokka-maven-plugin:1.6.21:javadoc (default) on project vaadin-testbench-unit-shared: A type incompatibility occurred while executing org.jetbrains.dokka:dokka-maven-plugin:1.6.21:javadoc: class com.intellij.psi.impl.source.PsiImmediateClassType cannot be cast to class com.intellij.psi.impl.source.PsiClassReferenceType (com.intellij.psi.impl.source.PsiImmediateClassType and com.intellij.psi.impl.source.PsiClassReferenceType are in unnamed module of loader java.net.URLClassLoader @4842598e)

found one related ticket from dokka plugin, from us.. https://github.com/Kotlin/dokka/issues/2509 maybe we should upgrade the plugin version, the latest is 1.9.20

test in PR https://github.com/vaadin/testbench/pull/1799

ZheSun88 commented 6 months ago

validation failure has been resolved by upgrading the kotlin.version and dokka.version to 1.9.20

mshabarov commented 6 months ago

@ZheSun88 just for note, this isn't a blocker for Vaadin 24.4 release, this was planned specifically for 24.4. We can merge at any point.