[MGNLTEST-149] Selenium extension should operate lazy Created: 01/Apr/21  Updated: 28/Jun/21  Resolved: 28/Jun/21

Status: Closed
Project: Magnolia Test Framework
Component/s: None
Affects Version/s: 1.1.0
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Christoph Meier Assignee: Christoph Meier
Resolution: Fixed Votes: 0
Labels: VN-Testing
Remaining Estimate: Not Specified
Time Spent: 1d 7.75h
Original Estimate: Not Specified

Issue Links:
dependency
is depended upon by MGNLTEST-160 Fix shaky Login / provide AdminCentra... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Epic Link: core-TF-features-bugs-improvements

 Description   

Context

We now have four jupiter-5 extensions to be used for (new) Magnolia integration tests. Also their responsibilities are well separated.

Selenium is the extension enabling UI tests. If a test class has been enriched with the Selenium extension, beforeEach(ExtensionContext extensionContext) kicks in and always:

  • creates the webdriver
  • navigates the driver to magnoliaAuthor/.magnolia/admincentral
  • instantiates a VncRecordingHelper

See details on bitbucket

So, this happens before every method is executed.
This is fine, if the test method is a UI test, but for all others tests in the same class it is not required.

Acceptance criteria

Selenium sets up webdriver and VncRecordingHelper only if a test method injects PageObjects.

Use case

Generic

@MagnoliaIntegrationTest
public class ExampleTest {
    
    @Test
    void uiTest(PageObjects expect){ /* */ }
    
    @Test
    void nonUiIntTest(MagnoliaHttpClient client){ /* */}
    
    @Test 
    void foobarTest(PageObjects expect, MagnoliaHttpClient client){ /* */}
}

Concrete use case:

info.magnolia.functionaltests.ResourcesFunctionalTests



 Comments   
Comment by Christoph Meier [ 01/Apr/21 ]

Maybe, potentially this could be tackled together with MGNLTEST-142.

Comment by Christoph Meier [ 28/Jun/21 ]

integrated

Generated at Mon Feb 12 07:46:02 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.