Project

General

Profile

task #7356

setup selenium test suite for cdm-vaadin

Added by Andreas Kohlbecker about 1 year ago. Updated 6 days ago.

Status:
In Progress
Priority:
Priority14
Category:
cdm-vaadin
Target version:
Start date:
04/19/2018
Due date:
% Done:

20%

Severity:
normal

Description

The primary option to setup a test suite for testing the cdm-vaadin UIs is to use the Vaadin Test Bench. Even if this product is open source (https://github.com/vaadin/testbench) it is a commercial product and purchasing a proper license seems required for using it even if the test bench can be compiled from source.

The major benefits of the Vaadin Test Bench over plain selenium seems to be:

  1. integrates application startup
  2. can run on a hub or parallelized -
  3. has "intelligent" wait() functionality "In pure Selenium, you need to use the wait methods explicitly, and know what to use and when. Vaadin TestBench works together with the client-side engine of Vaadin framework to immediately detect when the rendering is finished. Waiting is implicit, so you do not normally need to insert any wait commands yourself." (Book of Vaadin chapter 23.8.1. Waiting for Vaadin). This functionality is provided by the com.vaadin.testbench.commands.TestBenchCommandExecutor.waitForVaadin(). The waitForVaadin method is automatically called when specific WebDriver methods are invoked. The DriverInvocationHandler cares for this.
  4. Selenium Element for each of the Vaadin UI components

Options to replace the Vaadin Test Bench magic by own developments (number in the list correspond to the numbers above)

  1. starting of jetty before maven integration test and to stop it afterwards is quite easy to setup
  2. no need to do this in the test framework itself. Jenkins provides much better means to do that.
  3. The intelligent wait could be easily replaced by an own implementation
  4. not urgently needed

More details on the vaadin TestBench can be found in the master thesis for which the TestBench has been developed: rogozin.pdf

An alternative is to use selenium directly on the vaadin ui as demonstrated by the selenide project demo, Selenide by the way is an alternative to Selenium which promises to be simpler to use. Selenide code is at github:codeborne/selenide

More on selenide/vaadin:

Setting up test web application context with spring boot:

https://blog.ccbill.com/spring-boot-and-context-handling

Testdata

Testadata management either per DbUnit or spring-test:

spring-test

https://stackoverflow.com/questions/34617152/how-to-re-create-database-before-each-test-in-spring#37246354

e.g.:

@Transactional(value=JpaConfiguration.TRANSACTION_MANAGER_NAME)
@Sql(executionPhase=ExecutionPhase.BEFORE_TEST_METHOD,scripts="classpath:/test-sql/group2.sql")
public class GroupServiceTest extends TimeoffApplicationTests {

Related projects and frameworks:

General considerations on tests

rogozin.pdf (1.1 MB) Andreas Kohlbecker, 02/26/2019 01:40 PM

Associated revisions

Revision 74547d6a (diff)
Added by Andreas Kohlbecker 2 months ago

ref #7356 throwing RuntimeException in case of severe web application misconfiguration instead of just logging

Revision 28eb7ddd (diff)
Added by Andreas Kohlbecker 2 months ago

ref #7356 avoiding spring bean dependency cycle by adding @Lazy

Revision cb88358a (diff)
Added by Andreas Kohlbecker 2 months ago

ref #7356 upgrading goggle guava to 23.0 to conform to seleninde dependency which is used in cdm-vaadin

Revision 2d4efdc3 (diff)
Added by Andreas Kohlbecker 2 months ago

ref #7356 moving VaadinServletConfiguration from web.xml into CdmVaadinConfiguration

Revision 3870ac74 (diff)
Added by Andreas Kohlbecker 2 months ago

ref #7356 adding selenide and spring-boot dependencies

Revision 72cbb7ab (diff)
Added by Andreas Kohlbecker 2 months ago

ref #7356 foundation for selenide tests implemented

Revision a630e869 (diff)
Added by Andreas Kohlbecker 2 months ago

ref #7356 documentation on setting up the project for selenide tests

Revision 3480974e (diff)
Added by Andreas Kohlbecker 2 months ago

ref #7356 ignoring selenide tests for now since they conflict with other tests

Revision d56d4eab (diff)
Added by Andreas Kohlbecker about 1 month ago

ref #7356 throwing RuntimeException in case of severe web application misconfiguration instead of just logging

Revision 9659ae17 (diff)
Added by Andreas Kohlbecker about 1 month ago

ref #7356 avoiding spring bean dependency cycle by adding @Lazy

Revision 848968ba (diff)
Added by Andreas Kohlbecker about 1 month ago

ref #7356 upgrading goggle guava to 23.0 to conform to seleninde dependency which is used in cdm-vaadin

History

#1 Updated by Andreas Kohlbecker about 1 year ago

  • Description updated (diff)

#2 Updated by Andreas Kohlbecker about 1 year ago

  • Description updated (diff)

#3 Updated by Andreas Kohlbecker about 1 year ago

  • Description updated (diff)

#4 Updated by Andreas Kohlbecker about 1 year ago

  • Description updated (diff)

#5 Updated by Andreas Kohlbecker about 1 year ago

  • Description updated (diff)
  • Status changed from New to In Progress
  • % Done changed from 0 to 10

#6 Updated by Andreas Kohlbecker about 1 year ago

  • Tags changed from phycobank to phycobank, test, selenium

#7 Updated by Andreas Kohlbecker about 1 year ago

  • Description updated (diff)

#8 Updated by Andreas Kohlbecker about 1 year ago

  • Description updated (diff)

#9 Updated by Andreas Kohlbecker about 1 year ago

  • Description updated (diff)

#10 Updated by Andreas Kohlbecker 3 months ago

  • Target version changed from Vaadin Taxon Concept Editor to Reviewed Next Major Release

#11 Updated by Andreas Kohlbecker 3 months ago

  • Priority changed from New to Highest
  • Target version changed from Reviewed Next Major Release to Release 5.6

#12 Updated by Andreas Kohlbecker 3 months ago

  • Description updated (diff)

#13 Updated by Andreas Kohlbecker 3 months ago

  • Description updated (diff)

#14 Updated by Andreas Kohlbecker 3 months ago

  • Description updated (diff)

#15 Updated by Andreas Kohlbecker 3 months ago

  • Description updated (diff)

#16 Updated by Andreas Kohlbecker 3 months ago

Adding master thesis on Vaadin TestBench

#17 Updated by Andreas Kohlbecker 3 months ago

  • Description updated (diff)

#18 Updated by Andreas Kohlbecker 2 months ago

  • Description updated (diff)

#19 Updated by Andreas Kohlbecker 2 months ago

  • Description updated (diff)

#20 Updated by Andreas Kohlbecker 2 months ago

  • % Done changed from 10 to 20

#21 Updated by Andreas Kohlbecker about 2 months ago

  • Description updated (diff)

#22 Updated by Andreas Kohlbecker about 2 months ago

  • Priority changed from Highest to Priority14

#23 Updated by Andreas Kohlbecker about 1 month ago

  • Target version changed from Release 5.6 to Release 5.7

#24 Updated by Andreas Kohlbecker 6 days ago

  • Target version changed from Release 5.7 to Release 5.8

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)