[BUILD-592] Prohibit selenium API usage in functionaltests.* via Maven check Created: 24/Sep/19  Updated: 26/Dec/22  Resolved: 26/Dec/22

Status: Closed
Project: Build
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Neutral
Reporter: Christoph Meier Assignee: Christoph Meier
Resolution: Won't Do Votes: 0
Labels: QA&Testing, VN-Testing, fwk-infra-structure
Remaining Estimate: Not Specified
Time Spent: 1.75d
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:
Epic Link: core-TF-features-bugs-improvements
Team: Foundation

 Description   

A Magnolia ui test writer must not use the selenium WebDriver API directly in the tests, instead (s)he should use Magnolia page objects. This applies for tests for Magnolia 6.1 and newer versions.

In order to enforce this rule, Maven should check whether test classes comply with this rule and let the build fail in case the rule is violated.

Packages which must follow the rule:

in CE
it.info.magnolia.functionaltests.*

In dx-core
it.info.magnolia.functionaltests.*

Prohibited imports in the classes to be checked

The most "clear" rule would be to prohibit everything from org.openqa.selenium.*.

however, page objects sometimes throw org.openqa.selenium.NoSuchElementException, and sometimes we even want to check for this exact exception.
This said - to install such a "Prohibit selenium API usage", we must introduce our own Magnolia UI exception.

To be defined / decided

  • Package name of the new functional tests in dx-core
  • The introduction of a new Magnolia test exception to allow a strict rule prohibiting the complete selenium package in test classes.


 Comments   
Comment by Maxime Michel [ 15/Nov/21 ]

To implement with https://github.com/skuzzle/restrict-imports-enforcer-rule

Comment by Christoph Meier [ 18/Nov/21 ]

Testing it on ce
https://git.magnolia-cms.com/projects/PLATFORM/repos/ce/pull-requests/451/overview
PR on jenkins: 
https://jenkins.magnolia-cms.com/job/platform/job/ce/view/change-requests/job/PR-451/ 

 

Testing it on dx-core
https://git.magnolia-cms.com/projects/PLATFORM/repos/dx-core/pull-requests/203/overview 
PR on jenkins:
https://jenkins.magnolia-cms.com/job/platform/job/dx-core/view/change-requests/job/PR-203/

 

Comment by Christoph Meier [ 26/Dec/22 ]

This seems not necessary. Topic was discussed also in Group of interest for testing & QA - iirc. No need to enforce this.
Hence closing the ticket

Generated at Sun Feb 11 23:43:18 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.